From: Stephen M. Cameron Date: Thu, 5 Jan 2012 16:15:31 +0000 (-0600) Subject: [SCSI] hpsa: do not sleep in atomic context in rmmod path. X-Git-Tag: v2.6.39-400.9.0~423^2~19^2~11^2~720 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=61d24560a7a51722af48eb2108293e6e538c9b4e;p=users%2Fjedix%2Flinux-maple.git [SCSI] hpsa: do not sleep in atomic context in rmmod path. 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 Signed-off-by: James Bottomley (cherry picked from commit 775bf2773858c50d2acfcdf71889984be94e7037) Signed-off-by: Joe Jin --- diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index a69381dac9fe..6309de72be92 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -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);