scsi: lpfc: Return early in lpfc_poll_eratt() when the driver is unloading
authorJustin Tee <justin.tee@broadcom.com>
Tue, 31 Oct 2023 19:12:20 +0000 (12:12 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 15 Nov 2023 14:52:58 +0000 (09:52 -0500)
Add a check in lpfc_poll_eratt() when the driver is unloading.  There is no
point to check for error attention events if the driver is rmmod'ed.

If the driver is reloaded, as part of insmod initialization, then a fresh
reset is always asserted to start clean and free of error attention events.

Signed-off-by: Justin Tee <justin.tee@broadcom.com>
Link: https://lore.kernel.org/r/20231031191224.150862-6-justintee8345@gmail.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_sli.c

index 9386e7b447506915110a8ba0299538bad1438ad0..2cb327efd57dc3900822b8ead7d26545b83ef27c 100644 (file)
@@ -3938,6 +3938,9 @@ void lpfc_poll_eratt(struct timer_list *t)
        if (!(phba->hba_flag & HBA_SETUP))
                return;
 
+       if (phba->pport->load_flag & FC_UNLOADING)
+               return;
+
        /* Here we will also keep track of interrupts per sec of the hba */
        sli_intr = phba->sli.slistat.sli_intr;