aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libsas
diff options
context:
space:
mode:
authorThomas Jackson <thomas.p.jackson@intel.com>2012-02-17 21:33:10 -0500
committerJames Bottomley <JBottomley@Parallels.com>2012-04-23 07:06:16 -0400
commit1699490db339e2c6b3037ea8e7dcd6b2755b688e (patch)
tree159907876c773a8d80cef4b3ca142e22f03b8d29 /drivers/scsi/libsas
parent22b9153faa2263aa89625de25e71c7d44c8dbd16 (diff)
[SCSI] 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> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/libsas')
-rw-r--r--drivers/scsi/libsas/sas_expander.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c
index 05acd9e35fc4..833bea067a77 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,
1718 int phy_change_count = 0; 1718 int phy_change_count = 0;
1719 1719
1720 res = sas_get_phy_change_count(dev, i, &phy_change_count); 1720 res = sas_get_phy_change_count(dev, i, &phy_change_count);
1721 if (res) 1721 switch (res) {
1722 goto out; 1722 case SMP_RESP_PHY_VACANT:
1723 else if (phy_change_count != ex->ex_phy[i].phy_change_count) { 1723 case SMP_RESP_NO_PHY:
1724 continue;
1725 case SMP_RESP_FUNC_ACC:
1726 break;
1727 default:
1728 return res;
1729 }
1730
1731 if (phy_change_count != ex->ex_phy[i].phy_change_count) {
1724 if (update) 1732 if (update)
1725 ex->ex_phy[i].phy_change_count = 1733 ex->ex_phy[i].phy_change_count =
1726 phy_change_count; 1734 phy_change_count;
@@ -1728,8 +1736,7 @@ static int sas_find_bcast_phy(struct domain_device *dev, int *phy_id,
1728 return 0; 1736 return 0;
1729 } 1737 }
1730 } 1738 }
1731out: 1739 return 0;
1732 return res;
1733} 1740}
1734 1741
1735static int sas_get_ex_change_count(struct domain_device *dev, int *ecc) 1742static int sas_get_ex_change_count(struct domain_device *dev, int *ecc)