From: Don Brace Date: Fri, 20 Oct 2017 21:52:04 +0000 (-0500) Subject: scsi: hpsa: correct logical volume removal X-Git-Tag: v5.15~10029^2~72 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0ff365f51a4290a63f1044c599df98196223d4bc;p=platform%2Fkernel%2Flinux-starfive.git scsi: hpsa: correct logical volume removal Suggested-by: Martin Wilck Reviewed-by: Scott Benesh Reviewed-by: Scott Teel Reviewed-by: Kevin Barnett Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen --- diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 228d744..a536ed6 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); } }