linux/drivers/scsi/lpfc
James Smart e9b1108316 scsi: lpfc: Fix refcounting around SCSI and NVMe transport APIs
Due to bug history and code review, the node reference counting approach in
the driver isn't implemented consistently with how the scsi and nvme
transport perform registrations and unregistrations and their callbacks.
This resulted in many bad/stale node pointers.

Reword the driver so that reference handling is performed as follows:

 - The initial node reference is taken on structure allocation

 - Take a reference on any add/register call to the transport

 - Remove a reference on any delete/unregister call to the transport

 - After the node has fully removed from both the SCSI and NVMEe transports
   (dev_loss_callbacks have called back) call the discovery engine
   DEVICE_RM event which will remove the final reference and release the
   node structure.

 - Alter dev_loss handling when a vport or base port is unloading.

 - Remove the put_node handling - no longer needed.

 - Rewrite the vport_delete handling on reference counts.  Part of this
   effort was driven from the FDISC not registering with the transport and
   disrupting the model for node reference counting.

 - Deleted lpfc_nlp_remove.  Pushed it's remaining ops into
   lpfc_nlp_release.

 - Several other small code cleanups.

Link: https://lore.kernel.org/r/20201115192646.12977-5-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-11-17 00:43:54 -05:00
..
lpfc_attr.c scsi: lpfc: Rework remote port ref counting and node freeing 2020-11-17 00:43:54 -05: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: Rework locations of ndlp reference taking 2020-11-17 00:43:54 -05: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: Rework remote port ref counting and node freeing 2020-11-17 00:43:54 -05:00
lpfc_ct.c scsi: lpfc: Rework locations of ndlp reference taking 2020-11-17 00:43:54 -05:00
lpfc_debugfs.c scsi: lpfc: Rework remote port ref counting and node freeing 2020-11-17 00:43:54 -05: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: Fix refcounting around SCSI and NVMe transport APIs 2020-11-17 00:43:54 -05:00
lpfc_els.c scsi: lpfc: Fix refcounting around SCSI and NVMe transport APIs 2020-11-17 00:43:54 -05:00
lpfc_hbadisc.c scsi: lpfc: Fix removal of SCSI transport device get and put on dev structure 2020-11-17 00:43:54 -05:00
lpfc_hw4.h scsi: lpfc: Add FDMI Vendor MIB support 2020-10-26 21:42:39 -04:00
lpfc_hw.h scsi: lpfc: Reject CT request for MIB commands 2020-10-26 21:42:39 -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 refcounting around SCSI and NVMe transport APIs 2020-11-17 00:43:54 -05: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: Re-fix use after free in lpfc_rq_buf_free() 2020-10-26 21:42:38 -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: Rework locations of ndlp reference taking 2020-11-17 00:43:54 -05:00
lpfc_nvme.c scsi: lpfc: Fix refcounting around SCSI and NVMe transport APIs 2020-11-17 00:43:54 -05:00
lpfc_nvme.h scsi: lpfc: Fix refcounting around SCSI and NVMe transport APIs 2020-11-17 00:43:54 -05:00
lpfc_nvmet.c scsi: lpfc: Rework remote port ref counting and node freeing 2020-11-17 00:43:54 -05:00
lpfc_scsi.c scsi: lpfc: Rework remote port ref counting and node freeing 2020-11-17 00:43:54 -05: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 FDMI Vendor MIB support 2020-10-26 21:42:39 -04:00
lpfc_sli.c scsi: lpfc: Fix refcounting around SCSI and NVMe transport APIs 2020-11-17 00:43:54 -05: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.5 2020-10-26 21:42:39 -04:00
lpfc_vport.c scsi: lpfc: Fix refcounting around SCSI and NVMe transport APIs 2020-11-17 00:43:54 -05: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 FDMI Vendor MIB support 2020-10-26 21:42:39 -04:00
Makefile scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00