linux_dsm_epyc7002/drivers/scsi/mpt3sas
Sreekanth Reddy d1cb5e495e mpt3sas: Refcount sas_device objects and fix unsafe list usage
sas_device objects can be referenced concurrently throughout the driver.
We need a way to make sure threads can't delete them out from under each
other. This patch adds the refcount and refactors the code to use it.

Additionally, we cannot iterate over the sas_device_list without holding
the lock or we risk corrupting random memory if items are added or
deleted as we iterate. This patch refactors _scsih_probe_sas() to use
the sas_device_list in a safe way.

This patch is ported from the following mpt2sas driver commit
d224fe0d60 ("mpt2sas: Refcount sas_device objects and fix unsafe list
usage").

Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2015-11-11 18:57:38 -05:00
..
mpi mpt3sas: MPI 2.5 Rev K (2.5.6) specifications 2015-08-27 11:08:28 -07:00
Kconfig mpt2sas, mpt3sas: Remove SCSI_MPTXSAS_LOGGING entry from Kconfig 2015-11-11 18:31:14 -05:00
Makefile mpt3sas: Move Gen3 HBA's device registration to a separate file 2015-11-11 18:20:02 -05:00
mpt3sas_base.c mpt3sas: Ported WarpDrive product SSS6200 support 2015-11-11 18:56:10 -05:00
mpt3sas_base.h mpt3sas: Refcount sas_device objects and fix unsafe list usage 2015-11-11 18:57:38 -05:00
mpt3sas_config.c mpt3sas: sysfs attribute to report Backup Rail Monitor Status 2015-11-11 18:56:21 -05:00
mpt3sas_ctl.c mpt3sas: sysfs attribute to report Backup Rail Monitor Status 2015-11-11 18:56:21 -05:00
mpt3sas_ctl.h mpt3sas: Ported WarpDrive product SSS6200 support 2015-11-11 18:56:10 -05:00
mpt3sas_debug.h mpt2sas, mpt3sas: Remove SCSI_MPTXSAS_LOGGING entry from Kconfig 2015-11-11 18:31:14 -05:00
mpt3sas_module.c mpt3sas: Define 'hba_mpi_version_belonged' IOC variable 2015-11-11 18:29:34 -05:00
mpt3sas_scsih.c mpt3sas: Refcount sas_device objects and fix unsafe list usage 2015-11-11 18:57:38 -05:00
mpt3sas_transport.c mpt3sas: Refcount sas_device objects and fix unsafe list usage 2015-11-11 18:57:38 -05:00
mpt3sas_trigger_diag.c mpt2sas, mpt3sas: Update attribution language to Avago 2015-01-13 16:27:27 +01:00
mpt3sas_trigger_diag.h mpt2sas, mpt3sas: Update attribution language to Avago 2015-01-13 16:27:27 +01:00