aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorSumit Saxena <sumit.saxena@avagotech.com>2016-01-28 10:34:34 -0500
committerMartin K. Petersen <martin.petersen@oracle.com>2016-02-23 21:27:02 -0500
commite3d178ca773ff997c6c94989d0b14a2c0eae761c (patch)
tree81d142d3eeaf6314c466b5e3fdd7d876dab3d32e /drivers/scsi
parentccc7507de27a639c9e1327d6e56ef1f357962b09 (diff)
megaraid_sas: Introduce module parameter for SCSI command timeout
This patch will introduce module-parameter for SCSI command timeout value and fix setting of resetwaittime beyond a value. Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com> Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/megaraid/megaraid_sas_base.c15
-rw-r--r--drivers/scsi/megaraid/megaraid_sas_fusion.c2
2 files changed, 13 insertions, 4 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index d2ea97769c76..54922e5f4faa 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -83,7 +83,7 @@ module_param(throttlequeuedepth, int, S_IRUGO);
83MODULE_PARM_DESC(throttlequeuedepth, 83MODULE_PARM_DESC(throttlequeuedepth,
84 "Adapter queue depth when throttled due to I/O timeout. Default: 16"); 84 "Adapter queue depth when throttled due to I/O timeout. Default: 16");
85 85
86int resetwaittime = MEGASAS_RESET_WAIT_TIME; 86unsigned int resetwaittime = MEGASAS_RESET_WAIT_TIME;
87module_param(resetwaittime, int, S_IRUGO); 87module_param(resetwaittime, int, S_IRUGO);
88MODULE_PARM_DESC(resetwaittime, "Wait time in seconds after I/O timeout " 88MODULE_PARM_DESC(resetwaittime, "Wait time in seconds after I/O timeout "
89 "before resetting adapter. Default: 180"); 89 "before resetting adapter. Default: 180");
@@ -100,6 +100,10 @@ unsigned int dual_qdepth_disable;
100module_param(dual_qdepth_disable, int, S_IRUGO); 100module_param(dual_qdepth_disable, int, S_IRUGO);
101MODULE_PARM_DESC(dual_qdepth_disable, "Disable dual queue depth feature. Default: 0"); 101MODULE_PARM_DESC(dual_qdepth_disable, "Disable dual queue depth feature. Default: 0");
102 102
103unsigned int scmd_timeout = MEGASAS_DEFAULT_CMD_TIMEOUT;
104module_param(scmd_timeout, int, S_IRUGO);
105MODULE_PARM_DESC(scmd_timeout, "scsi command timeout (10-90s), default 90s. See megasas_reset_timer.");
106
103MODULE_LICENSE("GPL"); 107MODULE_LICENSE("GPL");
104MODULE_VERSION(MEGASAS_VERSION); 108MODULE_VERSION(MEGASAS_VERSION);
105MODULE_AUTHOR("megaraidlinux.pdl@avagotech.com"); 109MODULE_AUTHOR("megaraidlinux.pdl@avagotech.com");
@@ -1850,7 +1854,7 @@ static int megasas_slave_configure(struct scsi_device *sdev)
1850 * The RAID firmware may require extended timeouts. 1854 * The RAID firmware may require extended timeouts.
1851 */ 1855 */
1852 blk_queue_rq_timeout(sdev->request_queue, 1856 blk_queue_rq_timeout(sdev->request_queue,
1853 MEGASAS_DEFAULT_CMD_TIMEOUT * HZ); 1857 scmd_timeout * HZ);
1854 1858
1855 return 0; 1859 return 0;
1856} 1860}
@@ -2645,7 +2649,7 @@ blk_eh_timer_return megasas_reset_timer(struct scsi_cmnd *scmd)
2645 unsigned long flags; 2649 unsigned long flags;
2646 2650
2647 if (time_after(jiffies, scmd->jiffies_at_alloc + 2651 if (time_after(jiffies, scmd->jiffies_at_alloc +
2648 (MEGASAS_DEFAULT_CMD_TIMEOUT * 2) * HZ)) { 2652 (scmd_timeout * 2) * HZ)) {
2649 return BLK_EH_NOT_HANDLED; 2653 return BLK_EH_NOT_HANDLED;
2650 } 2654 }
2651 2655
@@ -5254,6 +5258,11 @@ static int megasas_init_fw(struct megasas_instance *instance)
5254 instance->throttlequeuedepth = 5258 instance->throttlequeuedepth =
5255 MEGASAS_THROTTLE_QUEUE_DEPTH; 5259 MEGASAS_THROTTLE_QUEUE_DEPTH;
5256 5260
5261 if (resetwaittime > MEGASAS_RESET_WAIT_TIME)
5262 resetwaittime = MEGASAS_RESET_WAIT_TIME;
5263
5264 if ((scmd_timeout < 10) || (scmd_timeout > MEGASAS_DEFAULT_CMD_TIMEOUT))
5265 scmd_timeout = MEGASAS_DEFAULT_CMD_TIMEOUT;
5257 5266
5258 /* Launch SR-IOV heartbeat timer */ 5267 /* Launch SR-IOV heartbeat timer */
5259 if (instance->requestorId) { 5268 if (instance->requestorId) {
diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index 64926f7ef119..e740e2608a37 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -91,7 +91,7 @@ void megasas_start_timer(struct megasas_instance *instance,
91 struct timer_list *timer, 91 struct timer_list *timer,
92 void *fn, unsigned long interval); 92 void *fn, unsigned long interval);
93extern struct megasas_mgmt_info megasas_mgmt_info; 93extern struct megasas_mgmt_info megasas_mgmt_info;
94extern int resetwaittime; 94extern unsigned int resetwaittime;
95extern unsigned int dual_qdepth_disable; 95extern unsigned int dual_qdepth_disable;
96static void megasas_free_rdpq_fusion(struct megasas_instance *instance); 96static void megasas_free_rdpq_fusion(struct megasas_instance *instance);
97static void megasas_free_reply_fusion(struct megasas_instance *instance); 97static void megasas_free_reply_fusion(struct megasas_instance *instance);