diff options
Diffstat (limited to 'drivers/scsi/aacraid/linit.c')
-rw-r--r-- | drivers/scsi/aacraid/linit.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c index 0d279c445a30..7199534cd07d 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 | ||
1090 | static void __aac_shutdown(struct aac_dev * aac) | 1090 | static 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); |
@@ -1145,11 +1154,11 @@ static int __devinit aac_probe_one(struct pci_dev *pdev, | |||
1145 | goto out_disable_pdev; | 1154 | goto out_disable_pdev; |
1146 | 1155 | ||
1147 | shost->irq = pdev->irq; | 1156 | shost->irq = pdev->irq; |
1148 | shost->base = pci_resource_start(pdev, 0); | ||
1149 | shost->unique_id = unique_id; | 1157 | shost->unique_id = unique_id; |
1150 | shost->max_cmd_len = 16; | 1158 | shost->max_cmd_len = 16; |
1151 | 1159 | ||
1152 | aac = (struct aac_dev *)shost->hostdata; | 1160 | aac = (struct aac_dev *)shost->hostdata; |
1161 | aac->base_start = pci_resource_start(pdev, 0); | ||
1153 | aac->scsi_host_ptr = shost; | 1162 | aac->scsi_host_ptr = shost; |
1154 | aac->pdev = pdev; | 1163 | aac->pdev = pdev; |
1155 | aac->name = aac_driver_template.name; | 1164 | aac->name = aac_driver_template.name; |
@@ -1157,7 +1166,7 @@ static int __devinit aac_probe_one(struct pci_dev *pdev, | |||
1157 | aac->cardtype = index; | 1166 | aac->cardtype = index; |
1158 | INIT_LIST_HEAD(&aac->entry); | 1167 | INIT_LIST_HEAD(&aac->entry); |
1159 | 1168 | ||
1160 | aac->fibs = kmalloc(sizeof(struct fib) * (shost->can_queue + AAC_NUM_MGT_FIB), GFP_KERNEL); | 1169 | aac->fibs = kzalloc(sizeof(struct fib) * (shost->can_queue + AAC_NUM_MGT_FIB), GFP_KERNEL); |
1161 | if (!aac->fibs) | 1170 | if (!aac->fibs) |
1162 | goto out_free_host; | 1171 | goto out_free_host; |
1163 | spin_lock_init(&aac->fib_lock); | 1172 | spin_lock_init(&aac->fib_lock); |
@@ -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 | ||