# USB ports unusable unless with a device plugged at boot time

## lowsfer

Hi,

I have a HP ENVY laptop with 3 usb ports. 2 of them are USB3.0 and the other one is a USB2.0-ESATA combo port. The USB2.0-ESATA combo port always works. However the 2 USB 3.0 ports won't work unless at least one of them is plugged with an USB device(tested with 2.0 device) plugged at boot time.

I do have both xhci_hcd an ehci_hcd kernel modules loaded. My kernel version is gentoo-sources-3.2.1-r2, the latest kernel marked at stable.

Anybody know what is the reason?

Thanks.

----------

## BillWho

lowsfer,

Is udev service in your sysinit runlevel? 

You can monitor udev with 

```
udevadm monitor --udev
```

 Plug the device in after starting udevadm and give it a few seconds. It will provide some info if the device is detected. You should also check dmesg.

Good luck   :Wink: 

----------

## lowsfer

 *BillWho wrote:*   

> lowsfer,
> 
> Is udev service in your sysinit runlevel? 
> 
> You can monitor udev with 
> ...

 

Thank you for your suggestion. Yes, udev is in sysinit runlevel.

I did what you said. But unfortunately, for the 2 USB3.0 ports. Nothing happened. Absolutely nothing from udevadm or dmesg.

----------

## BillWho

lowsfer,

Check the device drivers/USB support section:

--- USB support                                                                                                                      │ │  

  │ │                                                               <*>   Support for Host-side USB                                                                                                      │ │  

  │ │                                                               [*]     USB verbose debug messages                                                                                                   │ │  

  │ │                                                               [*]     USB announce new devices                                                                                                     │ │  

  │ │                                                                       *** Miscellaneous USB options ***                                                                                            │ │  

  │ │                                                               [ ]     USB device filesystem (DEPRECATED)                                                                                           │ │  

  │ │                                                               [ ]     USB device class-devices (DEPRECATED)                                                                                        │ │  

  │ │                                                               [ ]     Dynamic USB minor allocation                                                                                                 │ │  

  │ │                                                               [*]     USB runtime power management (autosuspend) and wakeup                                                                        │ │  

  │ │                                                               [*]       OTG support                                                                                                                │ │  

  │ │                                                               [*]   Rely on OTG Targeted Peripherals List                                                                                          │ │  

  │ │                                                               [ ]   Disable external hubs                                                                                                          │ │  

  │ │                                                               < >   DesignWare USB3 DRD Core Support                                                                                               │ │  

  │ │                                                               <M>   USB Monitor

Hope this helps.

----------

## lowsfer

 *BillWho wrote:*   

> lowsfer,
> 
> Check the device drivers/USB support section:
> 
> --- USB support                                                                                                                      │ │  
> ...

 

The only difference between yours and mine is the OTG support, which is definitely not the problem.  :Sad: 

I also have XHCI EHCI UHCI OHCI, all compiled as module. xhci and ehci are autoloaded.

This problem has been there since I got this laptop one whole year ago.  :Sad:  Tried many kernel versions since then.

Since this problem is avoid when with a device pluged in at boot time, I guess it is a udev problem? The OS can detect devices at boot time but not later, which is weird.

----------

## BillWho

lowsfer,

Can you provide info of the device(s) that's not recognized? Also can you grep dmesg and /var/log/messages for any possible entry for it?

Doing that after booting with then without the device plugged in might help.

I have an old logitech webcam home that doesn't work, but lsusb lists it although udevadm detects nothing at all.

It is very odd indeed that it works when it's plugged at boot time.

----------

## lowsfer

 *BillWho wrote:*   

> lowsfer,
> 
> Can you provide info of the device(s) that's not recognized? Also can you grep dmesg and /var/log/messages for any possible entry for it?
> 
> Doing that after booting with then without the device plugged in might help.
> ...

 

This behaviour is device independent. The devices always work well on the USB/SATA combo port, but not the two dedicated USB ports. I tried with my Sandisk usb, Dell usb mouse and a USB harddrive.

