Commit 530dd8a7 authored by Mahesh Rajashekhara's avatar Mahesh Rajashekhara Committed by Martin K. Petersen

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: default avatarScott Benesh <scott.benesh@microsemi.com>
Reviewed-by: default avatarKevin Barnett <kevin.barnett@microsemi.com>
Signed-off-by: default avatarMahesh Rajashekhara <mahesh.rajashekhara@microsemi.com>
Signed-off-by: default avatarDon Brace <don.brace@microsemi.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 2d2ad4bc
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment