]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
[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)
committerJoe Jin <joe.jin@oracle.com>
Tue, 15 May 2012 08:01:06 +0000 (16:01 +0800)
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>
(cherry picked from commit 775bf2773858c50d2acfcdf71889984be94e7037)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/scsi/hpsa.c

index a69381dac9fe3bef41b77ba8e236b73a45e0236e..6309de72be9266f32dea9a6b1b46f7aa02019b2e 100644 (file)
@@ -4300,7 +4300,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);