scsi: lpfc: Fix PLOGI failure with high remoteport count
authorJames Smart <jsmart2021@gmail.com>
Wed, 14 Aug 2019 23:56:32 +0000 (16:56 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 20 Aug 2019 02:41:08 +0000 (22:41 -0400)
commit4f1a2fef2af6b8c746bc965e5f87cd3cdaf5f1f8
tree9dab99bd35c08c0b1b3baac459ce701f45983f01
parent31f06d2e73726160645f8d9976a0b3f42e136da7
scsi: lpfc: Fix PLOGI failure with high remoteport count

When connected to a high number of remote ports, the driver is encountering
PLOGI errors.  The errors are due to adapter detected failures indicating
illegal field values.

Turns out the driver was prematurely clearing an RPI bitmask before waiting
for an UNREG_RPI mailbox completion. This allowed the RPI to be reused
before it was actually available.

Fix by clearing RPI bitmask only after UNREG_RPI mailbox completion.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_disc.h
drivers/scsi/lpfc/lpfc_hbadisc.c
drivers/scsi/lpfc/lpfc_sli.c