diff options
author | Sumit.Saxena@lsi.com <Sumit.Saxena@lsi.com> | 2013-05-22 03:05:33 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-06-24 20:51:05 -0400 |
commit | 404a8a1a891e9eadf8b1ef5ad945f569758c0884 (patch) | |
tree | 57feda1b3798b04a3d2a3a63137fadd5bf40a97d /drivers/scsi/megaraid | |
parent | bc93d425fcb6443ffd6e20efa08f4960a30ab26f (diff) |
[SCSI] megaraid_sas: Add support to differentiate between iMR vs MR Firmware
Add support to differentiate between iMR(no external memory) and MR(with
external memory) controllers.
Signed-off-by: Sumit Saxena <sumit.saxena@lsi.com>
Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/megaraid')
-rw-r--r-- | drivers/scsi/megaraid/megaraid_sas.h | 1 | ||||
-rw-r--r-- | drivers/scsi/megaraid/megaraid_sas_base.c | 24 |
2 files changed, 17 insertions, 8 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h index 55a08d8ec531..209fe36e6f29 100644 --- a/drivers/scsi/megaraid/megaraid_sas.h +++ b/drivers/scsi/megaraid/megaraid_sas.h | |||
@@ -1533,6 +1533,7 @@ struct megasas_instance { | |||
1533 | struct mutex reset_mutex; | 1533 | struct mutex reset_mutex; |
1534 | int throttlequeuedepth; | 1534 | int throttlequeuedepth; |
1535 | u8 mask_interrupts; | 1535 | u8 mask_interrupts; |
1536 | u8 is_imr; | ||
1536 | }; | 1537 | }; |
1537 | 1538 | ||
1538 | enum { | 1539 | enum { |
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index 6d7b656bd21b..a97b32160605 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c | |||
@@ -1641,10 +1641,7 @@ megasas_check_and_restore_queue_depth(struct megasas_instance *instance) | |||
1641 | 1641 | ||
1642 | spin_lock_irqsave(instance->host->host_lock, flags); | 1642 | spin_lock_irqsave(instance->host->host_lock, flags); |
1643 | instance->flag &= ~MEGASAS_FW_BUSY; | 1643 | instance->flag &= ~MEGASAS_FW_BUSY; |
1644 | if ((instance->pdev->device == | 1644 | if (instance->is_imr) { |
1645 | PCI_DEVICE_ID_LSI_SAS0073SKINNY) || | ||
1646 | (instance->pdev->device == | ||
1647 | PCI_DEVICE_ID_LSI_SAS0071SKINNY)) { | ||
1648 | instance->host->can_queue = | 1645 | instance->host->can_queue = |
1649 | instance->max_fw_cmds - MEGASAS_SKINNY_INT_CMDS; | 1646 | instance->max_fw_cmds - MEGASAS_SKINNY_INT_CMDS; |
1650 | } else | 1647 | } else |
@@ -3662,6 +3659,18 @@ static int megasas_init_fw(struct megasas_instance *instance) | |||
3662 | max_sectors_2 = ctrl_info->max_request_size; | 3659 | max_sectors_2 = ctrl_info->max_request_size; |
3663 | 3660 | ||
3664 | tmp_sectors = min_t(u32, max_sectors_1 , max_sectors_2); | 3661 | tmp_sectors = min_t(u32, max_sectors_1 , max_sectors_2); |
3662 | |||
3663 | /*Check whether controller is iMR or MR */ | ||
3664 | if (ctrl_info->memory_size) { | ||
3665 | instance->is_imr = 0; | ||
3666 | dev_info(&instance->pdev->dev, "Controller type: MR," | ||
3667 | "Memory size is: %dMB\n", | ||
3668 | ctrl_info->memory_size); | ||
3669 | } else { | ||
3670 | instance->is_imr = 1; | ||
3671 | dev_info(&instance->pdev->dev, | ||
3672 | "Controller type: iMR\n"); | ||
3673 | } | ||
3665 | instance->disableOnlineCtrlReset = | 3674 | instance->disableOnlineCtrlReset = |
3666 | ctrl_info->properties.OnOffProperties.disableOnlineCtrlReset; | 3675 | ctrl_info->properties.OnOffProperties.disableOnlineCtrlReset; |
3667 | instance->UnevenSpanSupport = | 3676 | instance->UnevenSpanSupport = |
@@ -3686,8 +3695,7 @@ static int megasas_init_fw(struct megasas_instance *instance) | |||
3686 | kfree(ctrl_info); | 3695 | kfree(ctrl_info); |
3687 | 3696 | ||
3688 | /* Check for valid throttlequeuedepth module parameter */ | 3697 | /* Check for valid throttlequeuedepth module parameter */ |
3689 | if (instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0073SKINNY || | 3698 | if (instance->is_imr) { |
3690 | instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0071SKINNY) { | ||
3691 | if (throttlequeuedepth > (instance->max_fw_cmds - | 3699 | if (throttlequeuedepth > (instance->max_fw_cmds - |
3692 | MEGASAS_SKINNY_INT_CMDS)) | 3700 | MEGASAS_SKINNY_INT_CMDS)) |
3693 | instance->throttlequeuedepth = | 3701 | instance->throttlequeuedepth = |
@@ -3971,8 +3979,7 @@ static int megasas_io_attach(struct megasas_instance *instance) | |||
3971 | */ | 3979 | */ |
3972 | host->irq = instance->pdev->irq; | 3980 | host->irq = instance->pdev->irq; |
3973 | host->unique_id = instance->unique_id; | 3981 | host->unique_id = instance->unique_id; |
3974 | if ((instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0073SKINNY) || | 3982 | if (instance->is_imr) { |
3975 | (instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0071SKINNY)) { | ||
3976 | host->can_queue = | 3983 | host->can_queue = |
3977 | instance->max_fw_cmds - MEGASAS_SKINNY_INT_CMDS; | 3984 | instance->max_fw_cmds - MEGASAS_SKINNY_INT_CMDS; |
3978 | } else | 3985 | } else |
@@ -4167,6 +4174,7 @@ static int megasas_probe_one(struct pci_dev *pdev, | |||
4167 | instance->ev = NULL; | 4174 | instance->ev = NULL; |
4168 | instance->issuepend_done = 1; | 4175 | instance->issuepend_done = 1; |
4169 | instance->adprecovery = MEGASAS_HBA_OPERATIONAL; | 4176 | instance->adprecovery = MEGASAS_HBA_OPERATIONAL; |
4177 | instance->is_imr = 0; | ||
4170 | megasas_poll_wait_aen = 0; | 4178 | megasas_poll_wait_aen = 0; |
4171 | 4179 | ||
4172 | instance->evt_detail = pci_alloc_consistent(pdev, | 4180 | instance->evt_detail = pci_alloc_consistent(pdev, |