linux_dsm_epyc7002/drivers/scsi/lpfc
James Smart 7b08e89f98 scsi: lpfc: Fix FLOGI/PLOGI receive race condition in pt2pt discovery
The driver is unable to successfully login with remote device. During pt2pt
login, the driver completes its FLOGI request with the remote device having
WWN precedence.  The remote device issues its own (delayed) FLOGI after
accepting the driver's and, upon transmitting the FLOGI, immediately
recognizes it has already processed the driver's FLOGI thus it transitions
to sending a PLOGI before waiting for an ACC to its FLOGI.

In the driver, the FLOGI is received and an ACC sent, followed by the PLOGI
being received and an ACC sent. The issue is that the PLOGI reception
occurs before the response from the adapter from the FLOGI ACC is
received. Processing of the PLOGI sets state flags to perform the REG_RPI
mailbox command and proceed with the rest of discovery on the port. The
same completion routine used by both FLOGI and PLOGI is generic in
nature. One of the things it does is clear flags, and those flags happen to
drive the rest of discovery.  So what happened was the PLOGI processing set
the flags, the FLOGI ACC completion cleared them, thus when the PLOGI ACC
completes it doesn't see the flags and stops.

Fix by modifying the generic completion routine to not clear the rest of
discovery flag (NLP_ACC_REGLOGIN) unless the completion is also associated
with performing a mailbox command as part of its handling.  For things such
as FLOGI ACC, there isn't a subsequent action to perform with the adapter,
thus there is no mailbox cmd ptr. PLOGI ACC though will perform REG_RPI
upon completion, thus there is a mailbox cmd ptr.

Link: https://lore.kernel.org/r/20200828175332.130300-3-james.smart@broadcom.com
Co-developed-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-08-31 21:51:26 -04:00
..
lpfc_attr.c scsi: lpfc: Fix no message shown for lpfc_hdw_queue out of range value 2020-08-04 20:56:57 -04:00
lpfc_attr.h scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00
lpfc_bsg.c scsi: lpfc: Fix validation of bsg reply lengths 2020-08-04 20:56:57 -04:00
lpfc_bsg.h scsi: lpfc: Allow applications to issue Common Set Features mailbox command 2020-07-02 23:06:40 -04:00
lpfc_compat.h scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00
lpfc_crtn.h scsi: lpfc: Add an internal trace log buffer 2020-07-02 23:06:49 -04:00
lpfc_ct.c scsi: lpfc: Fix RSCN timeout due to incorrect gidft counter 2020-08-04 20:56:57 -04:00
lpfc_debugfs.c SCSI misc on 20200605 2020-06-05 15:11:50 -07:00
lpfc_debugfs.h scsi: lpfc: Make debugfs ktime stats generic for NVME and SCSI 2020-03-29 18:10:58 -04:00
lpfc_disc.h scsi: lpfc: Add NVMe sequence level error recovery support 2019-08-19 22:41:12 -04:00
lpfc_els.c scsi: lpfc: Fix FLOGI/PLOGI receive race condition in pt2pt discovery 2020-08-31 21:51:26 -04:00
lpfc_hbadisc.c scsi: lpfc: Fix kerneldoc parameter formatting/misnaming/missing issues 2020-07-24 22:31:54 -04:00
lpfc_hw4.h scsi: lpfc: Add support to display if adapter dumps are available 2020-07-02 23:06:41 -04:00
lpfc_hw.h scsi: lpfc: Remove prototype FIPS/DSS options from SLI-3 2020-03-29 18:10:58 -04:00
lpfc_ids.h scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00
lpfc_init.c scsi: lpfc: Fix setting IRQ affinity with an empty CPU mask 2020-08-31 21:51:26 -04:00
lpfc_logmsg.h scsi: lpfc: Add an internal trace log buffer 2020-07-02 23:06:49 -04:00
lpfc_mbox.c scsi: lpfc: Fix a bunch of kerneldoc misdemeanors 2020-07-24 22:32:03 -04:00
lpfc_mem.c scsi: lpfc: Provide description for lpfc_mem_alloc()'s 'align' param 2020-07-24 22:10:01 -04:00
lpfc_nl.h scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00
lpfc_nportdisc.c scsi: lpfc: Fix LUN loss after cable pull 2020-08-04 20:56:57 -04:00
lpfc_nvme.c scsi: lpfc: Correct some pretty obvious misdocumentation 2020-07-15 17:28:24 -04:00
lpfc_nvme.h lpfc: nvmet: Add support for NVME LS request hosthandle 2020-05-09 16:18:34 -06:00
lpfc_nvmet.c scsi: lpfc: nvmet: Avoid hang / use-after-free again when destroying targetport 2020-08-04 20:56:56 -04:00
lpfc_scsi.c scsi: lpfc: Add an internal trace log buffer 2020-07-02 23:06:49 -04:00
lpfc_scsi.h scsi: lpfc: Update 12.2.0.0 file copyrights to 2019 2019-02-05 22:29:50 -05:00
lpfc_sli4.h scsi: lpfc: Add blk_io_poll support for latency improvment 2020-07-02 23:06:42 -04:00
lpfc_sli.c scsi: lpfc: Fix oops when unloading driver while running mds diags 2020-08-04 20:56:57 -04:00
lpfc_sli.h scsi: lpfc: Make debugfs ktime stats generic for NVME and SCSI 2020-03-29 18:10:58 -04:00
lpfc_version.h scsi: lpfc: Update lpfc version to 12.8.0.3 2020-08-04 20:56:57 -04:00
lpfc_vport.c scsi: lpfc: Add an internal trace log buffer 2020-07-02 23:06:49 -04:00
lpfc_vport.h scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00
lpfc.h scsi: lpfc: Add an internal trace log buffer 2020-07-02 23:06:49 -04:00
Makefile scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00