Commit e3d178ca authored by Sumit Saxena's avatar Sumit Saxena Committed by Martin K. Petersen

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: default avatarKashyap Desai <kashyap.desai@avagotech.com>
Signed-off-by: default avatarSumit Saxena <sumit.saxena@avagotech.com>
Reviewed-by: default avatarTomas Henzl <thenzl@redhat.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent ccc7507d
...@@ -83,7 +83,7 @@ module_param(throttlequeuedepth, int, S_IRUGO); ...@@ -83,7 +83,7 @@ module_param(throttlequeuedepth, int, S_IRUGO);
MODULE_PARM_DESC(throttlequeuedepth, MODULE_PARM_DESC(throttlequeuedepth,
"Adapter queue depth when throttled due to I/O timeout. Default: 16"); "Adapter queue depth when throttled due to I/O timeout. Default: 16");
int resetwaittime = MEGASAS_RESET_WAIT_TIME; unsigned int resetwaittime = MEGASAS_RESET_WAIT_TIME;
module_param(resetwaittime, int, S_IRUGO); module_param(resetwaittime, int, S_IRUGO);
MODULE_PARM_DESC(resetwaittime, "Wait time in seconds after I/O timeout " MODULE_PARM_DESC(resetwaittime, "Wait time in seconds after I/O timeout "
"before resetting adapter. Default: 180"); "before resetting adapter. Default: 180");
...@@ -100,6 +100,10 @@ unsigned int dual_qdepth_disable; ...@@ -100,6 +100,10 @@ unsigned int dual_qdepth_disable;
module_param(dual_qdepth_disable, int, S_IRUGO); module_param(dual_qdepth_disable, int, S_IRUGO);
MODULE_PARM_DESC(dual_qdepth_disable, "Disable dual queue depth feature. Default: 0"); MODULE_PARM_DESC(dual_qdepth_disable, "Disable dual queue depth feature. Default: 0");
unsigned int scmd_timeout = MEGASAS_DEFAULT_CMD_TIMEOUT;
module_param(scmd_timeout, int, S_IRUGO);
MODULE_PARM_DESC(scmd_timeout, "scsi command timeout (10-90s), default 90s. See megasas_reset_timer.");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_VERSION(MEGASAS_VERSION); MODULE_VERSION(MEGASAS_VERSION);
MODULE_AUTHOR("megaraidlinux.pdl@avagotech.com"); MODULE_AUTHOR("megaraidlinux.pdl@avagotech.com");
...@@ -1850,7 +1854,7 @@ static int megasas_slave_configure(struct scsi_device *sdev) ...@@ -1850,7 +1854,7 @@ static int megasas_slave_configure(struct scsi_device *sdev)
* The RAID firmware may require extended timeouts. * The RAID firmware may require extended timeouts.
*/ */
blk_queue_rq_timeout(sdev->request_queue, blk_queue_rq_timeout(sdev->request_queue,
MEGASAS_DEFAULT_CMD_TIMEOUT * HZ); scmd_timeout * HZ);
return 0; return 0;
} }
...@@ -2645,7 +2649,7 @@ blk_eh_timer_return megasas_reset_timer(struct scsi_cmnd *scmd) ...@@ -2645,7 +2649,7 @@ blk_eh_timer_return megasas_reset_timer(struct scsi_cmnd *scmd)
unsigned long flags; unsigned long flags;
if (time_after(jiffies, scmd->jiffies_at_alloc + if (time_after(jiffies, scmd->jiffies_at_alloc +
(MEGASAS_DEFAULT_CMD_TIMEOUT * 2) * HZ)) { (scmd_timeout * 2) * HZ)) {
return BLK_EH_NOT_HANDLED; return BLK_EH_NOT_HANDLED;
} }
...@@ -5254,6 +5258,11 @@ static int megasas_init_fw(struct megasas_instance *instance) ...@@ -5254,6 +5258,11 @@ static int megasas_init_fw(struct megasas_instance *instance)
instance->throttlequeuedepth = instance->throttlequeuedepth =
MEGASAS_THROTTLE_QUEUE_DEPTH; MEGASAS_THROTTLE_QUEUE_DEPTH;
if (resetwaittime > MEGASAS_RESET_WAIT_TIME)
resetwaittime = MEGASAS_RESET_WAIT_TIME;
if ((scmd_timeout < 10) || (scmd_timeout > MEGASAS_DEFAULT_CMD_TIMEOUT))
scmd_timeout = MEGASAS_DEFAULT_CMD_TIMEOUT;
/* Launch SR-IOV heartbeat timer */ /* Launch SR-IOV heartbeat timer */
if (instance->requestorId) { if (instance->requestorId) {
......
...@@ -91,7 +91,7 @@ void megasas_start_timer(struct megasas_instance *instance, ...@@ -91,7 +91,7 @@ void megasas_start_timer(struct megasas_instance *instance,
struct timer_list *timer, struct timer_list *timer,
void *fn, unsigned long interval); void *fn, unsigned long interval);
extern struct megasas_mgmt_info megasas_mgmt_info; extern struct megasas_mgmt_info megasas_mgmt_info;
extern int resetwaittime; extern unsigned int resetwaittime;
extern unsigned int dual_qdepth_disable; extern unsigned int dual_qdepth_disable;
static void megasas_free_rdpq_fusion(struct megasas_instance *instance); static void megasas_free_rdpq_fusion(struct megasas_instance *instance);
static void megasas_free_reply_fusion(struct megasas_instance *instance); static void megasas_free_reply_fusion(struct megasas_instance *instance);
......
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