Distribution: Slackware(previously detected) and Gentoo Hardware Environment: Athlon XP 1600+, 1.5 Gig RAM, 60 gig HD, VIA board Software Environment: Gentoo latest build Problem Description: Alot of folks are trying to "coldplug" USB devices, including scanners. Many modern motherboards now have two or more USB controllers on board, and many users are plugging scanners into a secondary (or other than the primary) USB controller's hub. When many distro's boot with hotplug and coldplug utilities installed, coldplug has to scan /sys/bus/usb and try to generate accurate pointers for /proc/bus/usb to hand off to SANE or other utilites which use hotplug to configure a device when plugged in. However, for those scanners and other programs which need to properly configure the device in /proc/bus/usb (chmoding/chowning the device node), if it's not plugged into the primary USB, coldplug sends out the wrong filename to configure it. Unfortunately, in tracing coldplug's code, it confuses a device number for the root hub as being the USB bus number -- which doesn't change from "1" no matter what bus it is. This makes most items look like they're in /proc/bus/usb/001/00x when they're in /proc/bus/usb/00n/00x where n>1. However, this isn't much of the code's fault because there's no USB bus number even being reported in /sys. Normal hotplugging (shoving the USB plug into the socket) works as is, but the kernel's not giving coldplug what it needs on boot. Steps to reproduce: 1. Take any USB device, and locate what driver gets loaded. Example: A Sharp Zaurus 5500SL plugged in would load usbnet. 2. Code up a simple script, named after the driver, make it executable and put it in /etc/hotplug/usb/. Contents of said script are: #!/bin/sh logger -s $ACTION $DEVICE 3. Plus in the device in any primary USB hub port, and reboot. Note what is logged. (My Zaurus was on the second port on the primary hub and my system reports logger: add /proc/bus/usb/001/003) 4. Pull out the device and plug it into any secondary hub (like in the front of the machine). Reboot and note what's logged again. (Betcha it reports something similar to /proc/bus/usb/001/... ) A full debugging analysis is at http://bugs.gentoo.org/show_bug.cgi?id=72676
The bus number _is_ in sysfs, see the gentoo bug for where I point that out. This is not a kernel issue, sorry.
Okay, then do this: Tell linux-hotplug how to read the bus number on cold plugging, because according to you, THEY HAVE IT WRONG. You're on the linux-hotplug list, you got a bug there.
Fine, submit a patch to the coldplug scripts. But either way, this is not a kernel bug, so I'm closing it here.