On Fri, Aug 11, 2006 at 08:46:54AM +0200, Thorsten Wiedemer wrote:
> Hi !
>
> > Yes, I'm playing around with some multi-threaded probing stuff right
> > now. I've got PCI working pretty well now, see the -mm kernel for the
> > patches if you want to test it out.
> >
> > However it's not going to directly translate over to the USB code, we
> > have to limit probing to a per-device basis, not a per-interface one
> > like the driver core expects, so it will take a bit more work to
> > implement it. But it is on my TODO list.
>
> Sounds interesting. But sounds also that it would take a moment until it
> will be available for USB.
> I'd be very interested in your results, also to make some tests.
Actually it wasn't that hard at all to do a first cut at this.
Here's a patch against the latest -mm kernel tree (should also apply to
the 2.6.18-rc4 and possibly the 2.6.17 kernel release). It spawns a
thread for every new USB device found in order to do the probing
sequence.
It seems to work properly here for me, but I couldn't really test any
speed up, as I didn't drag my big box of USB devices out.
Let me know if this changes anything for you.
thanks,
greg k-h
From: Greg Kroah-Hartman <[EMAIL PROTECTED]>
Subject: USB: create a new thread for every USB device found during the probe
sequence
Might speed up some systems. If nothing else, a bad driver should not
take the whole USB subsystem down with it.
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
drivers/usb/core/hub.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
--- gregkh-2.6.orig/drivers/usb/core/hub.c
+++ gregkh-2.6/drivers/usb/core/hub.c
@@ -1199,8 +1199,9 @@ static void show_string(struct usb_devic
*
* Only the hub driver or root-hub registrar should ever call this.
*/
-int usb_new_device(struct usb_device *udev)
+static int __usb_new_device(void *void_data)
{
+ struct usb_device *udev = void_data;
int err;
err = usb_get_configuration(udev);
@@ -1311,6 +1312,17 @@ fail:
return err;
}
+int usb_new_device(struct usb_device *udev)
+{
+ struct task_struct *probe_task;
+ int ret = 0;
+
+ probe_task = kthread_run(__usb_new_device, udev,
+ "usb-probe-%s", udev->devnum);
+ if (IS_ERR(probe_task))
+ ret = PTR_ERR(probe_task);
+ return ret;
+}
static int hub_port_status(struct usb_hub *hub, int port1,
u16 *status, u16 *change)
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel