]> git.baikalelectronics.ru Git - kernel.git/commit
[SCSI] libsas: fix sas_find_local_phy(), take phy references
authorDan Williams <dan.j.williams@intel.com>
Thu, 22 Dec 2011 05:33:17 +0000 (21:33 -0800)
committerJames Bottomley <JBottomley@Parallels.com>
Wed, 29 Feb 2012 19:01:06 +0000 (13:01 -0600)
commit9e05e9c475078ecf31bcb5850a7054c0db365131
tree5a53adb90ebf31888184a9bff16ccc1869e2e4b3
parent39caa44267baceff1aac32baa4428b2cfeea4502
[SCSI] libsas: fix sas_find_local_phy(), take phy references

In the direct-attached case this routine returns the phy on which this
device was first discovered.  Which is broken if we want to support
wide-targets, as this phy reference can become stale even though the
port is still active.

In the expander-attached case this routine tries to lookup the phy by
scanning the attached sas addresses of the parent expander, and BUG_ONs
if it can't find it.  However since eh and the libsas workqueue run
independently we can still be attempting device recovery via eh after
libsas has recorded the device as detached.  This is even easier to hit
now that eh is blocked while device domain rediscovery takes place, and
that libata is fed more timed out commands increasing the chances that
it will try to recover the ata device.

Arrange for dev->phy to always point to a last known good phy, it may be
stale after the port is torn down, but it will catch up for wide port
reconfigurations, and never be NULL.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 files changed:
drivers/scsi/aic94xx/aic94xx_tmf.c
drivers/scsi/isci/task.c
drivers/scsi/libsas/sas_ata.c
drivers/scsi/libsas/sas_discover.c
drivers/scsi/libsas/sas_expander.c
drivers/scsi/libsas/sas_internal.h
drivers/scsi/libsas/sas_port.c
drivers/scsi/libsas/sas_scsi_host.c
drivers/scsi/mvsas/mv_sas.c
drivers/scsi/pm8001/pm8001_sas.c
drivers/scsi/scsi_transport_sas.c
include/scsi/libsas.h
include/scsi/scsi_transport_sas.h