scsi: lpfc: Clear outstanding active mailbox during PCI function reset
authorJames Smart <jsmart2021@gmail.com>
Wed, 7 Jul 2021 18:43:43 +0000 (11:43 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 19 Jul 2021 02:30:36 +0000 (22:30 -0400)
commita9978e3978406ef5e35870b10e677cf75a2620b6
treeaa85428bc55e0302a10ef7662681059faba84a1c
parentaffbe24429410fddf4e50ca456c090ed6d8e05bf
scsi: lpfc: Clear outstanding active mailbox during PCI function reset

Mailbox commands sent via ioctl/bsg from user applications may be
interrupted from processing by a concurrently triggered PCI function
reset. The command will not generate a completion due to the reset.  This
results in a user application hang waiting for the mailbox command to
complete.

Resolve by changing the function reset handler to detect that there was an
outstanding mailbox command and simulate a mailbox completion.  Add some
additional debug when a mailbox command times out.

Link: https://lore.kernel.org/r/20210707184351.67872-13-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_init.c
drivers/scsi/lpfc/lpfc_sli.c