Skip to content

Commit

Permalink
[SCSI] libsas: fix sas_find_bcast_phy() in the presence of 'vacant' phys
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Thomas Jackson authored and James Bottomley committed Apr 23, 2012
1 parent 22b9153 commit 1699490
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions drivers/scsi/libsas/sas_expander.c
Original file line number Diff line number Diff line change
Expand Up @@ -1718,18 +1718,25 @@ 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;
*phy_id = i;
return 0;
}
}
out:
return res;
return 0;
}

static int sas_get_ex_change_count(struct domain_device *dev, int *ecc)
Expand Down

0 comments on commit 1699490

Please sign in to comment.