All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Smart <jsmart2021@gmail.com>
To: linux-scsi@vger.kernel.org
Cc: James Smart <jsmart2021@gmail.com>, Justin Tee <justin.tee@broadcom.com>
Subject: [PATCH 2/8] lpfc: Wait for successful restart of SLI3 adapter during host sg_reset
Date: Wed, 20 Oct 2021 14:14:11 -0700	[thread overview]
Message-ID: <20211020211417.88754-3-jsmart2021@gmail.com> (raw)
In-Reply-To: <20211020211417.88754-1-jsmart2021@gmail.com>

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.

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>
---
 drivers/scsi/lpfc/lpfc_scsi.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index f35246024988..0dce4b51ca1e 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -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;
-- 
2.26.2


  parent reply	other threads:[~2021-10-20 21:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-20 21:14 [PATCH 0/8] lpfc: Update lpfc to revision 14.0.0.3 James Smart
2021-10-20 21:14 ` [PATCH 1/8] lpfc: Revert LOG_TRACE_EVENT back to LOG_INIT prior to driver_resource_setup James Smart
2021-10-20 21:14 ` James Smart [this message]
2021-10-20 21:14 ` [PATCH 3/8] lpfc: Correct sysfs reporting of loop support after SFP status change James Smart
2021-10-20 21:14 ` [PATCH 4/8] lpfc: Fix use-after-free in lpfc_unreg_rpi() routine James Smart
2021-10-20 21:14 ` [PATCH 5/8] lpfc: Allow PLOGI retry if previous PLOGI was aborted James Smart
2021-10-20 21:14 ` [PATCH 6/8] lpfc: Fix link down processing to address NULL pointer dereference James Smart
2021-10-20 21:14 ` [PATCH 7/8] lpfc: Allow fabric node recovery if recovery is in progress before devloss James Smart
2021-10-20 21:14 ` [PATCH 8/8] lpfc: Update lpfc version to 14.0.0.3 James Smart
2021-10-21  3:34 ` [PATCH 0/8] lpfc: Update lpfc to revision 14.0.0.3 Martin K. Petersen
2021-10-27  4:00 ` Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211020211417.88754-3-jsmart2021@gmail.com \
    --to=jsmart2021@gmail.com \
    --cc=justin.tee@broadcom.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.