linux_dsm_epyc7002/drivers/scsi/libsas
Dan Williams 87c8331fcf [SCSI] libsas: prevent domain rediscovery competing with ata error handling
libata error handling provides for a timeout for link recovery.  libsas
must not rescan for previously known devices in this interval otherwise
it may remove a device that is simply waiting for its link to recover.
Let libata-eh make the determination of when the link is stable and
prevent libsas (host workqueue) from taking action while this
determination is pending.

Using a mutex (ha->disco_mutex) to flush and disable revalidation while
eh is running requires any discovery action that may block on eh be
moved to its own context outside the lock.  Probing ATA devices
explicitly waits on ata-eh and the cache-flush-io issued during device
removal may also pend awaiting eh completion.  Essentially any rphy
add/remove activity needs to run outside the lock.

This adds two new cleanup states for sas_unregister_domain_devices()
'allocated-but-not-probed', and 'flagged-for-destruction'.  In the
'allocated-but-not-probed' state  dev->rphy points to a rphy that is
known to have not been through a sas_rphy_add() event.  At domain
teardown check if this device is still pending probe and cleanup
accordingly.  Similarly if a device has already been queued for removal
then sas_unregister_domain_devices has nothing to do.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-02-19 13:52:34 -06:00
..
Kconfig [SCSI] libsas: convert to standard kernel debugging 2011-01-24 12:05:38 -06:00
Makefile Merge branch 'trivial' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6 2011-03-20 18:14:55 -07:00
sas_ata.c [SCSI] libsas: prevent domain rediscovery competing with ata error handling 2012-02-19 13:52:34 -06:00
sas_discover.c [SCSI] libsas: prevent domain rediscovery competing with ata error handling 2012-02-19 13:52:34 -06:00
sas_dump.c [SCSI] libsas: convert to standard kernel debugging 2011-01-24 12:05:38 -06:00
sas_dump.h [SCSI] libsas: convert to standard kernel debugging 2011-01-24 12:05:38 -06:00
sas_event.c [SCSI] libsas: prevent domain rediscovery competing with ata error handling 2012-02-19 13:52:34 -06:00
sas_expander.c [SCSI] libsas: prevent domain rediscovery competing with ata error handling 2012-02-19 13:52:34 -06:00
sas_host_smp.c scsi: Add export.h for EXPORT_SYMBOL/THIS_MODULE as required 2011-10-31 19:31:23 -04:00
sas_init.c [SCSI] libsas: prevent domain rediscovery competing with ata error handling 2012-02-19 13:52:34 -06:00
sas_internal.h [SCSI] libsas: prevent domain rediscovery competing with ata error handling 2012-02-19 13:52:34 -06:00
sas_phy.c [SCSI] libsas: replace event locks with atomic bitops 2012-02-19 13:41:04 -06:00
sas_port.c [SCSI] libsas: prevent domain rediscovery competing with ata error handling 2012-02-19 13:52:34 -06:00
sas_scsi_host.c [SCSI] libsas: convert dev->gone to flags 2012-02-19 13:51:23 -06:00
sas_task.c scsi: Add export.h for EXPORT_SYMBOL/THIS_MODULE as required 2011-10-31 19:31:23 -04:00