[SCSI] libsas: fix bug for vacant phy
This patch fix bug reported by Chuck. And this new version incorporate comments from Hannes. Please consider to include it into mainline. Signed-off-by: Jack Wang <jack_wang@usish.com> Signed-off-by: Lindar Liu <lindar_liu@usish.com> Tested-by: Chuck Tuffli <Chuck_Tuffli@pmc-sierra.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
This commit is contained in:
parent
526f7c7950
commit
2bc72c91ea
@ -175,10 +175,10 @@ static void sas_set_ex_phy(struct domain_device *dev, int phy_id,
|
|||||||
switch (resp->result) {
|
switch (resp->result) {
|
||||||
case SMP_RESP_PHY_VACANT:
|
case SMP_RESP_PHY_VACANT:
|
||||||
phy->phy_state = PHY_VACANT;
|
phy->phy_state = PHY_VACANT;
|
||||||
return;
|
break;
|
||||||
default:
|
default:
|
||||||
phy->phy_state = PHY_NOT_PRESENT;
|
phy->phy_state = PHY_NOT_PRESENT;
|
||||||
return;
|
break;
|
||||||
case SMP_RESP_FUNC_ACC:
|
case SMP_RESP_FUNC_ACC:
|
||||||
phy->phy_state = PHY_EMPTY; /* do not know yet */
|
phy->phy_state = PHY_EMPTY; /* do not know yet */
|
||||||
break;
|
break;
|
||||||
@ -209,7 +209,10 @@ static void sas_set_ex_phy(struct domain_device *dev, int phy_id,
|
|||||||
phy->phy->negotiated_linkrate = phy->linkrate;
|
phy->phy->negotiated_linkrate = phy->linkrate;
|
||||||
|
|
||||||
if (!rediscover)
|
if (!rediscover)
|
||||||
sas_phy_add(phy->phy);
|
if (sas_phy_add(phy->phy)) {
|
||||||
|
sas_phy_free(phy->phy);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
SAS_DPRINTK("ex %016llx phy%02d:%c attached: %016llx\n",
|
SAS_DPRINTK("ex %016llx phy%02d:%c attached: %016llx\n",
|
||||||
SAS_ADDR(dev->sas_addr), phy->phy_id,
|
SAS_ADDR(dev->sas_addr), phy->phy_id,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user