diff options
author | Thomas Jackson <thomas.p.jackson@intel.com> | 2012-02-17 21:33:10 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-05-07 11:56:37 -0400 |
commit | 0c5f01a4e19099d740d85ea63e2605aa705cdd9e (patch) | |
tree | 1655569f97ff51ec39bf9703b175de3ac6b3092f | |
parent | 62a17c9c34a40907e250b5ac110a5c64325f0aef (diff) |
SCSI: libsas: fix sas_find_bcast_phy() in the presence of 'vacant' phys
commit 1699490db339e2c6b3037ea8e7dcd6b2755b688e upstream.
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.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-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 37cbe4d3bb9..3ca60875b3e 100644 --- a/drivers/scsi/libsas/sas_expander.c +++ b/drivers/scsi/libsas/sas_expander.c | |||
@@ -1632,9 +1632,17 @@ static int sas_find_bcast_phy(struct domain_device *dev, int *phy_id, | |||
1632 | int phy_change_count = 0; | 1632 | int phy_change_count = 0; |
1633 | 1633 | ||
1634 | res = sas_get_phy_change_count(dev, i, &phy_change_count); | 1634 | res = sas_get_phy_change_count(dev, i, &phy_change_count); |
1635 | if (res) | 1635 | switch (res) { |
1636 | goto out; | 1636 | case SMP_RESP_PHY_VACANT: |
1637 | else if (phy_change_count != ex->ex_phy[i].phy_change_count) { | 1637 | case SMP_RESP_NO_PHY: |
1638 | continue; | ||
1639 | case SMP_RESP_FUNC_ACC: | ||
1640 | break; | ||
1641 | default: | ||
1642 | return res; | ||
1643 | } | ||
1644 | |||
1645 | if (phy_change_count != ex->ex_phy[i].phy_change_count) { | ||
1638 | if (update) | 1646 | if (update) |
1639 | ex->ex_phy[i].phy_change_count = | 1647 | ex->ex_phy[i].phy_change_count = |
1640 | phy_change_count; | 1648 | phy_change_count; |
@@ -1642,8 +1650,7 @@ static int sas_find_bcast_phy(struct domain_device *dev, int *phy_id, | |||
1642 | return 0; | 1650 | return 0; |
1643 | } | 1651 | } |
1644 | } | 1652 | } |
1645 | out: | 1653 | return 0; |
1646 | return res; | ||
1647 | } | 1654 | } |
1648 | 1655 | ||
1649 | static int sas_get_ex_change_count(struct domain_device *dev, int *ecc) | 1656 | static int sas_get_ex_change_count(struct domain_device *dev, int *ecc) |