Hello Johannes, (all)

I hope I've written this mail to the right person(s) pointed from MAINTAINERS list.
Sorry if not or if this problem is already known ...

Summary:

Poll on /proc/bus/usb/devices is released before the device is logically connected to 
the hub.

Keywords:
usb hub poll select /proc/bus/usb/devices

Kernel version:
2.4.22

Description:

There is a problem in hub.c code change from kernel 2.4.20 to 2.4.22. (I didn't check 
2.4.21)

lines above 763 of hub.c

                /* Run it through the hoops (find a driver, etc) */
                if (!usb_new_device(dev)) {
                        hub->children[port] = dev;
                        goto done;
                }

The routine usb_new_device will release condition variable for polling on file 
/proc/bus/usb/devices.  
The problem is that at this point hub->children[] is not set => usb_device_dump() 
routine will not print new device connected to the hub.
If the process waiting on select() will be waked up, following read() returns 
unchanged file /proc/bus/usb/devices, because read() calls usb_device_dump().

This process will just detect change on usb bus but will not find a new device.

2.4.20:

The behavior of 2.4.20 is ok because of the line 719 of hub.c:

 hub->children[port] = dev;

So the hub tree contains the information about new device and this info will be dumped.

I didn't check all of the code in 2.4.22 to understand why this line was moved after 
the routine usb_new_device(). Please check it if this is really a bug or not.

Thanks

Marek



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to