diff options
author | James Bottomley <JBottomley@Parallels.com> | 2012-10-02 03:55:12 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-10-02 03:55:12 -0400 |
commit | fe709ed827d370e6b0c0a9f9456da1c22bdcd118 (patch) | |
tree | c5a7fd72a745a5f6656a58acc9a1d277e26f9595 /drivers/scsi/megaraid | |
parent | 1c4cf1d5845b59cdcbfad8e67272cf5b219ab062 (diff) | |
parent | 0644f5393e915f13733bcc65f13195ff39aeb63e (diff) |
Merge SCSI misc branch into isci-for-3.6 tag
Diffstat (limited to 'drivers/scsi/megaraid')
-rw-r--r-- | drivers/scsi/megaraid/megaraid_sas.h | 8 | ||||
-rw-r--r-- | drivers/scsi/megaraid/megaraid_sas_base.c | 39 | ||||
-rw-r--r-- | drivers/scsi/megaraid/megaraid_sas_fusion.c | 12 |
3 files changed, 44 insertions, 15 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h index e8f892647681..fcb005fa4bd1 100644 --- a/drivers/scsi/megaraid/megaraid_sas.h +++ b/drivers/scsi/megaraid/megaraid_sas.h | |||
@@ -33,9 +33,9 @@ | |||
33 | /* | 33 | /* |
34 | * MegaRAID SAS Driver meta data | 34 | * MegaRAID SAS Driver meta data |
35 | */ | 35 | */ |
36 | #define MEGASAS_VERSION "00.00.06.15-rc1" | 36 | #define MEGASAS_VERSION "00.00.06.18-rc1" |
37 | #define MEGASAS_RELDATE "Mar. 19, 2012" | 37 | #define MEGASAS_RELDATE "Jun. 17, 2012" |
38 | #define MEGASAS_EXT_VERSION "Mon. Mar. 19 17:00:00 PDT 2012" | 38 | #define MEGASAS_EXT_VERSION "Tue. Jun. 17 17:00:00 PDT 2012" |
39 | 39 | ||
40 | /* | 40 | /* |
41 | * Device IDs | 41 | * Device IDs |
@@ -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 | ||
1369 | enum { | 1371 | enum { |
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index ed38454228c6..0393ec478cdf 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c | |||
@@ -18,7 +18,7 @@ | |||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 | * | 19 | * |
20 | * FILE: megaraid_sas_base.c | 20 | * FILE: megaraid_sas_base.c |
21 | * Version : v00.00.06.15-rc1 | 21 | * Version : v00.00.06.18-rc1 |
22 | * | 22 | * |
23 | * Authors: LSI Corporation | 23 | * Authors: LSI Corporation |
24 | * Sreenivas Bagalkote | 24 | * Sreenivas Bagalkote |
@@ -71,6 +71,16 @@ static int msix_disable; | |||
71 | module_param(msix_disable, int, S_IRUGO); | 71 | module_param(msix_disable, int, S_IRUGO); |
72 | MODULE_PARM_DESC(msix_disable, "Disable MSI-X interrupt handling. Default: 0"); | 72 | MODULE_PARM_DESC(msix_disable, "Disable MSI-X interrupt handling. Default: 0"); |
73 | 73 | ||
74 | static int throttlequeuedepth = MEGASAS_THROTTLE_QUEUE_DEPTH; | ||
75 | module_param(throttlequeuedepth, int, S_IRUGO); | ||
76 | MODULE_PARM_DESC(throttlequeuedepth, | ||
77 | "Adapter queue depth when throttled due to I/O timeout. Default: 16"); | ||
78 | |||
79 | int resetwaittime = MEGASAS_RESET_WAIT_TIME; | ||
80 | module_param(resetwaittime, int, S_IRUGO); | ||
81 | MODULE_PARM_DESC(resetwaittime, "Wait time in seconds after I/O timeout " | ||
82 | "before resetting adapter. Default: 180"); | ||
83 | |||
74 | MODULE_LICENSE("GPL"); | 84 | MODULE_LICENSE("GPL"); |
75 | MODULE_VERSION(MEGASAS_VERSION); | 85 | MODULE_VERSION(MEGASAS_VERSION); |
76 | MODULE_AUTHOR("megaraidlinux@lsi.com"); | 86 | MODULE_AUTHOR("megaraidlinux@lsi.com"); |
@@ -1595,8 +1605,9 @@ megasas_check_and_restore_queue_depth(struct megasas_instance *instance) | |||
1595 | { | 1605 | { |
1596 | unsigned long flags; | 1606 | unsigned long flags; |
1597 | if (instance->flag & MEGASAS_FW_BUSY | 1607 | if (instance->flag & MEGASAS_FW_BUSY |
1598 | && time_after(jiffies, instance->last_time + 5 * HZ) | 1608 | && time_after(jiffies, instance->last_time + 5 * HZ) |
1599 | && atomic_read(&instance->fw_outstanding) < 17) { | 1609 | && atomic_read(&instance->fw_outstanding) < |
1610 | instance->throttlequeuedepth + 1) { | ||
1600 | 1611 | ||
1601 | spin_lock_irqsave(instance->host->host_lock, flags); | 1612 | spin_lock_irqsave(instance->host->host_lock, flags); |
1602 | instance->flag &= ~MEGASAS_FW_BUSY; | 1613 | instance->flag &= ~MEGASAS_FW_BUSY; |
@@ -1772,7 +1783,7 @@ static int megasas_wait_for_outstanding(struct megasas_instance *instance) | |||
1772 | return SUCCESS; | 1783 | return SUCCESS; |
1773 | } | 1784 | } |
1774 | 1785 | ||
1775 | for (i = 0; i < wait_time; i++) { | 1786 | for (i = 0; i < resetwaittime; i++) { |
1776 | 1787 | ||
1777 | int outstanding = atomic_read(&instance->fw_outstanding); | 1788 | int outstanding = atomic_read(&instance->fw_outstanding); |
1778 | 1789 | ||
@@ -1914,7 +1925,7 @@ blk_eh_timer_return megasas_reset_timer(struct scsi_cmnd *scmd) | |||
1914 | /* FW is busy, throttle IO */ | 1925 | /* FW is busy, throttle IO */ |
1915 | spin_lock_irqsave(instance->host->host_lock, flags); | 1926 | spin_lock_irqsave(instance->host->host_lock, flags); |
1916 | 1927 | ||
1917 | instance->host->can_queue = 16; | 1928 | instance->host->can_queue = instance->throttlequeuedepth; |
1918 | instance->last_time = jiffies; | 1929 | instance->last_time = jiffies; |
1919 | instance->flag |= MEGASAS_FW_BUSY; | 1930 | instance->flag |= MEGASAS_FW_BUSY; |
1920 | 1931 | ||
@@ -3577,6 +3588,24 @@ static int megasas_init_fw(struct megasas_instance *instance) | |||
3577 | 3588 | ||
3578 | kfree(ctrl_info); | 3589 | kfree(ctrl_info); |
3579 | 3590 | ||
3591 | /* Check for valid throttlequeuedepth module parameter */ | ||
3592 | if (instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0073SKINNY || | ||
3593 | instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0071SKINNY) { | ||
3594 | if (throttlequeuedepth > (instance->max_fw_cmds - | ||
3595 | MEGASAS_SKINNY_INT_CMDS)) | ||
3596 | instance->throttlequeuedepth = | ||
3597 | MEGASAS_THROTTLE_QUEUE_DEPTH; | ||
3598 | else | ||
3599 | instance->throttlequeuedepth = throttlequeuedepth; | ||
3600 | } else { | ||
3601 | if (throttlequeuedepth > (instance->max_fw_cmds - | ||
3602 | MEGASAS_INT_CMDS)) | ||
3603 | instance->throttlequeuedepth = | ||
3604 | MEGASAS_THROTTLE_QUEUE_DEPTH; | ||
3605 | else | ||
3606 | instance->throttlequeuedepth = throttlequeuedepth; | ||
3607 | } | ||
3608 | |||
3580 | /* | 3609 | /* |
3581 | * Setup tasklet for cmd completion | 3610 | * Setup tasklet for cmd completion |
3582 | */ | 3611 | */ |
diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index a610cf1d4847..ddf094e7d0ac 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c | |||
@@ -94,6 +94,7 @@ int megasas_transition_to_ready(struct megasas_instance *instance, int ocr); | |||
94 | void megaraid_sas_kill_hba(struct megasas_instance *instance); | 94 | void megaraid_sas_kill_hba(struct megasas_instance *instance); |
95 | 95 | ||
96 | extern u32 megasas_dbg_lvl; | 96 | extern u32 megasas_dbg_lvl; |
97 | extern int resetwaittime; | ||
97 | 98 | ||
98 | /** | 99 | /** |
99 | * megasas_enable_intr_fusion - Enables interrupts | 100 | * megasas_enable_intr_fusion - Enables interrupts |
@@ -461,8 +462,8 @@ megasas_alloc_cmds_fusion(struct megasas_instance *instance) | |||
461 | * Allocate the dynamic array first and then allocate individual | 462 | * Allocate the dynamic array first and then allocate individual |
462 | * commands. | 463 | * commands. |
463 | */ | 464 | */ |
464 | fusion->cmd_list = kmalloc(sizeof(struct megasas_cmd_fusion *) | 465 | fusion->cmd_list = kzalloc(sizeof(struct megasas_cmd_fusion *) |
465 | *max_cmd, GFP_KERNEL); | 466 | * max_cmd, GFP_KERNEL); |
466 | 467 | ||
467 | if (!fusion->cmd_list) { | 468 | if (!fusion->cmd_list) { |
468 | printk(KERN_DEBUG "megasas: out of memory. Could not alloc " | 469 | printk(KERN_DEBUG "megasas: out of memory. Could not alloc " |
@@ -470,9 +471,6 @@ megasas_alloc_cmds_fusion(struct megasas_instance *instance) | |||
470 | goto fail_cmd_list; | 471 | goto fail_cmd_list; |
471 | } | 472 | } |
472 | 473 | ||
473 | memset(fusion->cmd_list, 0, sizeof(struct megasas_cmd_fusion *) | ||
474 | *max_cmd); | ||
475 | |||
476 | max_cmd = instance->max_fw_cmds; | 474 | max_cmd = instance->max_fw_cmds; |
477 | for (i = 0; i < max_cmd; i++) { | 475 | for (i = 0; i < max_cmd; i++) { |
478 | fusion->cmd_list[i] = kmalloc(sizeof(struct megasas_cmd_fusion), | 476 | fusion->cmd_list[i] = kmalloc(sizeof(struct megasas_cmd_fusion), |
@@ -2063,9 +2061,9 @@ megasas_check_reset_fusion(struct megasas_instance *instance, | |||
2063 | int megasas_wait_for_outstanding_fusion(struct megasas_instance *instance) | 2061 | int megasas_wait_for_outstanding_fusion(struct megasas_instance *instance) |
2064 | { | 2062 | { |
2065 | int i, outstanding, retval = 0; | 2063 | int i, outstanding, retval = 0; |
2066 | u32 fw_state, wait_time = MEGASAS_RESET_WAIT_TIME; | 2064 | u32 fw_state; |
2067 | 2065 | ||
2068 | for (i = 0; i < wait_time; i++) { | 2066 | for (i = 0; i < resetwaittime; i++) { |
2069 | /* Check if firmware is in fault state */ | 2067 | /* Check if firmware is in fault state */ |
2070 | fw_state = instance->instancet->read_fw_status_reg( | 2068 | fw_state = instance->instancet->read_fw_status_reg( |
2071 | instance->reg_set) & MFI_STATE_MASK; | 2069 | instance->reg_set) & MFI_STATE_MASK; |