USB not working when laptop started without external power

Hi there,

I’ve got a bit of a strange problem with the USB ports, they only work if I plug in my laptop before starting it.
If I start it unplugged none of the USB work, not even if I plug in the power after.
The even stranger thing is that the USB works at the very beginning of the booting process, as I can use a USB keyboard to decrypt the disk at the very beginning.

Here’s what lsusb -v yields when the laptop has been started unplugged:

Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               3.10
  bDeviceClass            9 Hub
  bDeviceSubClass         0 
  bDeviceProtocol         3 
  bMaxPacketSize0         9
  idVendor           0x1d6b Linux Foundation
  idProduct          0x0003 3.0 root hub
  bcdDevice            5.14
  iManufacturer           3 Linux 5.14.21-150500.55.19-default xhci-hcd
  iProduct                2 xHCI Host Controller
  iSerial                 1 0000:04:00.4
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x001f
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 Full speed (or root) hub
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0004  1x 4 bytes
        bInterval              12
        bMaxBurst               0

Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0 
  bDeviceProtocol         1 Single TT
  bMaxPacketSize0        64
  idVendor           0x1d6b Linux Foundation
  idProduct          0x0002 2.0 root hub
  bcdDevice            5.14
  iManufacturer           3 Linux 5.14.21-150500.55.19-default xhci-hcd
  iProduct                2 xHCI Host Controller
  iSerial                 1 0000:04:00.4
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0019
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 Full speed (or root) hub
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0004  1x 4 bytes
        bInterval              12

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               3.10
  bDeviceClass            9 Hub
  bDeviceSubClass         0 
  bDeviceProtocol         3 
  bMaxPacketSize0         9
  idVendor           0x1d6b Linux Foundation
  idProduct          0x0003 3.0 root hub
  bcdDevice            5.14
  iManufacturer           3 Linux 5.14.21-150500.55.19-default xhci-hcd
  iProduct                2 xHCI Host Controller
  iSerial                 1 0000:04:00.3
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x001f
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 Full speed (or root) hub
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0004  1x 4 bytes
        bInterval              12
        bMaxBurst               0

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0 
  bDeviceProtocol         1 Single TT
  bMaxPacketSize0        64
  idVendor           0x1d6b Linux Foundation
  idProduct          0x0002 2.0 root hub
  bcdDevice            5.14
  iManufacturer           3 Linux 5.14.21-150500.55.19-default xhci-hcd
  iProduct                2 xHCI Host Controller
  iSerial                 1 0000:04:00.3
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0019
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 Full speed (or root) hub
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0004  1x 4 bytes
        bInterval              12

also, dmesg --follow-new does not show any message when I plug in a USB device.

Any suggestion?

This is the output of lsusb -v if I start the laptop plugged in (truncated to the 1st entry):


Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               3.10
  bDeviceClass            9 Hub
  bDeviceSubClass         0 
  bDeviceProtocol         3 
  bMaxPacketSize0         9
  idVendor           0x1d6b Linux Foundation
  idProduct          0x0003 3.0 root hub
  bcdDevice            5.14
  iManufacturer           3 Linux 5.14.21-150500.55.19-default xhci-hcd
  iProduct                2 xHCI Host Controller
  iSerial                 1 0000:04:00.4
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x001f
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 Full speed (or root) hub
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0004  1x 4 bytes
        bInterval              12
        bMaxBurst               0



and this is dmesg:

[  362.458542] usb 1-2: new full-speed USB device number 6 using xhci_hcd
[  362.625566] usb 1-2: New USB device found, idVendor=08bb, idProduct=2902, bcdDevice= 1.00
[  362.625596] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  362.625615] usb 1-2: Product: USB Audio CODEC 
[  362.625630] usb 1-2: Manufacturer: Burr-Brown from TI              
[  362.643991] input: Burr-Brown from TI               USB Audio CODEC  as /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-2/1-2:1.3/0003:08BB:2902.0009/input/input43
[  362.702916] hid-generic 0003:08BB:2902.0009: input,hidraw4: USB HID v1.00 Device [Burr-Brown from TI               USB Audio CODEC ] on usb-0000:04:00.3-2/input3
[  363.875364] usbcore: registered new interface driver snd-usb-audio

How old is the Laptop?
Can the Laptop’s battery support a few hours of use without having the battery’s charger plugged in?
Are the battery’s contacts clean?

The laptop is a few years old, but other than this issue it works ok.
I can work for a few hours without recharging; as for the battery contacts, these are not accessible as the battery is not removable

@madsplinter:

Then, you’ll have to try and open the Laptop’s case and –

  • check for dust – vacuum it away if need be;
  • check that, all plugs and sockets are correctly seated and clean – a contact cleaner spray can be useful.

I would exclude that this is a hardware issue.
The usb keyboard works at the startup, when I key in the password to decrypt the hard drive, before running the kernel.

This sounds like an odd power saving hiccup. I run a dual boot Leap 15.5 XFCE/ Win 10 and have found the Windows power settings can cause a problem, mine was with my Wi-Fi adapter. Also it could be a BIOS/UEFI power setting as I had an older computer has a USB power save setting in BIOS that I could change.

Another thing to try is a backport Kernel, unless someone else thinks that may not work, instructions here: SDB:InstallNewerKernel - openSUSE Wiki.
I found that the newer kernel works better on my old (2008) Toshiba Satellite laptop, and I just added the repo via Yast. Then click View> Multiversion Packages> Click kernel-default> then versions. The newer kernel will be available there.

Reading this, I am suspecting a BIOS issue. It looks as if the BIOS is able to use the keyboard during boot, but somehow it is not passing on the needed information to the kernel.

Check your BIOS settings, particularly power related BIOS settings. Also check whether there is a BIOS update available.

The laptop is an HP Envy x360. There’s no energy saving parameter in the BIOS, other than a switch to charge USB devices while on standby.

Which USB port is misbehaving?

Is it a 2021 model or a 2022 model?

If a 2021 model –

  • Left-hand side – the hinged USB-A port or the USB-C port?
  • Right-hand side – the hinged USB-A port alongside the SD-Card reader and power supply?

If a 2022 model –

  • Left-hand side – the hinged USB-A port alongside the SD-Card reader and headphone socket?
  • Right-hand side – the hinged USB-A port or the Thunderbolt / DisplayPort ports?

It’s a 2022 model, and all the ports are misbehaving.

@madsplinter:

Please take a look at the Linux Kernel “Power Management for USB” documentation: <https://www.kernel.org/doc/html/latest/driver-api/usb/power-management.html>

Please take particular note of “The user interface for dynamic PM” –

  • On this Leap 15.5 (desktop) machine –
 > cat /sys/bus/usb/devices/*/power/control
on
on
auto
on
auto
auto
auto
auto
auto
auto
 > 
 > cat /sys/bus/usb/devices/*/power/wakeup
disabled
disabled
disabled
enabled
disabled
disabled
disabled
disabled
disabled
disabled
 >

This seems a very interesting avenue to pursue, I wonder whether there’s an issue with the USB Port Power Control.
I’m not skilled enough to work this out myself, is there a way to control that from the settings?

Unfortunately, no.

  • Usually, the Kernel’s USB power control takes care of itself but, unfortunately, on your system, it doesn’t …

Worst case tolerances never add – but when they do, they are found in the best customer’s machine.

Don Vonada – DEC engineer.

Eventually, I managed to fix the issue, in the most inelegant way: I re-installed the operating system from scratch.
It took some time, but, hey ho, it’s working now!