aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/megaraid
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/megaraid')
-rw-r--r--drivers/scsi/megaraid/megaraid_sas.h2
-rw-r--r--drivers/scsi/megaraid/megaraid_sas_base.c30
2 files changed, 29 insertions, 3 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h
index e8f892647681..f65025d63bc8 100644
--- a/drivers/scsi/megaraid/megaraid_sas.h
+++ b/drivers/scsi/megaraid/megaraid_sas.h
@@ -747,6 +747,7 @@ struct megasas_ctrl_info {
747#define MEGASAS_RESET_NOTICE_INTERVAL 5 747#define MEGASAS_RESET_NOTICE_INTERVAL 5
748#define MEGASAS_IOCTL_CMD 0 748#define MEGASAS_IOCTL_CMD 0
749#define MEGASAS_DEFAULT_CMD_TIMEOUT 90 749#define MEGASAS_DEFAULT_CMD_TIMEOUT 90
750#define MEGASAS_THROTTLE_QUEUE_DEPTH 16
750 751
751/* 752/*
752 * FW reports the maximum of number of commands that it can accept (maximum 753 * FW reports the maximum of number of commands that it can accept (maximum
@@ -1364,6 +1365,7 @@ struct megasas_instance {
1364 unsigned long bar; 1365 unsigned long bar;
1365 long reset_flags; 1366 long reset_flags;
1366 struct mutex reset_mutex; 1367 struct mutex reset_mutex;
1368 int throttlequeuedepth;
1367}; 1369};
1368 1370
1369enum { 1371enum {
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index dc27598785e5..f8f0a165dfb6 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -71,6 +71,11 @@ static int msix_disable;
71module_param(msix_disable, int, S_IRUGO); 71module_param(msix_disable, int, S_IRUGO);
72MODULE_PARM_DESC(msix_disable, "Disable MSI-X interrupt handling. Default: 0"); 72MODULE_PARM_DESC(msix_disable, "Disable MSI-X interrupt handling. Default: 0");
73 73
74static int throttlequeuedepth = MEGASAS_THROTTLE_QUEUE_DEPTH;
75module_param(throttlequeuedepth, int, S_IRUGO);
76MODULE_PARM_DESC(throttlequeuedepth,
77 "Adapter queue depth when throttled due to I/O timeout. Default: 16");
78
74MODULE_LICENSE("GPL"); 79MODULE_LICENSE("GPL");
75MODULE_VERSION(MEGASAS_VERSION); 80MODULE_VERSION(MEGASAS_VERSION);
76MODULE_AUTHOR("megaraidlinux@lsi.com"); 81MODULE_AUTHOR("megaraidlinux@lsi.com");
@@ -1595,8 +1600,9 @@ megasas_check_and_restore_queue_depth(struct megasas_instance *instance)
1595{ 1600{
1596 unsigned long flags; 1601 unsigned long flags;
1597 if (instance->flag & MEGASAS_FW_BUSY 1602 if (instance->flag & MEGASAS_FW_BUSY
1598 && time_after(jiffies, instance->last_time + 5 * HZ) 1603 && time_after(jiffies, instance->last_time + 5 * HZ)
1599 && atomic_read(&instance->fw_outstanding) < 17) { 1604 && atomic_read(&instance->fw_outstanding) <
1605 instance->throttlequeuedepth + 1) {
1600 1606
1601 spin_lock_irqsave(instance->host->host_lock, flags); 1607 spin_lock_irqsave(instance->host->host_lock, flags);
1602 instance->flag &= ~MEGASAS_FW_BUSY; 1608 instance->flag &= ~MEGASAS_FW_BUSY;
@@ -1914,7 +1920,7 @@ blk_eh_timer_return megasas_reset_timer(struct scsi_cmnd *scmd)
1914 /* FW is busy, throttle IO */ 1920 /* FW is busy, throttle IO */
1915 spin_lock_irqsave(instance->host->host_lock, flags); 1921 spin_lock_irqsave(instance->host->host_lock, flags);
1916 1922
1917 instance->host->can_queue = 16; 1923 instance->host->can_queue = instance->throttlequeuedepth;
1918 instance->last_time = jiffies; 1924 instance->last_time = jiffies;
1919 instance->flag |= MEGASAS_FW_BUSY; 1925 instance->flag |= MEGASAS_FW_BUSY;
1920 1926
@@ -3577,6 +3583,24 @@ static int megasas_init_fw(struct megasas_instance *instance)
3577 3583
3578 kfree(ctrl_info); 3584 kfree(ctrl_info);
3579 3585
3586 /* Check for valid throttlequeuedepth module parameter */
3587 if (instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0073SKINNY ||
3588 instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0071SKINNY) {
3589 if (throttlequeuedepth > (instance->max_fw_cmds -
3590 MEGASAS_SKINNY_INT_CMDS))
3591 instance->throttlequeuedepth =
3592 MEGASAS_THROTTLE_QUEUE_DEPTH;
3593 else
3594 instance->throttlequeuedepth = throttlequeuedepth;
3595 } else {
3596 if (throttlequeuedepth > (instance->max_fw_cmds -
3597 MEGASAS_INT_CMDS))
3598 instance->throttlequeuedepth =
3599 MEGASAS_THROTTLE_QUEUE_DEPTH;
3600 else
3601 instance->throttlequeuedepth = throttlequeuedepth;
3602 }
3603
3580 /* 3604 /*
3581 * Setup tasklet for cmd completion 3605 * Setup tasklet for cmd completion
3582 */ 3606 */