aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc
diff options
context:
space:
mode:
authorJames Smart <jsmart2021@gmail.com>2022-04-12 15:19:55 -0700
committerMartin K. Petersen <martin.petersen@oracle.com>2022-04-18 22:48:45 -0400
commit39a1a86b9da22738f45460b50938515de8b9e48e (patch)
tree66e0b4a52ed86b9a1b6e031e2f658cb023f39cc5 /drivers/scsi/lpfc
parentscsi: lpfc: Remove unnecessary NULL pointer assignment for ELS_RDF path (diff)
downloadlinux-dev-39a1a86b9da22738f45460b50938515de8b9e48e.tar.xz
linux-dev-39a1a86b9da22738f45460b50938515de8b9e48e.zip
scsi: lpfc: Move MI module parameter check to handle dynamic disable
lpfc_refresh_params() can be called for an async event handler. This could potentially override the value initialized by lpfc_cmf_setup(). Move module parameter check to lpfc_refresh_params(). Link: https://lore.kernel.org/r/20220412222008.126521-14-jsmart2021@gmail.com Co-developed-by: Justin Tee <justin.tee@broadcom.com> Signed-off-by: Justin Tee <justin.tee@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/lpfc')
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c8
-rw-r--r--drivers/scsi/lpfc/lpfc_sli.c4
2 files changed, 7 insertions, 5 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 7dfd47dcaad9..ec6da7e27e4b 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -686,8 +686,14 @@ lpfc_sli4_refresh_params(struct lpfc_hba *phba)
return rc;
}
mbx_sli4_parameters = &mqe->un.get_sli4_parameters.sli4_parameters;
- phba->sli4_hba.pc_sli4_params.mi_ver =
+
+ /* Are we forcing MI off via module parameter? */
+ if (phba->cfg_enable_mi)
+ phba->sli4_hba.pc_sli4_params.mi_ver =
bf_get(cfg_mi_ver, mbx_sli4_parameters);
+ else
+ phba->sli4_hba.pc_sli4_params.mi_ver = 0;
+
phba->sli4_hba.pc_sli4_params.cmf =
bf_get(cfg_cmf, mbx_sli4_parameters);
phba->sli4_hba.pc_sli4_params.pls =
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index ca7766940b4e..3b9359c1ee1c 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -7994,10 +7994,6 @@ lpfc_cmf_setup(struct lpfc_hba *phba)
sli4_params = &phba->sli4_hba.pc_sli4_params;
- /* Are we forcing MI off via module parameter? */
- if (!phba->cfg_enable_mi)
- sli4_params->mi_ver = 0;
-
/* Always try to enable MI feature if we can */
if (sli4_params->mi_ver) {
lpfc_set_features(phba, mboxq, LPFC_SET_ENABLE_MI);