summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2011-07-07 21:13:45 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2011-07-07 21:13:45 -0700
commitf1e1016e8f6498b83d6017509ebbddb7b946db31 (patch)
tree96af65326589fff2be28917d3656686079abd813
parentbc81878c1d29a2756bcb6251430b3e4cd291523e (diff)
downloadstable-queue-f1e1016e8f6498b83d6017509ebbddb7b946db31.tar.gz
.39 patches
-rw-r--r--queue-2.6.39/series1
-rw-r--r--queue-2.6.39/usb-additional-regression-fix-for-device-removal.patch55
2 files changed, 56 insertions, 0 deletions
diff --git a/queue-2.6.39/series b/queue-2.6.39/series
index c8dc84e1ed..201560a7c5 100644
--- a/queue-2.6.39/series
+++ b/queue-2.6.39/series
@@ -105,3 +105,4 @@ xfrm-fix-off-by-one-in-the-replay-advance-functions.patch
revert-kvm-save-restore-state-of-assigned-pci-device.patch
kvm-fix-register-corruption-in-pvclock_scale_delta.patch
ipvs-netns-exit-causes-crash-in-conntrack.patch
+usb-additional-regression-fix-for-device-removal.patch
diff --git a/queue-2.6.39/usb-additional-regression-fix-for-device-removal.patch b/queue-2.6.39/usb-additional-regression-fix-for-device-removal.patch
new file mode 100644
index 0000000000..0894f6696e
--- /dev/null
+++ b/queue-2.6.39/usb-additional-regression-fix-for-device-removal.patch
@@ -0,0 +1,55 @@
+From ca5c485f55d326d9a23e4badd05890148aa53f74 Mon Sep 17 00:00:00 2001
+From: Alan Stern <stern@rowland.harvard.edu>
+Date: Wed, 6 Jul 2011 17:03:45 -0400
+Subject: USB: additional regression fix for device removal
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Alan Stern <stern@rowland.harvard.edu>
+
+commit ca5c485f55d326d9a23e4badd05890148aa53f74 upstream.
+
+Commit e534c5b831c8b8e9f5edee5c8a37753c808b80dc (USB: fix regression
+occurring during device removal) didn't go far enough. It failed to
+take into account that when a driver claims multiple interfaces, it may
+release them all at the same time. As a result, some interfaces can
+get released before they are unregistered, and we deadlock trying to
+acquire the bandwidth_mutex that we already own.
+
+This patch (asl478) handles this case by setting the "unregistering"
+flag on all the interfaces before removing any of them.
+
+Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
+Tested-by: Éric Piel <eric.piel@tremplin-utc.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/core/message.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+--- a/drivers/usb/core/message.c
++++ b/drivers/usb/core/message.c
+@@ -1147,6 +1147,14 @@ void usb_disable_device(struct usb_devic
+ * any drivers bound to them (a key side effect)
+ */
+ if (dev->actconfig) {
++ /*
++ * FIXME: In order to avoid self-deadlock involving the
++ * bandwidth_mutex, we have to mark all the interfaces
++ * before unregistering any of them.
++ */
++ for (i = 0; i < dev->actconfig->desc.bNumInterfaces; i++)
++ dev->actconfig->interface[i]->unregistering = 1;
++
+ for (i = 0; i < dev->actconfig->desc.bNumInterfaces; i++) {
+ struct usb_interface *interface;
+
+@@ -1156,7 +1164,6 @@ void usb_disable_device(struct usb_devic
+ continue;
+ dev_dbg(&dev->dev, "unregistering interface %s\n",
+ dev_name(&interface->dev));
+- interface->unregistering = 1;
+ remove_intf_ep_devs(interface);
+ device_del(&interface->dev);
+ }