[SCSI] hpsa: do not sleep in atomic context in rmmod path.
authorStephen M. Cameron <scameron@beardog.cce.hp.com>
Thu, 5 Jan 2012 16:15:31 +0000 (10:15 -0600)
committerJames Bottomley <JBottomley@Parallels.com>
Mon, 16 Jan 2012 05:47:24 +0000 (09:47 +0400)
Don't call kthread_stop with a spin lock held and interrupts
disabled because kthread_stop will sleep waiting for the thread
to stop.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/hpsa.c

index 5140f5d0fd6be610f5038368fdec6627be4e9cea..b96962c394492604cd2fc2a73ce80731db28882d 100644 (file)
@@ -4271,7 +4271,9 @@ static void stop_controller_lockup_detector(struct ctlr_info *h)
        remove_ctlr_from_lockup_detector_list(h);
        /* If the list of ctlr's to monitor is empty, stop the thread */
        if (list_empty(&hpsa_ctlr_list)) {
+               spin_unlock_irqrestore(&lockup_detector_lock, flags);
                kthread_stop(hpsa_lockup_detector);
+               spin_lock_irqsave(&lockup_detector_lock, flags);
                hpsa_lockup_detector = NULL;
        }
        spin_unlock_irqrestore(&lockup_detector_lock, flags);