linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Justin Tee <justintee8345@gmail.com>
To: linux-scsi@vger.kernel.org
Cc: jsmart2021@gmail.com, justin.tee@broadcom.com,
	Justin Tee <justintee8345@gmail.com>
Subject: [PATCH 3/8] lpfc: Restart eratt_poll timer if HBA_SETUP flag still unset
Date: Fri, 25 Apr 2025 12:48:01 -0700	[thread overview]
Message-ID: <20250425194806.3585-4-justintee8345@gmail.com> (raw)
In-Reply-To: <20250425194806.3585-1-justintee8345@gmail.com>

Reschedule the eratt_poll timer if the HBA_SETUP flag isn’t set yet.  The
eratt_poll timer should only be cancelled if FC_UNLOADING flag is set or if
lpfc_stop_hba_timers is called as part of error, reset, or offline
handling.

Signed-off-by: Justin Tee <justin.tee@broadcom.com>
---
 drivers/scsi/lpfc/lpfc_sli.c | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index a335d34070d3..b582728d9e48 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -3926,12 +3926,19 @@ void lpfc_poll_eratt(struct timer_list *t)
 	uint64_t sli_intr, cnt;
 
 	phba = from_timer(phba, t, eratt_poll);
-	if (!test_bit(HBA_SETUP, &phba->hba_flag))
-		return;
 
 	if (test_bit(FC_UNLOADING, &phba->pport->load_flag))
 		return;
 
+	if (phba->sli_rev == LPFC_SLI_REV4 &&
+	    !test_bit(HBA_SETUP, &phba->hba_flag)) {
+		lpfc_printf_log(phba, KERN_INFO, LOG_SLI,
+				"0663 HBA still initializing 0x%lx, restart "
+				"timer\n",
+				phba->hba_flag);
+		goto restart_timer;
+	}
+
 	/* Here we will also keep track of interrupts per sec of the hba */
 	sli_intr = phba->sli.slistat.sli_intr;
 
@@ -3950,13 +3957,16 @@ void lpfc_poll_eratt(struct timer_list *t)
 	/* Check chip HA register for error event */
 	eratt = lpfc_sli_check_eratt(phba);
 
-	if (eratt)
+	if (eratt) {
 		/* Tell the worker thread there is work to do */
 		lpfc_worker_wake_up(phba);
-	else
-		/* Restart the timer for next eratt poll */
-		mod_timer(&phba->eratt_poll,
-			  jiffies + secs_to_jiffies(phba->eratt_poll_interval));
+		return;
+	}
+
+restart_timer:
+	/* Restart the timer for next eratt poll */
+	mod_timer(&phba->eratt_poll,
+		  jiffies + secs_to_jiffies(phba->eratt_poll_interval));
 	return;
 }
 
-- 
2.38.0


  parent reply	other threads:[~2025-04-25 19:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-25 19:47 [PATCH 0/8] Update lpfc to revision 14.4.0.9 Justin Tee
2025-04-25 19:47 ` [PATCH 1/8] lpfc: Fix lpfc_check_sli_ndlp handling for GEN_REQUEST64 commands Justin Tee
2025-04-25 19:48 ` [PATCH 2/8] lpfc: Notify fc transport of rport disappearance during PCI fcn reset Justin Tee
2025-04-25 19:48 ` Justin Tee [this message]
2025-04-25 19:48 ` [PATCH 4/8] lpfc: Prevent failure to reregister with NVME transport after PRLI retry Justin Tee
2025-04-25 19:48 ` [PATCH 5/8] lpfc: Avoid potential ndlp use-after-free in dev_loss_tmo_callbk Justin Tee
2025-04-25 19:48 ` [PATCH 6/8] lpfc: Create lpfc_vmid_info sysfs entry Justin Tee
2025-04-25 19:48 ` [PATCH 7/8] lpfc: Update lpfc version to 14.4.0.9 Justin Tee
2025-04-25 19:48 ` [PATCH 8/8] lpfc: Copyright updates for 14.4.0.9 patches Justin Tee
2025-04-29  1:39 ` [PATCH 0/8] Update lpfc to revision 14.4.0.9 Martin K. Petersen
2025-05-06  4:25 ` 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=20250425194806.3585-4-justintee8345@gmail.com \
    --to=justintee8345@gmail.com \
    --cc=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).