Google
  Web www.spinics.net

patch usb-fix-locking-loop-by-avoiding-flush_scheduled_work.patch added to gregkh-2.6 tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


This is a note to let you know that I've just added the patch titled

     Subject: USB: fix locking loop by avoiding flush_scheduled_work

to my gregkh-2.6 tree.  Its filename is

     usb-fix-locking-loop-by-avoiding-flush_scheduled_work.patch

This tree can be found at 
    http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/


>From linux-usb-owner@xxxxxxxxxxxxxxx Tue Dec 11 13:02:30 2007
From: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 11 Dec 2007 16:02:23 -0500 (EST)
Subject: USB: fix locking loop by avoiding flush_scheduled_work
To: Greg KH <greg@xxxxxxxxx>
Cc: David Brownell <david-b@xxxxxxxxxxx>, USB list <linux-usb@xxxxxxxxxxxxxxx>, USB development list <linux-usb-devel@xxxxxxxxxxxxxxxxxxxxx>
Message-ID: <Pine.LNX.4.44L0.0712111436550.6548-100000@xxxxxxxxxxxxxxxxxxxx>


This patch (as1027) replaces a call to flush_scheduled_work() -- a
dangerous routine to invoke, especially while holding any sort of lock
-- with calls to cancel_work_sync() and cancel_delayed_work_sync().

This fixes Bugzilla #9532.

Signed-off-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
CC: David Brownell <david-b@xxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

---
 drivers/usb/core/hub.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -529,9 +529,9 @@ static void hub_quiesce(struct usb_hub *
 	/* (blocking) stop khubd and related activity */
 	usb_kill_urb(hub->urb);
 	if (hub->has_indicators)
-		cancel_delayed_work(&hub->leds);
-	if (hub->has_indicators || hub->tt.hub)
-		flush_scheduled_work();
+		cancel_delayed_work_sync(&hub->leds);
+	if (hub->tt.hub)
+		cancel_work_sync(&hub->tt.kevent);
 }
 
 static void hub_activate(struct usb_hub *hub)


Patches currently in gregkh-2.6 which might be from stern@xxxxxxxxxxxxxxxxxxx are

driver/pm-acquire-device-locks-prior-to-suspending.patch
driver/kobject-drop-child-parent-ref-at-unregistration.patch
driver/driver-core-fix-race-in-__device_release_driver.patch
driver/driver-core-fix-class-glue-dir-cleanup-logic.patch
usb/usb-storage-fix-devices-that-cannot-handle-32k-transfers.patch
usb/usb-usb-storage-new-lockable-subclass-0x07.patch
usb/usb-fix-locking-loop-by-avoiding-flush_scheduled_work.patch
usb/usb-usb-mon-mon_bin.c-cleanups.patch
usb/usb-revert-portions-of-unusual_dev-sync-up-some-reported-devices-from-ubuntu.patch
usb/usb-use-irqf_disabled-for-hcd-interrupt-handlers.patch
usb/usb-autosuspend-for-cdc-acm.patch
usb/usb-don-t-change-hc-power-state-for-a-freeze.patch
usb/usb-dummy_hcd-don-t-register-drivers-on-the-platform-bus.patch
usb/usb-force-handover-port-to-companion-when-hub_port_connect_change-fails.patch
usb/usb-make-ksuspend_usbd-thread-non-freezable.patch

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
linux-usb-devel@xxxxxxxxxxxxxxxxxxxxx
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

[Home]     [Video for Linux]     [Photo]     [Yosemite Forum]     [Yosemite Photos]    [Video Projectors]     [PDAs]     [Hacking TiVo]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Devices]     [Big List of Linux Books]     [Free Dating]

  Powered by Linux