summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/hpsa.c
diff options
context:
space:
mode:
authorDon Brace <don.brace@microsemi.com>2017-10-20 16:52:04 -0500
committerMartin K. Petersen <martin.petersen@oracle.com>2017-10-25 04:55:21 -0400
commit0ff365f51a4290a63f1044c599df98196223d4bc (patch)
treeeeeaf9ebf151eadbd35dd12a7fbdf2b536e5260e /drivers/scsi/hpsa.c
parent9211a07fc1b25d9d437c5ccd39cb1596eb9adb06 (diff)
downloadlinux-stable-0ff365f51a4290a63f1044c599df98196223d4bc.tar.gz
linux-stable-0ff365f51a4290a63f1044c599df98196223d4bc.tar.bz2
linux-stable-0ff365f51a4290a63f1044c599df98196223d4bc.zip
scsi: hpsa: correct logical volume removal
Suggested-by: Martin Wilck <mwilck@suse.com> Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/hpsa.c')
-rw-r--r--drivers/scsi/hpsa.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 228d74465fd0..a536ed620e6e 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -1882,6 +1882,12 @@ static void hpsa_remove_device(struct ctlr_info *h,
if (!h->scsi_host)
return;
+ /*
+ * Allow for commands to drain
+ */
+ device->removed = 1;
+ hpsa_wait_for_outstanding_commands_for_dev(h, device);
+
if (is_logical_device(device)) { /* RAID */
sdev = scsi_device_lookup(h->scsi_host, device->bus,
device->target, device->lun);
@@ -1899,9 +1905,6 @@ static void hpsa_remove_device(struct ctlr_info *h,
}
} else { /* HBA */
- device->removed = 1;
- hpsa_wait_for_outstanding_commands_for_dev(h, device);
-
hpsa_remove_sas_device(device);
}
}