[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>
This commit is contained in:
parent
22b9153faa
commit
1699490db3
1 changed files with 12 additions and 5 deletions
|
@ -1718,9 +1718,17 @@ static int sas_find_bcast_phy(struct domain_device *dev, int *phy_id,
|
||||||
int phy_change_count = 0;
|
int phy_change_count = 0;
|
||||||
|
|
||||||
res = sas_get_phy_change_count(dev, i, &phy_change_count);
|
res = sas_get_phy_change_count(dev, i, &phy_change_count);
|
||||||
if (res)
|
switch (res) {
|
||||||
goto out;
|
case SMP_RESP_PHY_VACANT:
|
||||||
else if (phy_change_count != ex->ex_phy[i].phy_change_count) {
|
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)
|
if (update)
|
||||||
ex->ex_phy[i].phy_change_count =
|
ex->ex_phy[i].phy_change_count =
|
||||||
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;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
out:
|
return 0;
|
||||||
return res;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int sas_get_ex_change_count(struct domain_device *dev, int *ecc)
|
static int sas_get_ex_change_count(struct domain_device *dev, int *ecc)
|
||||||
|
|
Loading…
Add table
Reference in a new issue