Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Justin Tee <justin.tee@broadcom.com>
Link: https://lore.kernel.org/r/20230523183206.7728-6-justintee8345@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Justin Tee and committed by
Martin K. Petersen
b9951e1c 9914a3d0

+41 -41
+12 -12
drivers/scsi/lpfc/lpfc_init.c
··· 14747 14747 INIT_LIST_HEAD(&dma_buffer_list); 14748 14748 lpfc_decode_firmware_rev(phba, fwrev, 1); 14749 14749 if (strncmp(fwrev, image->revision, strnlen(image->revision, 16))) { 14750 - lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, 14751 - "3023 Updating Firmware, Current Version:%s " 14752 - "New Version:%s\n", 14753 - fwrev, image->revision); 14750 + lpfc_log_msg(phba, KERN_NOTICE, LOG_INIT | LOG_SLI, 14751 + "3023 Updating Firmware, Current Version:%s " 14752 + "New Version:%s\n", 14753 + fwrev, image->revision); 14754 14754 for (i = 0; i < LPFC_MBX_WR_CONFIG_MAX_BDE; i++) { 14755 14755 dmabuf = kzalloc(sizeof(struct lpfc_dmabuf), 14756 14756 GFP_KERNEL); ··· 14797 14797 } 14798 14798 rc = offset; 14799 14799 } else 14800 - lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, 14801 - "3029 Skipped Firmware update, Current " 14802 - "Version:%s New Version:%s\n", 14803 - fwrev, image->revision); 14800 + lpfc_log_msg(phba, KERN_NOTICE, LOG_INIT | LOG_SLI, 14801 + "3029 Skipped Firmware update, Current " 14802 + "Version:%s New Version:%s\n", 14803 + fwrev, image->revision); 14804 14804 14805 14805 release_out: 14806 14806 list_for_each_entry_safe(dmabuf, next, &dma_buffer_list, list) { ··· 14812 14812 release_firmware(fw); 14813 14813 out: 14814 14814 if (rc < 0) 14815 - lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, 14816 - "3062 Firmware update error, status %d.\n", rc); 14815 + lpfc_log_msg(phba, KERN_ERR, LOG_INIT | LOG_SLI, 14816 + "3062 Firmware update error, status %d.\n", rc); 14817 14817 else 14818 - lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, 14819 - "3024 Firmware update success: size %d.\n", rc); 14818 + lpfc_log_msg(phba, KERN_NOTICE, LOG_INIT | LOG_SLI, 14819 + "3024 Firmware update success: size %d.\n", rc); 14820 14820 } 14821 14821 14822 14822 /**
+2 -2
drivers/scsi/lpfc/lpfc_logmsg.h
··· 55 55 56 56 /* generate message by verbose log setting or severity */ 57 57 #define lpfc_vlog_msg(vport, level, mask, fmt, arg...) \ 58 - { if (((mask) & (vport)->cfg_log_verbose) || (level[1] <= '4')) \ 58 + { if (((mask) & (vport)->cfg_log_verbose) || (level[1] <= '5')) \ 59 59 dev_printk(level, &((vport)->phba->pcidev)->dev, "%d:(%d):" \ 60 60 fmt, (vport)->phba->brd_no, vport->vpi, ##arg); } 61 61 ··· 64 64 { uint32_t log_verbose = (phba)->pport ? \ 65 65 (phba)->pport->cfg_log_verbose : \ 66 66 (phba)->cfg_log_verbose; \ 67 - if (((mask) & log_verbose) || (level[1] <= '4')) \ 67 + if (((mask) & log_verbose) || (level[1] <= '5')) \ 68 68 dev_printk(level, &((phba)->pcidev)->dev, "%d:" \ 69 69 fmt, phba->brd_no, ##arg); \ 70 70 } \
+27 -27
drivers/scsi/lpfc/lpfc_sli.c
··· 20800 20800 if (shdr_add_status == LPFC_ADD_STATUS_INCOMPAT_OBJ) { 20801 20801 switch (shdr_add_status_2) { 20802 20802 case LPFC_ADD_STATUS_2_INCOMPAT_FLASH: 20803 - lpfc_printf_log(phba, KERN_WARNING, LOG_MBOX | LOG_SLI, 20804 - "4199 Firmware write failed: " 20805 - "image incompatible with flash x%02x\n", 20806 - phba->sli4_hba.flash_id); 20803 + lpfc_log_msg(phba, KERN_WARNING, LOG_MBOX | LOG_SLI, 20804 + "4199 Firmware write failed: " 20805 + "image incompatible with flash x%02x\n", 20806 + phba->sli4_hba.flash_id); 20807 20807 break; 20808 20808 case LPFC_ADD_STATUS_2_INCORRECT_ASIC: 20809 - lpfc_printf_log(phba, KERN_WARNING, LOG_MBOX | LOG_SLI, 20810 - "4200 Firmware write failed: " 20811 - "image incompatible with ASIC " 20812 - "architecture x%02x\n", 20813 - phba->sli4_hba.asic_rev); 20809 + lpfc_log_msg(phba, KERN_WARNING, LOG_MBOX | LOG_SLI, 20810 + "4200 Firmware write failed: " 20811 + "image incompatible with ASIC " 20812 + "architecture x%02x\n", 20813 + phba->sli4_hba.asic_rev); 20814 20814 break; 20815 20815 default: 20816 - lpfc_printf_log(phba, KERN_WARNING, LOG_MBOX | LOG_SLI, 20817 - "4210 Firmware write failed: " 20818 - "add_status_2 x%02x\n", 20819 - shdr_add_status_2); 20816 + lpfc_log_msg(phba, KERN_WARNING, LOG_MBOX | LOG_SLI, 20817 + "4210 Firmware write failed: " 20818 + "add_status_2 x%02x\n", 20819 + shdr_add_status_2); 20820 20820 break; 20821 20821 } 20822 20822 } else if (!shdr_status && !shdr_add_status) { ··· 20829 20829 20830 20830 switch (shdr_change_status) { 20831 20831 case (LPFC_CHANGE_STATUS_PHYS_DEV_RESET): 20832 - lpfc_printf_log(phba, KERN_INFO, LOG_MBOX | LOG_SLI, 20833 - "3198 Firmware write complete: System " 20834 - "reboot required to instantiate\n"); 20832 + lpfc_log_msg(phba, KERN_NOTICE, LOG_MBOX | LOG_SLI, 20833 + "3198 Firmware write complete: System " 20834 + "reboot required to instantiate\n"); 20835 20835 break; 20836 20836 case (LPFC_CHANGE_STATUS_FW_RESET): 20837 - lpfc_printf_log(phba, KERN_INFO, LOG_MBOX | LOG_SLI, 20838 - "3199 Firmware write complete: " 20839 - "Firmware reset required to " 20840 - "instantiate\n"); 20837 + lpfc_log_msg(phba, KERN_NOTICE, LOG_MBOX | LOG_SLI, 20838 + "3199 Firmware write complete: " 20839 + "Firmware reset required to " 20840 + "instantiate\n"); 20841 20841 break; 20842 20842 case (LPFC_CHANGE_STATUS_PORT_MIGRATION): 20843 - lpfc_printf_log(phba, KERN_INFO, LOG_MBOX | LOG_SLI, 20844 - "3200 Firmware write complete: Port " 20845 - "Migration or PCI Reset required to " 20846 - "instantiate\n"); 20843 + lpfc_log_msg(phba, KERN_NOTICE, LOG_MBOX | LOG_SLI, 20844 + "3200 Firmware write complete: Port " 20845 + "Migration or PCI Reset required to " 20846 + "instantiate\n"); 20847 20847 break; 20848 20848 case (LPFC_CHANGE_STATUS_PCI_RESET): 20849 - lpfc_printf_log(phba, KERN_INFO, LOG_MBOX | LOG_SLI, 20850 - "3201 Firmware write complete: PCI " 20851 - "Reset required to instantiate\n"); 20849 + lpfc_log_msg(phba, KERN_NOTICE, LOG_MBOX | LOG_SLI, 20850 + "3201 Firmware write complete: PCI " 20851 + "Reset required to instantiate\n"); 20852 20852 break; 20853 20853 default: 20854 20854 break;