aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libsas/sas_expander.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-10-22 20:34:15 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-22 20:34:15 -0400
commitc70b5296e775cde46cfcb2d860ba160108a5ec7a (patch)
tree30419cb982acca44499236adcca65f2f87698c74 /drivers/scsi/libsas/sas_expander.c
parent80c226fbef56576946c9655fcb2ab62e63404d12 (diff)
parent58ff4bd042adf8013c8f70fd03c2c0f8d022e387 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (84 commits) [SCSI] be2iscsi: SGE Len == 64K [SCSI] be2iscsi: Remove premature free of cid [SCSI] be2iscsi: More time for FW [SCSI] libsas: fix bug for vacant phy [SCSI] sd: Fix overflow with big physical blocks [SCSI] st: add MTWEOFI to write filemarks without flushing drive buffer [SCSI] libsas: Don't issue commands to devices that have been hot-removed [SCSI] megaraid_sas: Add Online Controller Reset to MegaRAID SAS drive [SCSI] lpfc 8.3.17: Update lpfc driver version to 8.3.17 [SCSI] lpfc 8.3.17: Replace function reset methodology [SCSI] lpfc 8.3.17: SCSI fixes [SCSI] lpfc 8.3.17: BSG fixes [SCSI] lpfc 8.3.17: SLI Additions and Fixes [SCSI] lpfc 8.3.17: Code Cleanup and Locking fixes [SCSI] zfcp: Remove scsi_cmnd->serial_number from debug traces [SCSI] ipr: fix array error logging [SCSI] aha152x: enable PCMCIA on 64bit [SCSI] scsi_dh_alua: Handle all states correctly [SCSI] cxgb4i: connection and ddp setting update [SCSI] cxgb3i: fixed connection over vlan ...
Diffstat (limited to 'drivers/scsi/libsas/sas_expander.c')
-rw-r--r--drivers/scsi/libsas/sas_expander.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c
index 83dd5070a15c..505ffe358293 100644
--- a/drivers/scsi/libsas/sas_expander.c
+++ b/drivers/scsi/libsas/sas_expander.c
@@ -175,10 +175,10 @@ static void sas_set_ex_phy(struct domain_device *dev, int phy_id,
175 switch (resp->result) { 175 switch (resp->result) {
176 case SMP_RESP_PHY_VACANT: 176 case SMP_RESP_PHY_VACANT:
177 phy->phy_state = PHY_VACANT; 177 phy->phy_state = PHY_VACANT;
178 return; 178 break;
179 default: 179 default:
180 phy->phy_state = PHY_NOT_PRESENT; 180 phy->phy_state = PHY_NOT_PRESENT;
181 return; 181 break;
182 case SMP_RESP_FUNC_ACC: 182 case SMP_RESP_FUNC_ACC:
183 phy->phy_state = PHY_EMPTY; /* do not know yet */ 183 phy->phy_state = PHY_EMPTY; /* do not know yet */
184 break; 184 break;
@@ -209,7 +209,10 @@ static void sas_set_ex_phy(struct domain_device *dev, int phy_id,
209 phy->phy->negotiated_linkrate = phy->linkrate; 209 phy->phy->negotiated_linkrate = phy->linkrate;
210 210
211 if (!rediscover) 211 if (!rediscover)
212 sas_phy_add(phy->phy); 212 if (sas_phy_add(phy->phy)) {
213 sas_phy_free(phy->phy);
214 return;
215 }
213 216
214 SAS_DPRINTK("ex %016llx phy%02d:%c attached: %016llx\n", 217 SAS_DPRINTK("ex %016llx phy%02d:%c attached: %016llx\n",
215 SAS_ADDR(dev->sas_addr), phy->phy_id, 218 SAS_ADDR(dev->sas_addr), phy->phy_id,
@@ -1724,6 +1727,7 @@ static void sas_unregister_ex_tree(struct domain_device *dev)
1724 struct domain_device *child, *n; 1727 struct domain_device *child, *n;
1725 1728
1726 list_for_each_entry_safe(child, n, &ex->children, siblings) { 1729 list_for_each_entry_safe(child, n, &ex->children, siblings) {
1730 child->gone = 1;
1727 if (child->dev_type == EDGE_DEV || 1731 if (child->dev_type == EDGE_DEV ||
1728 child->dev_type == FANOUT_DEV) 1732 child->dev_type == FANOUT_DEV)
1729 sas_unregister_ex_tree(child); 1733 sas_unregister_ex_tree(child);
@@ -1744,6 +1748,7 @@ static void sas_unregister_devs_sas_addr(struct domain_device *parent,
1744 &ex_dev->children, siblings) { 1748 &ex_dev->children, siblings) {
1745 if (SAS_ADDR(child->sas_addr) == 1749 if (SAS_ADDR(child->sas_addr) ==
1746 SAS_ADDR(phy->attached_sas_addr)) { 1750 SAS_ADDR(phy->attached_sas_addr)) {
1751 child->gone = 1;
1747 if (child->dev_type == EDGE_DEV || 1752 if (child->dev_type == EDGE_DEV ||
1748 child->dev_type == FANOUT_DEV) 1753 child->dev_type == FANOUT_DEV)
1749 sas_unregister_ex_tree(child); 1754 sas_unregister_ex_tree(child);
@@ -1752,6 +1757,7 @@ static void sas_unregister_devs_sas_addr(struct domain_device *parent,
1752 break; 1757 break;
1753 } 1758 }
1754 } 1759 }
1760 parent->gone = 1;
1755 sas_disable_routing(parent, phy->attached_sas_addr); 1761 sas_disable_routing(parent, phy->attached_sas_addr);
1756 } 1762 }
1757 memset(phy->attached_sas_addr, 0, SAS_ADDR_SIZE); 1763 memset(phy->attached_sas_addr, 0, SAS_ADDR_SIZE);