Summary: | incorrect handling of multiple USB controllers in hotplug-20040923 | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Adam Jakubek <mig21> |
Component: | [OLD] Core system | Assignee: | Greg Kroah-Hartman (RETIRED) <gregkh> |
Status: | RESOLVED DUPLICATE | ||
Severity: | normal | CC: | bm55b, fuzz |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
patch for hotplug-20040923 usb.rc file
same kind of idea as Adam's, bit different variant patch |
Description
Adam Jakubek
2004-11-14 10:02:20 UTC
*** This bug has been marked as a duplicate of 50934 *** This is not a duplicate of 50934, libusbscanner has nothing to do with this bug, as it gets invalid data from hotplug. The bug is located in usb.rc in a loop which enumerates USB devices based on sysfs hierarchy. <=hotplug-20040401 performs this correctly, only latest version in portage is broken. This code fragment comes from usb.rc: PRODUCT="$(cat $devlink/../idVendor)/$(cat $devlink/../idProduct)/$(cat $devlink/../bcdDevice)" if [ -f $devlink/../../devnum ] then devbus=$( ( echo -n 000 ; cat $devlink/../../devnum ) | grep -o ...\$ ) devdev=$( ( echo -n 000 ; cat $devlink/../devnum ) | grep -o ...\$ ) DEVICE="/proc/bus/usb/$devbus/$devdev" else DEVICE= fi When the if condition above evaluates to true, $devbus contains invalid value (always 1, since UHC is assigned devnum 1 in the kernel). Then appropriate usb module is called, but with incorrect, non-null DEVICE value. This causes error messages in my init scripts. Bug 50934 relates to invalid device id, not bus id, which is the case here (besides, sane-backends' device id fix isn't executed at all, because DEVICE variable is non-null here). When if condition evaluates to false, PRODUCT variable on my machine contains data from host controller entry. Thus idVendor, idProduct are both set to 0000 and don't match any entry in USB usermaps. No usb module is called in this situation, so there is no way bug 50934 can be a duplicate of this one. I don't know, whether the fix should be implemented on sane-backends' or hotplug' side, but I'm pretty sure that 50934 is not related to this issue, as it deals with older hotplug version. Ok, so what should the fix be for the hotplug scripts to properly handle this situation? Care to attach a patch? Created attachment 44078 [details, diff]
patch for hotplug-20040923 usb.rc file
This patch fixes coldplug scripts on my machine (kernel 2.6.9). I don't know if
it's correct to extract bus id from sysfs directory name, but it's the only way
I could find. It should also be consistent with kernel side hotplug support.
Created attachment 44903 [details, diff]
same kind of idea as Adam's, bit different
I ran into exact same problem. This is how I fixed it up before I ran into
Adam's patch. Similiar idea...
Lee, can you make a patch, and attach it, not the whole file itself? Comment on attachment 44903 [details, diff]
same kind of idea as Adam's, bit different
whoops, wrong file! sorry
Created attachment 45105 [details, diff]
variant patch
what I meant to post
|