scsi: lpfc: Call discovery state machine when handling PLOGI/ADISC completions
authorJames Smart <jsmart2021@gmail.com>
Wed, 7 Jul 2021 18:43:47 +0000 (11:43 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 19 Jul 2021 02:30:37 +0000 (22:30 -0400)
commitc65436b21c3abbdaacd9c9f68bf2fa94e103168d
tree05a1b8705d2e2fcf1e26d563a0939eddf5339f9d
parent0614568361b0c1827f999b1fff21223a496c740b
scsi: lpfc: Call discovery state machine when handling PLOGI/ADISC completions

In the PLOGI and ADISC completion handling, the device removal event could
be skipped during some link errors. This could leave a stale node in UNUSED
state.  Driver unload would hang for a long time waiting for this node to
be freed.

Resolve by taking the following steps:

 - Always post ADISC completion events to discovery state machine upon
   ADISC completion.

 - In case of a completion error for PLOGI/ADISC, ensure that init refcount
   is dropped if not registered with transport.

Link: https://lore.kernel.org/r/20210707184351.67872-17-jsmart2021@gmail.com
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>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_els.c