summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Barnett <kevin.barnett@hpe.com>2017-05-03 18:55:13 -0500
committerMartin K. Petersen <martin.petersen@oracle.com>2017-06-12 20:48:04 -0400
commit13bede676b98d595a43d36a34e1835b686d0d140 (patch)
tree2bcd33201f0fcf7904a3726d0d7e9e790411c43e
parentf5b63206255f68116c117565ab703c531c5ce400 (diff)
scsi: smartpqi: update timeout on admin commands
Increase the timeout on admin commands from 3 seconds to 60 seconds and added a check for controller crash in the loop where the driver polls for admin command completion. Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Signed-off-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>
-rw-r--r--drivers/scsi/smartpqi/smartpqi_init.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index affbc4ffb9a5..e13dee379558 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -3425,6 +3425,8 @@ static void pqi_submit_admin_request(struct pqi_ctrl_info *ctrl_info,
writel(iq_pi, admin_queues->iq_pi);
}
+#define PQI_ADMIN_REQUEST_TIMEOUT_SECS 60
+
static int pqi_poll_for_admin_response(struct pqi_ctrl_info *ctrl_info,
struct pqi_general_admin_response *response)
{
@@ -3436,7 +3438,7 @@ static int pqi_poll_for_admin_response(struct pqi_ctrl_info *ctrl_info,
admin_queues = &ctrl_info->admin_queues;
oq_ci = admin_queues->oq_ci_copy;
- timeout = (3 * HZ) + jiffies;
+ timeout = (PQI_ADMIN_REQUEST_TIMEOUT_SECS * HZ) + jiffies;
while (1) {
oq_pi = *admin_queues->oq_pi;
@@ -3447,6 +3449,8 @@ static int pqi_poll_for_admin_response(struct pqi_ctrl_info *ctrl_info,
"timed out waiting for admin response\n");
return -ETIMEDOUT;
}
+ if (!sis_is_firmware_running(ctrl_info))
+ return -ENXIO;
usleep_range(1000, 2000);
}