usb devices not recognized automatically when plugged in a hub

Bug #287576 reported by Pierre Dinh-van
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
Medium
Manoj Iyer

Bug Description

Binary package hint: linux-image-2.6.24-21-generic

1) Hardy 8.04.1 with hardy-updates
2) linux-image-2.6.24-21-generic: Installed: 2.6.24-21.42

Since the kernel upgrade from 2.6.24-19 to 2.6.24-21, devices plugged in our internal usbhub are not automatically reconized. Running lsusb in a console make the devices been reconized.

Some cases I tested :

- Booting with devices plugged in the hub make them available until they are all unplugged. Then plugging in back doesn't recognize them anymore (until lsusb)
- it doesn't appens with the usb ports directly connected to the motherboard
- the usb hub is recognized at boot.
- booting 2.6.24-19 make it works fine
- plugging in a device doesn't show any error in the kernel messages.
- I checked for the Vendor/Product ID of my hub in the diff file of 2.6.24-21, and didn't found anything, so I guess it's not a side effect of a quirk.
- tested on different hardware with different hub, always the same problem

It seems that the usb bus doesn't not scan for devices recursively until we explicit ask for it (with lsusb)

I'm attaching the output of dmesg with this comment. (the usb mass storage which are reconized at the end are because of the cases explained upper).
I'll post uname-a.log, lspci-vvnn.log, version.log and lsusb-v.log as requested in https://wiki.ubuntu.com/KernelTeamBugPolicies in next comments.

Revision history for this message
Pierre Dinh-van (dinhvan) wrote :
Revision history for this message
Pierre Dinh-van (dinhvan) wrote :
Revision history for this message
Pierre Dinh-van (dinhvan) wrote :
Revision history for this message
Pierre Dinh-van (dinhvan) wrote :
Revision history for this message
Pierre Dinh-van (dinhvan) wrote :
Revision history for this message
Pierre Dinh-van (dinhvan) wrote :

I tried to recompile the kernel and remove the ubuntu modification from drivers/usb/core/hub.c (see attached patch), and the usb hubs are working back. I guess the bug is somewhere in this modification.

How I did :

apt-get source linux-image-2.6.24-21-generic
patch -p1 -R < hub.patch
cd linux-2.6.24.2/
cp /boot/config-2.6.24-21-generic .config
make deb-pkg
dpkg -i ../linux-2.6.24.3_2.6.24.3_i386.deb
mkinitramfs -o /boot/initrd.img-2.6.24.3
edit /boot/grub/menu.lst

reboot on this kernel.

Revision history for this message
Pierre Dinh-van (dinhvan) wrote :

I had a look in hub.c and I propose this patch which works for me. I'm not quite sure if it has side effects since it's the first time I'm looking in the usbcore code.

I noticed that when I'm plugging a memory stick in my hub, the hub makes a soft reset first. I guess it can be one of this "side effects".

Changed in linux:
assignee: nobody → ubuntu-kernel-team
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Pierre Dinh-van (dinhvan) wrote :

I just tried to backport the hub_reset() and persistent_device() functions from hub.c in 2.6.26, but it didn't help. (So the patch I attach to this comment DOESN'T WORK).

I guess there are also modifications in the ehci driver but I'm not fit enought to look in it.

I searched throught the diff file and through the changelogs of the vanilla kernel, but I can't find from which revision comes this patch between -19 and -21.

Does someone knows why this patch was integrated in -21 ?
Was the code in -19 buggy ? If not, it should be quite usefull to roll back to the code of -19 for hub.c.

This bug is quite annoying for my users who can't use their intern usb-hub anymore. (which means that they have to boot under -19 to work).

Revision history for this message
Pierre Dinh-van (dinhvan) wrote :

Just to say that it still exists in -22 (but it's quite normal because it was just a security update).

Revision history for this message
Launchpad Janitor (janitor) wrote : Kernel team bugs

Per a decision made by the Ubuntu Kernel Team, bugs will longer be assigned to the ubuntu-kernel-team in Launchpad as part of the bug triage process. The ubuntu-kernel-team is being unassigned from this bug report. Refer to https://wiki.ubuntu.com/KernelTeamBugPolicies for more information. Thanks.

Revision history for this message
Pierre Dinh-van (dinhvan) wrote :

Still exists in 2.6.24-23.

Revision history for this message
Manoj Iyer (manjo) wrote :

Does this still happen on the released version of Jaunty ?

Changed in linux (Ubuntu):
assignee: nobody → Manoj Iyer (manjo)
Revision history for this message
Michele Mordenti (micmord) wrote :

Same problem with kubuntu 8.04.2 (linux 2.6.24-24)

when I plug the external usb hub:
[ 182.788947] usb 5-4: new high speed USB device using ehci_hcd and address 6
[ 182.921415] usb 5-4: configuration #1 chosen from 1 choice
[ 182.922560] hub 5-4:1.0: USB hub found
[ 182.929209] hub 5-4:1.0: 4 ports detected

and then all usb devices stop working, I mean the usb device plugged in the hub and the usb device directly plugged in the other free usb pc ports.
Also if i unplugged the usb hub the kernel doesn't care, usb stops working at all.

I tried all the combination of pc/usb hub/kernel and the only that fails is kubuntu 8.04.2
 - Same hardware on an old gentoo 2007 works fine.
 - Same usb hub connected on a eepc901 with jaunty works fine
 - Same usb hub connected to a different hardware on kubuntu 8.0.4 fails.

Revision history for this message
Manoj Iyer (manjo) wrote :

Can you confirm this issue exists with the Karmic Alpha 9.10 release. Images for testing are available at http://cdimage.ubuntu.com/daily-live/current/ . Please let us know your results.

If the issue remains while still running Karmic, please run the following command which will automatically gather and attach updated debug information:

apport-collect -p linux <bug #>

Thanks in advance.

Changed in linux (Ubuntu):
status: Triaged → Incomplete
Revision history for this message
Pierre Dinh-van (dinhvan) wrote :

I was working with the workaround "don't update the kernel with any version > 2.6.24-19" for a while.

I just retested with 2.6.24-24 and 2.6.24-25, and this issue seems to be fixed.
With the 2.6.31 from 9.10 it also works fine.

I checked the linux_2.6.24-25.63.diff.gz (got with apt-get source linux-image-2.6.24-24-generic) and I searched for hub.c

I was able to find some stuff including that :

--- linux-2.6.24.orig/drivers/usb/core/hub.c
+++ linux-2.6.24/drivers/usb/core/hub.c
@@ -327,6 +327,9 @@
[...]
+static void hub_restart(struct usb_hub *hub, int type)
+{
+ struct usb_device *hdev = hub->hdev;
+ int port1;
+
+ /* Check each of the children to see if they require
+ * USB-PERSIST handling or disconnection. Also check
+ * each unoccupied port to make sure it is still disabled.
+ */
[...]

I guess that's part of the change which solved this issue.

I guess it comes from this entry of the changelog

linux (2.6.24-24.60) hardy-proposed; urgency=low
[...]
  [Upstream Kernel Changes]

  * USB: EHCI: fix remote-wakeup regression
    - LP: #406419

 -- Stefan Bader <email address hidden> Tue, 18 Aug 2009 18:25:47 +0200

So I guess this bug was a duplicated to https://bugs.launchpad.net/ubuntu/+source/linux/+bug/406419

So far I was able to test (3 computers, 2 hubs), this bug is for me fixed.

Revision history for this message
Vikram Dhillon (dhillon-v10) wrote :

If you are still having issues it must be another similar issue and needs a new bug

Changed in linux (Ubuntu):
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.