Skip to content

Commit a516074

Browse files
jsmart-ghmartinkpetersen
authored andcommitted
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/[email protected] CC: Zheyu Ma <[email protected]> Co-developed-by: Justin Tee <[email protected]> Signed-off-by: Justin Tee <[email protected]> Signed-off-by: James Smart <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent b6ca770 commit a516074

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

drivers/scsi/lpfc/lpfc_init.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7385,7 +7385,7 @@ lpfc_enable_pci_dev(struct lpfc_hba *phba)
73857385
out_disable_device:
73867386
pci_disable_device(pdev);
73877387
out_error:
7388-
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
7388+
lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
73897389
"1401 Failed to enable pci device\n");
73907390
return -ENODEV;
73917391
}
@@ -8428,7 +8428,7 @@ lpfc_init_api_table_setup(struct lpfc_hba *phba, uint8_t dev_grp)
84288428
phba->lpfc_stop_port = lpfc_stop_port_s4;
84298429
break;
84308430
default:
8431-
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
8431+
lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
84328432
"1431 Invalid HBA PCI-device group: 0x%x\n",
84338433
dev_grp);
84348434
return -ENODEV;
@@ -11661,7 +11661,7 @@ lpfc_sli4_pci_mem_setup(struct lpfc_hba *phba)
1166111661
/* There is no SLI3 failback for SLI4 devices. */
1166211662
if (bf_get(lpfc_sli_intf_valid, &phba->sli4_hba.sli_intf) !=
1166311663
LPFC_SLI_INTF_VALID) {
11664-
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
11664+
lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
1166511665
"2894 SLI_INTF reg contents invalid "
1166611666
"sli_intf reg 0x%x\n",
1166711667
phba->sli4_hba.sli_intf.word0);

drivers/scsi/lpfc/lpfc_scsi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5115,7 +5115,7 @@ lpfc_scsi_api_table_setup(struct lpfc_hba *phba, uint8_t dev_grp)
51155115
phba->lpfc_scsi_prep_cmnd_buf = lpfc_scsi_prep_cmnd_buf_s4;
51165116
break;
51175117
default:
5118-
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
5118+
lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
51195119
"1418 Invalid HBA PCI-device group: 0x%x\n",
51205120
dev_grp);
51215121
return -ENODEV;

drivers/scsi/lpfc/lpfc_sli.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10026,7 +10026,7 @@ lpfc_mbox_api_table_setup(struct lpfc_hba *phba, uint8_t dev_grp)
1002610026
phba->lpfc_sli_brdready = lpfc_sli_brdready_s4;
1002710027
break;
1002810028
default:
10029-
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
10029+
lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
1003010030
"1420 Invalid HBA PCI-device group: 0x%x\n",
1003110031
dev_grp);
1003210032
return -ENODEV;
@@ -11194,7 +11194,7 @@ lpfc_sli_api_table_setup(struct lpfc_hba *phba, uint8_t dev_grp)
1119411194
phba->__lpfc_sli_issue_fcp_io = __lpfc_sli_issue_fcp_io_s4;
1119511195
break;
1119611196
default:
11197-
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
11197+
lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
1119811198
"1419 Invalid HBA PCI-device group: 0x%x\n",
1119911199
dev_grp);
1120011200
return -ENODEV;

0 commit comments

Comments
 (0)