aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/megaraid
diff options
context:
space:
mode:
authorsumit.saxena@avagotech.com <sumit.saxena@avagotech.com>2015-08-31 07:54:11 -0400
committerMartin K. Petersen <martin.petersen@oracle.com>2015-10-29 00:36:58 -0400
commit92bb6505785b632a1b0f735b21c4b34326ec048f (patch)
tree6d323affd0631827bf5595d4c87a1cf00b12c3f2 /drivers/scsi/megaraid
parent75b96061eb95c9b9f8a1da6995f1c314526f3572 (diff)
megaraid_sas: Code refactor for use of requestorId
Some of these code changes were proposed by David Binderman. Removed redudant check of requestorId. Redundant condition: instance.requestorId. Check for plasma firmware 1.11 are now restructured to support only specific device id. Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com> Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/megaraid')
-rw-r--r--drivers/scsi/megaraid/megaraid_sas_base.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index b72dce603549..04a1edc0afc8 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -4842,18 +4842,22 @@ static int megasas_init_fw(struct megasas_instance *instance)
4842 4842
4843 } 4843 }
4844 if (ctrl_info->host_interface.SRIOV) { 4844 if (ctrl_info->host_interface.SRIOV) {
4845 if (!ctrl_info->adapterOperations2.activePassive) 4845 instance->requestorId = ctrl_info->iov.requestorId;
4846 instance->PlasmaFW111 = 1; 4846 if (instance->pdev->device == PCI_DEVICE_ID_LSI_PLASMA) {
4847 4847 if (!ctrl_info->adapterOperations2.activePassive)
4848 if (!instance->PlasmaFW111) 4848 instance->PlasmaFW111 = 1;
4849 instance->requestorId = 4849
4850 ctrl_info->iov.requestorId; 4850 dev_info(&instance->pdev->dev, "SR-IOV: firmware type: %s\n",
4851 else { 4851 instance->PlasmaFW111 ? "1.11" : "new");
4852 iovPtr = (struct IOV_111 *)((unsigned char *)ctrl_info + IOV_111_OFFSET); 4852
4853 instance->requestorId = iovPtr->requestorId; 4853 if (instance->PlasmaFW111) {
4854 iovPtr = (struct IOV_111 *)
4855 ((unsigned char *)ctrl_info + IOV_111_OFFSET);
4856 instance->requestorId = iovPtr->requestorId;
4857 }
4854 } 4858 }
4855 dev_warn(&instance->pdev->dev, "I am VF " 4859 dev_info(&instance->pdev->dev, "SRIOV: VF requestorId %d\n",
4856 "requestorId %d\n", instance->requestorId); 4860 instance->requestorId);
4857 } 4861 }
4858 4862
4859 instance->crash_dump_fw_support = 4863 instance->crash_dump_fw_support =
@@ -6723,8 +6727,7 @@ megasas_aen_polling(struct work_struct *work)
6723 case MR_EVT_CFG_CLEARED: 6727 case MR_EVT_CFG_CLEARED:
6724 case MR_EVT_LD_DELETED: 6728 case MR_EVT_LD_DELETED:
6725 if (!instance->requestorId || 6729 if (!instance->requestorId ||
6726 (instance->requestorId && 6730 megasas_get_ld_vf_affiliation(instance, 0)) {
6727 megasas_get_ld_vf_affiliation(instance, 0))) {
6728 if (megasas_ld_list_query(instance, 6731 if (megasas_ld_list_query(instance,
6729 MR_LD_QUERY_TYPE_EXPOSED_TO_HOST)) 6732 MR_LD_QUERY_TYPE_EXPOSED_TO_HOST))
6730 megasas_get_ld_list(instance); 6733 megasas_get_ld_list(instance);
@@ -6755,8 +6758,7 @@ megasas_aen_polling(struct work_struct *work)
6755 break; 6758 break;
6756 case MR_EVT_LD_CREATED: 6759 case MR_EVT_LD_CREATED:
6757 if (!instance->requestorId || 6760 if (!instance->requestorId ||
6758 (instance->requestorId && 6761 megasas_get_ld_vf_affiliation(instance, 0)) {
6759 megasas_get_ld_vf_affiliation(instance, 0))) {
6760 if (megasas_ld_list_query(instance, 6762 if (megasas_ld_list_query(instance,
6761 MR_LD_QUERY_TYPE_EXPOSED_TO_HOST)) 6763 MR_LD_QUERY_TYPE_EXPOSED_TO_HOST))
6762 megasas_get_ld_list(instance); 6764 megasas_get_ld_list(instance);
@@ -6822,8 +6824,7 @@ megasas_aen_polling(struct work_struct *work)
6822 } 6824 }
6823 6825
6824 if (!instance->requestorId || 6826 if (!instance->requestorId ||
6825 (instance->requestorId && 6827 megasas_get_ld_vf_affiliation(instance, 0)) {
6826 megasas_get_ld_vf_affiliation(instance, 0))) {
6827 if (megasas_ld_list_query(instance, 6828 if (megasas_ld_list_query(instance,
6828 MR_LD_QUERY_TYPE_EXPOSED_TO_HOST)) 6829 MR_LD_QUERY_TYPE_EXPOSED_TO_HOST))
6829 megasas_get_ld_list(instance); 6830 megasas_get_ld_list(instance);