]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
scsi: lpfc: Restart eratt_poll timer if HBA_SETUP flag still unset
authorJustin Tee <justin.tee@broadcom.com>
Fri, 25 Apr 2025 19:48:01 +0000 (12:48 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 29 Apr 2025 01:38:14 +0000 (21:38 -0400)
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>
Link: https://lore.kernel.org/r/20250425194806.3585-4-justintee8345@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_sli.c

index 6574f9e744766d49e245bd648667cc3ffc45289e..90842a9b2ea3564d592649bef9e29d70258247c7 100644 (file)
@@ -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;
 }