summaryrefslogtreecommitdiff
path: root/drivers/scsi
diff options
context:
space:
mode:
authorMahesh Rajashekhara <mahesh.rajashekhara@microsemi.com>2019-08-22 15:39:31 -0500
committerMartin K. Petersen <martin.petersen@oracle.com>2019-08-29 18:31:39 -0400
commit530dd8a7a2b1ff2ee6c862ba250ca54ccc8c8c3e (patch)
treefbd4dd7287f3aa08327feb3f5ec7dbb819c9cdba /drivers/scsi
parent2d2ad4bc724e35459a19bbf77432facb9ac23f80 (diff)
scsi: smartpqi: correct hang when deleting 32 lds
When each ld is deleted, a rescan event is triggered in the driver. These can stack up waiting on mutex_lock. Change to mutex_try_lock and schedule a rescan for later. Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Mahesh Rajashekhara <mahesh.rajashekhara@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')
-rw-r--r--drivers/scsi/smartpqi/smartpqi_init.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index a6cb49b8e5d0..9801606dadfa 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -2236,18 +2236,20 @@ static void pqi_remove_all_scsi_devices(struct pqi_ctrl_info *ctrl_info)
static int pqi_scan_scsi_devices(struct pqi_ctrl_info *ctrl_info)
{
- int rc;
+ int rc = 0;
if (pqi_ctrl_offline(ctrl_info))
return -ENXIO;
- mutex_lock(&ctrl_info->scan_mutex);
-
- rc = pqi_update_scsi_devices(ctrl_info);
- if (rc)
+ if (!mutex_trylock(&ctrl_info->scan_mutex)) {
pqi_schedule_rescan_worker_delayed(ctrl_info);
- mutex_unlock(&ctrl_info->scan_mutex);
+ } else {
+ rc = pqi_update_scsi_devices(ctrl_info);
+ if (rc)
+ pqi_schedule_rescan_worker_delayed(ctrl_info);
+ mutex_unlock(&ctrl_info->scan_mutex);
+ }
return rc;
}