Thread (22 messages) 22 messages, 3 authors, 2021-12-14
STALE1669d LANDED
Revisions (2)
  1. v1 [diff vs current]
  2. v2 current

[PATCH v2 07/15] lpfc: Prevent duplicate requests to unregister with cpuhp framework

From: James Smart <hidden>
Date: 2021-01-04 18:04:14
Subsystem: emulex/broadcom lpfc fc/fcoe scsi driver, scsi subsystem, the rest · Maintainers: Justin Tee, Paul Ely, "James E.J. Bottomley", "Martin K. Petersen", Linus Torvalds

In the lpfc offline routine, called for various reasons such as sysfs
attribute, driver unload, or port error, the driver is calling
__lpfc_cpuhp_remove() to destroy the hot plug data. If the offline
routine is called while the driver is in the process of being unloaded,
a request using lpfc_cpuhp_remove() is also made from
lpfc_sli4_hba_unset(). The cpuhp elements are no longer valid when the
second removal request is made.

Fix by only calling the cpuhp removal once when the adapter is in the
process of unloading.

Co-developed-by: Dick Kennedy <redacted>
Signed-off-by: Dick Kennedy <redacted>
Signed-off-by: James Smart <redacted>
---
 drivers/scsi/lpfc/lpfc_init.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 593b175702eb..af926768bcae 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -3602,7 +3602,11 @@ lpfc_offline(struct lpfc_hba *phba)
 			spin_unlock_irq(shost->host_lock);
 		}
 	lpfc_destroy_vport_work_array(phba, vports);
-	__lpfc_cpuhp_remove(phba);
+	/* If OFFLINE flag is clear (i.e. unloading), cpuhp removal is handled
+	 * in hba_unset
+	 */
+	if (phba->pport->fc_flag & FC_OFFLINE_MODE)
+		__lpfc_cpuhp_remove(phba);
 
 	if (phba->cfg_xri_rebalancing)
 		lpfc_destroy_multixri_pools(phba);
-- 
2.26.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help