]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
scsi: lpfc: Fix missing check for CSF in Write Object Mbox Rsp
authorJames Smart <jsmart2021@gmail.com>
Wed, 18 Dec 2019 23:58:01 +0000 (15:58 -0800)
committerSeth Forshee <seth.forshee@canonical.com>
Tue, 7 Apr 2020 15:40:13 +0000 (10:40 -0500)
BugLink: https://bugs.launchpad.net/bugs/1855303
When the WriteObject mailbox response has change_status set to is 0x2
(Firmware Reset) or 0x04 (Port Migration Reset), the CSF field should also
be checked to see if a fw reset is sufficient to enable all new features in
the updated firmware image. If not, a fw reset would start the new
firmware, but with a feature level equal to existing firmware.  To enable
the new features, a chip reset/pci slot reset would be required.

Check the CSF bit when change_status is 0x2 or 0x4 to know whether to
perform a pci bus reset or fw reset.

Link: https://lore.kernel.org/r/20191218235808.31922-4-jsmart2021@gmail.com
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit f3d0a8acc5a88435186d242376db05788a891516)
Signed-off-by: Vignesh Gunasekaran <vignesh.gunasekaran@broadcom.com>
Signed-off-by: Jeff Lane <jeffrey.lane@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
drivers/scsi/lpfc/lpfc_hw4.h
drivers/scsi/lpfc/lpfc_sli.c

index 25cdcbc2b02f1bab4fbad71d014b52823f5cf038..9a064b96e570359e65d201a1c2383b3d7663504b 100644 (file)
@@ -3925,6 +3925,9 @@ struct lpfc_mbx_wr_object {
 #define LPFC_CHANGE_STATUS_FW_RESET            0x02
 #define LPFC_CHANGE_STATUS_PORT_MIGRATION      0x04
 #define LPFC_CHANGE_STATUS_PCI_RESET           0x05
+#define lpfc_wr_object_csf_SHIFT               8
+#define lpfc_wr_object_csf_MASK                        0x00000001
+#define lpfc_wr_object_csf_WORD                        word5
                } response;
        } u;
 };
index c82b5792da98ce5ca09627ab984338d58189a824..12319f63cb45ef3d275edafb080768c4384b2819 100644 (file)
@@ -19449,7 +19449,7 @@ lpfc_wr_object(struct lpfc_hba *phba, struct list_head *dmabuf_list,
        struct lpfc_mbx_wr_object *wr_object;
        LPFC_MBOXQ_t *mbox;
        int rc = 0, i = 0;
-       uint32_t shdr_status, shdr_add_status, shdr_change_status;
+       uint32_t shdr_status, shdr_add_status, shdr_change_status, shdr_csf;
        uint32_t mbox_tmo;
        struct lpfc_dmabuf *dmabuf;
        uint32_t written = 0;
@@ -19506,6 +19506,16 @@ lpfc_wr_object(struct lpfc_hba *phba, struct list_head *dmabuf_list,
        if (check_change_status) {
                shdr_change_status = bf_get(lpfc_wr_object_change_status,
                                            &wr_object->u.response);
+
+               if (shdr_change_status == LPFC_CHANGE_STATUS_FW_RESET ||
+                   shdr_change_status == LPFC_CHANGE_STATUS_PORT_MIGRATION) {
+                       shdr_csf = bf_get(lpfc_wr_object_csf,
+                                         &wr_object->u.response);
+                       if (shdr_csf)
+                               shdr_change_status =
+                                                  LPFC_CHANGE_STATUS_PCI_RESET;
+               }
+
                switch (shdr_change_status) {
                case (LPFC_CHANGE_STATUS_PHYS_DEV_RESET):
                        lpfc_printf_log(phba, KERN_INFO, LOG_INIT,