scsi: lpfc: Wait for successful restart of SLI3 adapter during host sg_reset
authorJames Smart <jsmart2021@gmail.com>
Wed, 20 Oct 2021 21:14:11 +0000 (14:14 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 21 Oct 2021 03:33:45 +0000 (23:33 -0400)
A prior patch introduced HBA_NEEDS_CFG_PORT flag logic, but in
lpfc_sli_brdrestart_s3() code path, right after HBA_NEEDS_CFG_PORT is set,
the phba->hba_flag is cleared in lpfc_sli_brdreset().

Fix by calling lpfc_sli_chipset_init() to wait for successful restart of
the HBA in lpfc_host_reset_handler() after lpfc_sli_brdrestart().

lpfc_sli_chipset_init() sets the HBA_NEEDS_CFG_PORT flag so that the
lpfc_sli_hba_setup() routine from lpfc_online() will execute
lpfc_sli_config_port() initialization step when the brdrestart is
successful.

Link: https://lore.kernel.org/r/20211020211417.88754-3-jsmart2021@gmail.com
Fixes: d2f2547efd39 ("scsi: lpfc: Fix auto sli_mode and its effect on CONFIG_PORT for SLI3")
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>
drivers/scsi/lpfc/lpfc_scsi.c

index f1bd36b797ad76a881b8cb40637e66d01c63d51f..5578080afef8acd68248686f973fd0db1b7b548f 100644 (file)
@@ -6648,6 +6648,13 @@ lpfc_host_reset_handler(struct scsi_cmnd *cmnd)
        if (rc)
                goto error;
 
+       /* Wait for successful restart of adapter */
+       if (phba->sli_rev < LPFC_SLI_REV4) {
+               rc = lpfc_sli_chipset_init(phba);
+               if (rc)
+                       goto error;
+       }
+
        rc = lpfc_online(phba);
        if (rc)
                goto error;