Now testing with a Dell mouse.

With it plugged in at boot time:

```

    #grep -i 'dell' /var/log/messages (only showing the result during this time)

    Mar 25 12:46:56 localhost kernel: [  117.182308] usb 1-2: Product: Dell Premium USB Optical Mouse

    Mar 25 12:46:56 localhost kernel: [  117.199495] input: Dell Premium USB Optical Mouse as /devices/pci0000:00/0000:00:05.0/0000:02:00.0/usb1/1-2/1-2:1.0/input/input13

    Mar 25 12:46:56 localhost kernel: [  117.199587] generic-usb 0003:413C:3016.0002: input,hidraw0: USB HID v1.11 Mouse [Dell Premium USB Optical Mouse] on usb-0000:02:00.0-2/input0

    #dmesg | grep -i 'dell'

    [    6.840634] usb 1-2: Product: Dell Premium USB Optical Mouse

    [    6.857905] input: Dell Premium USB Optical Mouse as /devices/pci0000:00/0000:00:05.0/0000:02:00.0/usb1/1-2/1-2:1.0/input/input11

    [    6.858010] generic-usb 0003:413C:3016.0001: input,hidraw0: USB HID v1.11 Mouse [Dell Premium USB Optical Mouse] on usb-0000:02:00.0-2/input0

    [  117.182308] usb 1-2: Product: Dell Premium USB Optical Mouse

    [  117.199495] input: Dell Premium USB Optical Mouse as /devices/pci0000:00/0000:00:05.0/0000:02:00.0/usb1/1-2/1-2:1.0/input/input13

    [  117.199587] generic-usb 0003:413C:3016.0002: input,hidraw0: USB HID v1.11 Mouse [Dell Premium USB Optical Mouse] on usb-0000:02:00.0-2/input0

```

Without it at boot time:

```

    #grep -i 'dell' /var/log/messages

    #dmesg | grep -i 'dell'

```

shows nothing. After booting, connected the mouse, not working. No output from above two commands, either.

----------

## BillWho

lowsfer,

For lack of any brilliant ideas, what's INPUT_DEVICES set to in make.conf? Also what's the output of

```
 lsusb -t
```

 and

```
 grep -i "xhci\|ehci\|ohci\|fire" .config
```

Grasping at straws   :Confused: 

----------

## HMC

I have exact same problem on USB3 ports (not a combo USB/eSATA)...  <snipped>

Edit: wrong about that... but it definitely seems to be related to usb autosuspend

----------

## lowsfer

 *BillWho wrote:*   

> lowsfer,
> 
> For lack of any brilliant ideas, what's INPUT_DEVICES set to in make.conf? Also what's the output of
> 
> ```
> ...

 

```

# cat /etc/make.conf | grep INPUT

INPUT_DEVICES="keyboard synaptics mouse evdev"

```

```

$ grep -i "xhci\|ehci\|ohci\|fire" /usr/src/linux/.config

# IEEE 1394 (FireWire) support

# CONFIG_FIREWIRE is not set

# CONFIG_FIREWIRE_NOSY is not set

# CONFIG_ADAPTEC_STARFIRE is not set

CONFIG_USB_ARCH_HAS_OHCI=y

CONFIG_USB_ARCH_HAS_EHCI=y

CONFIG_USB_ARCH_HAS_XHCI=y

CONFIG_USB_XHCI_HCD=m

# CONFIG_USB_XHCI_HCD_DEBUGGING is not set

CONFIG_USB_EHCI_HCD=m

CONFIG_USB_EHCI_ROOT_HUB_TT=y

CONFIG_USB_EHCI_TT_NEWSCHED=y

CONFIG_USB_OHCI_HCD=m

# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set

# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set

CONFIG_USB_OHCI_LITTLE_ENDIAN=y

CONFIG_PROVIDE_OHCI1394_DMA_INIT=y

```

```

