scsi: lpfc: Revert LOG_TRACE_EVENT back to LOG_INIT prior to driver_resource_setup()
In cases when lpfc_enable_pci_dev() fails, lpfc_printf_log() with LOG_TRACE_EVENT set will call lpfc_dmp_dbg() which uses the phba->port_list_lock. However, phba->port_list_lock does not get initialized until lpfc_setup_driver_resource_phase1(). Thus, any initialization routine with LOG_TRACE_EVENT log message prior to lpfc_setup_driver_resource_phase1() will crash. Revert LOG_TRACE_EVENT back to LOG_INIT for all log messages in routines prior to lpfc_setup_driver_resource_phase1(). Link: https://lore.kernel.org/r/20211020211417.88754-2-jsmart2021@gmail.com CC: Zheyu Ma <zheyuma97@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>
This commit is contained in:
committed by
Martin K. Petersen
parent
b6ca770ae7
commit
a516074c20
@@ -7385,7 +7385,7 @@ lpfc_enable_pci_dev(struct lpfc_hba *phba)
|
|||||||
out_disable_device:
|
out_disable_device:
|
||||||
pci_disable_device(pdev);
|
pci_disable_device(pdev);
|
||||||
out_error:
|
out_error:
|
||||||
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
|
lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
|
||||||
"1401 Failed to enable pci device\n");
|
"1401 Failed to enable pci device\n");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
@@ -8428,7 +8428,7 @@ lpfc_init_api_table_setup(struct lpfc_hba *phba, uint8_t dev_grp)
|
|||||||
phba->lpfc_stop_port = lpfc_stop_port_s4;
|
phba->lpfc_stop_port = lpfc_stop_port_s4;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
|
lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
|
||||||
"1431 Invalid HBA PCI-device group: 0x%x\n",
|
"1431 Invalid HBA PCI-device group: 0x%x\n",
|
||||||
dev_grp);
|
dev_grp);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
@@ -11661,7 +11661,7 @@ lpfc_sli4_pci_mem_setup(struct lpfc_hba *phba)
|
|||||||
/* There is no SLI3 failback for SLI4 devices. */
|
/* There is no SLI3 failback for SLI4 devices. */
|
||||||
if (bf_get(lpfc_sli_intf_valid, &phba->sli4_hba.sli_intf) !=
|
if (bf_get(lpfc_sli_intf_valid, &phba->sli4_hba.sli_intf) !=
|
||||||
LPFC_SLI_INTF_VALID) {
|
LPFC_SLI_INTF_VALID) {
|
||||||
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
|
lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
|
||||||
"2894 SLI_INTF reg contents invalid "
|
"2894 SLI_INTF reg contents invalid "
|
||||||
"sli_intf reg 0x%x\n",
|
"sli_intf reg 0x%x\n",
|
||||||
phba->sli4_hba.sli_intf.word0);
|
phba->sli4_hba.sli_intf.word0);
|
||||||
|
@@ -5115,7 +5115,7 @@ lpfc_scsi_api_table_setup(struct lpfc_hba *phba, uint8_t dev_grp)
|
|||||||
phba->lpfc_scsi_prep_cmnd_buf = lpfc_scsi_prep_cmnd_buf_s4;
|
phba->lpfc_scsi_prep_cmnd_buf = lpfc_scsi_prep_cmnd_buf_s4;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
|
lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
|
||||||
"1418 Invalid HBA PCI-device group: 0x%x\n",
|
"1418 Invalid HBA PCI-device group: 0x%x\n",
|
||||||
dev_grp);
|
dev_grp);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
@@ -10026,7 +10026,7 @@ lpfc_mbox_api_table_setup(struct lpfc_hba *phba, uint8_t dev_grp)
|
|||||||
phba->lpfc_sli_brdready = lpfc_sli_brdready_s4;
|
phba->lpfc_sli_brdready = lpfc_sli_brdready_s4;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
|
lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
|
||||||
"1420 Invalid HBA PCI-device group: 0x%x\n",
|
"1420 Invalid HBA PCI-device group: 0x%x\n",
|
||||||
dev_grp);
|
dev_grp);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
@@ -11194,7 +11194,7 @@ lpfc_sli_api_table_setup(struct lpfc_hba *phba, uint8_t dev_grp)
|
|||||||
phba->__lpfc_sli_issue_fcp_io = __lpfc_sli_issue_fcp_io_s4;
|
phba->__lpfc_sli_issue_fcp_io = __lpfc_sli_issue_fcp_io_s4;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
|
lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
|
||||||
"1419 Invalid HBA PCI-device group: 0x%x\n",
|
"1419 Invalid HBA PCI-device group: 0x%x\n",
|
||||||
dev_grp);
|
dev_grp);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
Reference in New Issue
Block a user