aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aacraid
diff options
context:
space:
mode:
authorBen Collins <bcollins@ubuntu.com>2012-06-11 14:16:36 -0400
committerJames Bottomley <JBottomley@Parallels.com>2012-07-20 03:58:43 -0400
commit361ee9c3f3839d6cbd306b5bd34292e0848ecfdc (patch)
treecef3a3109cbf2280cc4a03a563fc579a8d968b1e /drivers/scsi/aacraid
parentff08784b41e1ab5da6776411b7a8381fe942f2cc (diff)
[SCSI] aacraid: Better handling of in-flight events on thread stop
When an error occured that would shut down the driver, some in-flight events were getting caught up, deadlocking a CPU or two. Signed-off-by: Ben Collins <bcollins@ubuntu.com> Acked-by: Achim Leubner <Achim_Leubner@pmc-sierra.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/aacraid')
-rw-r--r--drivers/scsi/aacraid/linit.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index fdfc4be9c7c6..2be612b0caa5 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -1089,8 +1089,17 @@ static struct scsi_host_template aac_driver_template = {
1089 1089
1090static void __aac_shutdown(struct aac_dev * aac) 1090static void __aac_shutdown(struct aac_dev * aac)
1091{ 1091{
1092 if (aac->aif_thread) 1092 if (aac->aif_thread) {
1093 int i;
1094 /* Clear out events first */
1095 for (i = 0; i < (aac->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB); i++) {
1096 struct fib *fib = &aac->fibs[i];
1097 if (!(fib->hw_fib_va->header.XferState & cpu_to_le32(NoResponseExpected | Async)) &&
1098 (fib->hw_fib_va->header.XferState & cpu_to_le32(ResponseExpected)))
1099 up(&fib->event_wait);
1100 }
1093 kthread_stop(aac->thread); 1101 kthread_stop(aac->thread);
1102 }
1094 aac_send_shutdown(aac); 1103 aac_send_shutdown(aac);
1095 aac_adapter_disable_int(aac); 1104 aac_adapter_disable_int(aac);
1096 free_irq(aac->pdev->irq, aac); 1105 free_irq(aac->pdev->irq, aac);
@@ -1191,6 +1200,7 @@ static int __devinit aac_probe_one(struct pci_dev *pdev,
1191 if (IS_ERR(aac->thread)) { 1200 if (IS_ERR(aac->thread)) {
1192 printk(KERN_ERR "aacraid: Unable to create command thread.\n"); 1201 printk(KERN_ERR "aacraid: Unable to create command thread.\n");
1193 error = PTR_ERR(aac->thread); 1202 error = PTR_ERR(aac->thread);
1203 aac->thread = NULL;
1194 goto out_deinit; 1204 goto out_deinit;
1195 } 1205 }
1196 1206