lkml.org 
[lkml]   [2003]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[USB] Fix connect/disconnect race
From
Hi Greg:

This patch was integrated by you in 2.4 six months ago. Unfortunately
it never got into 2.5. Without it you can end up with crashes such
as http://bugs.debian.org/218670

Cheers,
--
Debian GNU/Linux 3.0 is out! ( http://www.debian.org/ )
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Index: kernel-source-2.5/drivers/usb/core/hub.c
===================================================================
RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/drivers/usb/core/hub.c,v
retrieving revision 1.1.1.15
diff -u -r1.1.1.15 hub.c
--- kernel-source-2.5/drivers/usb/core/hub.c 28 Sep 2003 04:44:16 -0000 1.1.1.15
+++ kernel-source-2.5/drivers/usb/core/hub.c 30 Nov 2003 07:44:40 -0000
@@ -926,7 +926,6 @@
break;
}

- hub->children[port] = dev;
dev->state = USB_STATE_POWERED;

/* Reset the device, and detect its speed */
@@ -979,8 +978,10 @@
dev->dev.parent = dev->parent->dev.parent->parent;

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

/* Free the configuration if there was an error */
usb_put_dev(dev);
@@ -989,7 +990,6 @@
delay = HUB_LONG_RESET_TIME;
}

- hub->children[port] = NULL;
hub_port_disable(hub, port);
done:
up(&usb_address0_sem);
\
 
 \ /
  Last update: 2005-03-22 13:59    [W:0.060 / U:0.452 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site