Commit b9951e1c authored by Justin Tee's avatar Justin Tee Committed by Martin K. Petersen
Browse files

scsi: lpfc: Change firmware upgrade logging to KERN_NOTICE instead of TRACE_EVENT



A firmware upgrade does not necessitate dumping of phba->dbg_log[] to kmsg
via LOG_TRACE_EVENT.  A simple KERN_NOTICE log message should suffice to
notify the user of successful or unsuccessful firmware upgrade.  As such,
firmware upgrade log messages are updated to use KERN_NOTICE instead of
LOG_TRACE_EVENT.  Additionally, in order to notify the user of reset type
for instantiating newly downloaded firmware, lpfc_log_msg's default
KERN_LEVEL is updated to 5 or KERN_NOTICE.

Signed-off-by: default avatarJustin Tee <justin.tee@broadcom.com>
Link: https://lore.kernel.org/r/20230523183206.7728-6-justintee8345@gmail.com


Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 9914a3d0
Loading
Loading
Loading
Loading
+12 −12
Original line number Diff line number Diff line
@@ -14747,7 +14747,7 @@ lpfc_write_firmware(const struct firmware *fw, void *context)
	INIT_LIST_HEAD(&dma_buffer_list);
	lpfc_decode_firmware_rev(phba, fwrev, 1);
	if (strncmp(fwrev, image->revision, strnlen(image->revision, 16))) {
		lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
		lpfc_log_msg(phba, KERN_NOTICE, LOG_INIT | LOG_SLI,
			     "3023 Updating Firmware, Current Version:%s "
			     "New Version:%s\n",
			     fwrev, image->revision);
@@ -14797,7 +14797,7 @@ lpfc_write_firmware(const struct firmware *fw, void *context)
		}
		rc = offset;
	} else
		lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
		lpfc_log_msg(phba, KERN_NOTICE, LOG_INIT | LOG_SLI,
			     "3029 Skipped Firmware update, Current "
			     "Version:%s New Version:%s\n",
			     fwrev, image->revision);
@@ -14812,10 +14812,10 @@ lpfc_write_firmware(const struct firmware *fw, void *context)
	release_firmware(fw);
out:
	if (rc < 0)
		lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
		lpfc_log_msg(phba, KERN_ERR, LOG_INIT | LOG_SLI,
			     "3062 Firmware update error, status %d.\n", rc);
	else
		lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
		lpfc_log_msg(phba, KERN_NOTICE, LOG_INIT | LOG_SLI,
			     "3024 Firmware update success: size %d.\n", rc);
}

+2 −2
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ void lpfc_dbg_print(struct lpfc_hba *phba, const char *fmt, ...);

/* generate message by verbose log setting or severity */
#define lpfc_vlog_msg(vport, level, mask, fmt, arg...) \
{ if (((mask) & (vport)->cfg_log_verbose) || (level[1] <= '4')) \
{ if (((mask) & (vport)->cfg_log_verbose) || (level[1] <= '5')) \
	dev_printk(level, &((vport)->phba->pcidev)->dev, "%d:(%d):" \
		   fmt, (vport)->phba->brd_no, vport->vpi, ##arg); }

@@ -64,7 +64,7 @@ do { \
	{ uint32_t log_verbose = (phba)->pport ? \
				 (phba)->pport->cfg_log_verbose : \
				 (phba)->cfg_log_verbose; \
	if (((mask) & log_verbose) || (level[1] <= '4')) \
	if (((mask) & log_verbose) || (level[1] <= '5')) \
		dev_printk(level, &((phba)->pcidev)->dev, "%d:" \
			   fmt, phba->brd_no, ##arg); \
	} \
+27 −27
Original line number Diff line number Diff line
@@ -20800,20 +20800,20 @@ lpfc_log_fw_write_cmpl(struct lpfc_hba *phba, u32 shdr_status,
	if (shdr_add_status == LPFC_ADD_STATUS_INCOMPAT_OBJ) {
		switch (shdr_add_status_2) {
		case LPFC_ADD_STATUS_2_INCOMPAT_FLASH:
			lpfc_printf_log(phba, KERN_WARNING, LOG_MBOX | LOG_SLI,
			lpfc_log_msg(phba, KERN_WARNING, LOG_MBOX | LOG_SLI,
				     "4199 Firmware write failed: "
				     "image incompatible with flash x%02x\n",
				     phba->sli4_hba.flash_id);
			break;
		case LPFC_ADD_STATUS_2_INCORRECT_ASIC:
			lpfc_printf_log(phba, KERN_WARNING, LOG_MBOX | LOG_SLI,
			lpfc_log_msg(phba, KERN_WARNING, LOG_MBOX | LOG_SLI,
				     "4200 Firmware write failed: "
				     "image incompatible with ASIC "
				     "architecture x%02x\n",
				     phba->sli4_hba.asic_rev);
			break;
		default:
			lpfc_printf_log(phba, KERN_WARNING, LOG_MBOX | LOG_SLI,
			lpfc_log_msg(phba, KERN_WARNING, LOG_MBOX | LOG_SLI,
				     "4210 Firmware write failed: "
				     "add_status_2 x%02x\n",
				     shdr_add_status_2);
@@ -20829,24 +20829,24 @@ lpfc_log_fw_write_cmpl(struct lpfc_hba *phba, u32 shdr_status,
		switch (shdr_change_status) {
		case (LPFC_CHANGE_STATUS_PHYS_DEV_RESET):
			lpfc_printf_log(phba, KERN_INFO, LOG_MBOX | LOG_SLI,
			lpfc_log_msg(phba, KERN_NOTICE, LOG_MBOX | LOG_SLI,
				     "3198 Firmware write complete: System "
				     "reboot required to instantiate\n");
			break;
		case (LPFC_CHANGE_STATUS_FW_RESET):
			lpfc_printf_log(phba, KERN_INFO, LOG_MBOX | LOG_SLI,
			lpfc_log_msg(phba, KERN_NOTICE, LOG_MBOX | LOG_SLI,
				     "3199 Firmware write complete: "
				     "Firmware reset required to "
				     "instantiate\n");
			break;
		case (LPFC_CHANGE_STATUS_PORT_MIGRATION):
			lpfc_printf_log(phba, KERN_INFO, LOG_MBOX | LOG_SLI,
			lpfc_log_msg(phba, KERN_NOTICE, LOG_MBOX | LOG_SLI,
				     "3200 Firmware write complete: Port "
				     "Migration or PCI Reset required to "
				     "instantiate\n");
			break;
		case (LPFC_CHANGE_STATUS_PCI_RESET):
			lpfc_printf_log(phba, KERN_INFO, LOG_MBOX | LOG_SLI,
			lpfc_log_msg(phba, KERN_NOTICE, LOG_MBOX | LOG_SLI,
				     "3201 Firmware write complete: PCI "
				     "Reset required to instantiate\n");
			break;