Skip to content

Commit 45348de

Browse files
Raghava Aditya Renukuntamartinkpetersen
authored andcommitted
scsi: aacraid: Fix controller initialization failure
This is a fix to an issue where the driver sends its periodic WELLNESS command to the controller after the driver shut it down.This causes the controller to crash. The window where this can happen is small, but it can be hit at around 4 hours of constant resets. Cc: <[email protected]> Fixes: fbd1859 (aacraid: Fix AIF triggered IOP_RESET) Signed-off-by: Raghava Aditya Renukunta <[email protected]> Reviewed-by: Dave Carroll <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent c99dfd2 commit 45348de

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

drivers/scsi/aacraid/comminit.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,11 @@ int aac_send_shutdown(struct aac_dev * dev)
302302
return -ENOMEM;
303303
aac_fib_init(fibctx);
304304

305-
mutex_lock(&dev->ioctl_mutex);
306-
dev->adapter_shutdown = 1;
307-
mutex_unlock(&dev->ioctl_mutex);
305+
if (!dev->adapter_shutdown) {
306+
mutex_lock(&dev->ioctl_mutex);
307+
dev->adapter_shutdown = 1;
308+
mutex_unlock(&dev->ioctl_mutex);
309+
}
308310

309311
cmd = (struct aac_close *) fib_data(fibctx);
310312
cmd->command = cpu_to_le32(VM_CloseAll);

drivers/scsi/aacraid/linit.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1551,8 +1551,9 @@ static void __aac_shutdown(struct aac_dev * aac)
15511551
{
15521552
int i;
15531553

1554+
mutex_lock(&aac->ioctl_mutex);
15541555
aac->adapter_shutdown = 1;
1555-
aac_send_shutdown(aac);
1556+
mutex_unlock(&aac->ioctl_mutex);
15561557

15571558
if (aac->aif_thread) {
15581559
int i;
@@ -1565,7 +1566,11 @@ static void __aac_shutdown(struct aac_dev * aac)
15651566
}
15661567
kthread_stop(aac->thread);
15671568
}
1569+
1570+
aac_send_shutdown(aac);
1571+
15681572
aac_adapter_disable_int(aac);
1573+
15691574
if (aac_is_src(aac)) {
15701575
if (aac->max_msix > 1) {
15711576
for (i = 0; i < aac->max_msix; i++) {

0 commit comments

Comments
 (0)