$ lsusb -t

1-1.6:1.2: No such file or directory

1-1.6:1.3: No such file or directory

/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 5000M

/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 480M

/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci_hcd/2p, 480M

    |__ Port 1: Dev 2, If 0, Class=hub, Driver=hub/8p, 480M

        |__ Port 5: Dev 3, If 0, Class='bInterfaceClass 0x0e not yet handled', Driver=uvcvideo, 480M

        |__ Port 5: Dev 3, If 1, Class='bInterfaceClass 0x0e not yet handled', Driver=uvcvideo, 480M

        |__ Port 6: Dev 4, If 0, Class='bInterfaceClass 0xe0 not yet handled', Driver=btusb, 12M

        |__ Port 6: Dev 4, If 1, Class='bInterfaceClass 0xe0 not yet handled', Driver=btusb, 12M

        |__ Port 6: Dev 4, If 2, Class=vend., Driver=, 12M

        |__ Port 6: Dev 4, If 3, Class=app., Driver=, 12M

```

This does not change, no matter boot with a device plugged in or not.

Thank you for being so patient!

----------

## HMC

Do you have acpid running and laptop-mode-tools installed?

----------

## BillWho

lowsfer,

This is certainly an interesting and, at the same time, frustrating problem.

A couple of observations: 

Never had output of "not yet handled"!

No OHCI driver in the list?

Everything is pushed off to Bus 01

There's a big difference with my bus breakdown and yours. Mine shows the bus/port assignments and .config settings. I don't have usb3 so that doesn't help with determining differences there.

Here's the attachment attachment

I would check all 

```
grep "HID\|HCD\|OHCI" /usr/src/linux/.config
```

 settings and to do a 'Hail Mary'  set everything. 

Pasting back plain lsusb and lspci might help with identifying the devices attached. Also is the camera built-in and what's the bluetooth device?

Grasping at more straws   :Confused: 

----------

## lowsfer

 *HMC wrote:*   

> I have exact same problem on USB3 ports (not a combo USB/eSATA)...  <snipped>
> 
> Edit: wrong about that... but it definitely seems to be related to usb autosuspend

 

My combo USB/eSATA works well. The problem is with the 2 dedicated USB3. I also doubt that it is the problem of usb suspend/resume, but didn't find much useful info.

Edit:

Have just tried removing the autosuspend option in the kernel. Didn't work...Last edited by lowsfer on Thu Mar 29, 2012 5:22 am; edited 1 time in total

----------

## lowsfer

 *HMC wrote:*   

> Do you have acpid running and laptop-mode-tools installed?

 

Yes I have acpid in boot level and laptop-mode-tools installed.

----------

## lowsfer

 *BillWho wrote:*   

> lowsfer,
> 
> This is certainly an interesting and, at the same time, frustrating problem.
> 
> A couple of observations: 
> ...

 

OHCI module was compiled but not autoloaded. May it will be loaded when a USB 1.1 device is plugged in?

After booting without any USB device, nothing happens when you plugged in a usb device. lsusb output is unchanged:

```

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub

Bus 001 Device 003: ID 04f2:b16c Chicony Electronics Co., Ltd 

Bus 001 Device 004: ID 03f0:231d Hewlett-Packard 

```

Booting with a device (SanDisk USB flash disk) plugged in:

```

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub

Bus 002 Device 002: ID 0781:5530 SanDisk Corp. Cruzer U3 4gb SDCZ36

Bus 001 Device 003: ID 04f2:b16c Chicony Electronics Co., Ltd 

Bus 001 Device 004: ID 03f0:231d Hewlett-Packard

```

Hmm, interesting, it's a 8gb disk but here it says 4gb.

As for lspci. Both gives the same output:

```

$ lspci | grep -i usb

00:1d.0 USB controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 05)

02:00.0 USB controller: NEC Corporation uPD720200 USB 3.0 Host Controller (rev 03)

