libsas: fix bug for vacant phy
PATCH v3 1/1 libsas: fix bug for vacant phy
Hi, James
This patch fix bug reported by Chuck. And this new version incorporate comments from Hannes. Please consider to include it into mainline.
Jack.
From: Jack Wang <[email protected]>
Date: Wed, 15 Sep 2010 16:43:03 +0800
Subject: [PATCH] fix bug for vacant phy
Signed-off-by Jack Wang <[email protected]>
Signed-off-by Lindar Liu <[email protected]>
Tested-by Chuck Tuffli <[email protected]>
--- sas_expander.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-)
sas_expander.c +6 -3
@@ -175,10 +175,10 @@ static void sas_set_ex_phy(struct domain_device *dev, int phy_id,switch (resp->result) {case SMP_RESP_PHY_VACANT : phy->phy_state =PHY_VACANT ; -return ; +break ;default : phy->phy_state =PHY_NOT_PRESENT ; -return ; +break ;case SMP_RESP_FUNC_ACC : phy->phy_state =PHY_EMPTY ;/* do not know yet */ break ;
@@ -209,7 +209,10 @@ static void sas_set_ex_phy(struct domain_device *dev, int phy_id, phy->phy->negotiated_linkrate = phy->linkrate;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_ADDR(dev->sas_addr), phy->phy_id,
Signature · 1 line
1.7.2.3.msysgit.0
Quoted 1 line
From
57f6f219f378624628d2c31090de934ad5a772ebMon Sep 17 00:00:00 2001
From: Jack Wang <[email protected]>
Date: Wed, 15 Sep 2010 16:43:03 +0800
Subject: [PATCH] fix bug for vacant phy
Signed-off-by Jack Wang <[email protected]>
Signed-off-by Lindar Liu <[email protected]>
Tested-by Chuck Tuffli <[email protected]>
--- sas_expander.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-)
sas_expander.c +6 -3
@@ -175,10 +175,10 @@ static void sas_set_ex_phy(struct domain_device *dev, int phy_id,switch (resp->result) {case SMP_RESP_PHY_VACANT : phy->phy_state =PHY_VACANT ; -return ; +break ;default : phy->phy_state =PHY_NOT_PRESENT ; -return ; +break ;case SMP_RESP_FUNC_ACC : phy->phy_state =PHY_EMPTY ;/* do not know yet */ break ;
@@ -209,7 +209,10 @@ static void sas_set_ex_phy(struct domain_device *dev, int phy_id, phy->phy->negotiated_linkrate = phy->linkrate;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_ADDR(dev->sas_addr), phy->phy_id,
Signature · 1 line
1.7.2.3.msysgit.0