diff options
author | Thomas Jackson <thomas.p.jackson@intel.com> | 2012-02-17 18:33:10 -0800 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2012-03-16 08:53:52 -0700 |
commit | 307b443bd7c4d33d43dfbf271b9d4b46e4b99698 (patch) | |
tree | 9ed027b10785f6fa8259884766d2e67e8321d090 | |
parent | bdf395f4384283979292a27323177f4e4fdeeeff (diff) | |
download | isci-307b443bd7c4d33d43dfbf271b9d4b46e4b99698.tar.gz |
libsas: fix sas_find_bcast_phy() in the presence of 'vacant' phys
If an expander reports 'PHY VACANT' for a phy index prior to the one
that generated a BCN libsas fails rediscovery. Since a vacant phy is
defined as a valid phy index that will never have an attached device
just continue the search.
Cc: <stable@vger.kernel.org>
Signed-off-by: Thomas Jackson <thomas.p.jackson@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
-rw-r--r-- | drivers/scsi/libsas/sas_expander.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c index 0ab379627e7f2d..cacf3feb3f7bfc 100644 --- a/drivers/scsi/libsas/sas_expander.c +++ b/drivers/scsi/libsas/sas_expander.c @@ -1718,9 +1718,17 @@ static int sas_find_bcast_phy(struct domain_device *dev, int *phy_id, int phy_change_count = 0; res = sas_get_phy_change_count(dev, i, &phy_change_count); - if (res) - goto out; - else if (phy_change_count != ex->ex_phy[i].phy_change_count) { + switch (res) { + case SMP_RESP_PHY_VACANT: + case SMP_RESP_NO_PHY: + continue; + case SMP_RESP_FUNC_ACC: + break; + default: + return res; + } + + if (phy_change_count != ex->ex_phy[i].phy_change_count) { if (update) ex->ex_phy[i].phy_change_count = phy_change_count; @@ -1728,8 +1736,7 @@ static int sas_find_bcast_phy(struct domain_device *dev, int *phy_id, return 0; } } -out: - return res; + return 0; } static int sas_get_ex_change_count(struct domain_device *dev, int *ecc) |