```

----------

## s4e8

It seems if booting w/ device plugin, bios do some magic work, make the xhci driver happy. Maybe you can try change some relative BIOS options.

Another ways is trying load xhci module with option link_quirk=1 .

----------

## BillWho

lowsfer,

 *Quote:*   

> OHCI module was compiled but not autoloaded. May it will be loaded when a USB 1.1 device is plugged in? 

 

I don't think that's the case. I have a firewire port with nothing plugged in it, but the module still loads.

```
root@gentoo-gateway rules.d # lsmod|grep firewire

firewire_ohci          26584  0 

firewire_core          43001  1 firewire_ohci

crc_itu_t               1225  1 firewire_core

```

As far as I can tell it's because of this:

```
root@gentoo-gateway rules.d # lspci|grep -i firewire

03:00.0 FireWire (IEEE 1394): JMicron Technology Corp. IEEE 1394 Host Controller

```

Now, I don't have xhci support, but I compiled it to test and that module doesn't load

```
root@gentoo-gateway rules.d #  grep -i "xhci" /usr/src/linux/.config

CONFIG_USB_ARCH_HAS_XHCI=y

CONFIG_USB_XHCI_HCD=m

```

Probably because of this:

```
root@gentoo-gateway rules.d # lspci|grep -i xhci

root@gentoo-gateway rules.d # 

```

I'm pretty sure that if I had xhci support it would load regardless if anything was plugged in the port

I don't know if you tried adding ohci to /etc/conf.d/modules, but give it a shot.

That suggestion is for lack of any other brilliant ideas   :Confused: 

----------

## lowsfer

 *s4e8 wrote:*   

> It seems if booting w/ device plugin, bios do some magic work, make the xhci driver happy. Maybe you can try change some relative BIOS options.
> 
> Another ways is trying load xhci module with option link_quirk=1 .

 

Thanks. But my BIOS has only very few options. I hate HP here.

The module options didn't solve the problem either unfortunately...

----------

## lowsfer

 *BillWho wrote:*   

> lowsfer,
> 
>  *Quote:*   OHCI module was compiled but not autoloaded. May it will be loaded when a USB 1.1 device is plugged in?  
> 
> I don't think that's the case. I have a firewire port with nothing plugged in it, but the module still loads.
> ...

 

I see. There's no firewire or USB1.1 chip in my laptop. I tried loading OHCI manually, didn't help. I guess I don't need OHCI, since it's for USB1.1? Both EHCI and XHCI should be able to handle USB1.1 device plugged into USB 2.0 or 3.2 port, right?

----------

## BillWho

lowsfer,

 *Quote:*   

> Absolutely nothing from udevadm

 

I strongly suspect udev - I would pursue that avenue. Do you have any other device to try with udevadm?

----------

## lowsfer

 *BillWho wrote:*   

> lowsfer,
> 
>  *Quote:*   Absolutely nothing from udevadm 
> 
> I strongly suspect udev - I would pursue that avenue. Do you have any other device to try with udevadm?

 

Yeah, I suspect udev now, too. Tried with a Sandisk flash, a WD USB hard drive, a Dell mouse and a USB laptop cooler with a USB hub. All with same results.

----------

## deyannn

Hi there!

Has there been a solution to this issue?

I have the exact same problem and kernel settings are the same as far as I can see (though I'll check it further in the  next week).

Shall I open another thread?

Kernel 3.1.10-gentoo-r1 (due to problems running wifi Intel 4965AGN on any more recent kernels) compiled with genkernel.

In my attempts to fix it I tried installing hotplug/coldplug and kind of broke udev so now I'm reverting the changes but the problem is outstanding.

Cheers,

Deyan

----------

## BillWho

deyannn,

As far as I'm aware, this hasn't been resolved yet. The problem seems to exist with certain hardware. 

Posting back your hardware specs e.g. make model like lowsfer's initial post might help shed some light on the problem.

I suspect udev, but I could be way off-base with that assumption   :Confused: 

----------

