aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/libsas/sas_expander.c26
1 files changed, 4 insertions, 22 deletions
diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c
index 76ea83ddafa7..fd16a3debef4 100644
--- a/drivers/scsi/libsas/sas_expander.c
+++ b/drivers/scsi/libsas/sas_expander.c
@@ -1090,7 +1090,7 @@ static int sas_ex_discover_dev(struct domain_device *dev, int phy_id)
1090 SAS_ADDR(dev->sas_addr), 1090 SAS_ADDR(dev->sas_addr),
1091 phy_id); 1091 phy_id);
1092 sas_ex_disable_phy(dev, phy_id); 1092 sas_ex_disable_phy(dev, phy_id);
1093 break; 1093 return res;
1094 } else 1094 } else
1095 memcpy(dev->port->disc.fanout_sas_addr, 1095 memcpy(dev->port->disc.fanout_sas_addr,
1096 ex_phy->attached_sas_addr, SAS_ADDR_SIZE); 1096 ex_phy->attached_sas_addr, SAS_ADDR_SIZE);
@@ -1102,27 +1102,9 @@ static int sas_ex_discover_dev(struct domain_device *dev, int phy_id)
1102 break; 1102 break;
1103 } 1103 }
1104 1104
1105 if (child) { 1105 if (!child)
1106 int i; 1106 pr_notice("ex %016llx phy%02d failed to discover\n",
1107 1107 SAS_ADDR(dev->sas_addr), phy_id);
1108 for (i = 0; i < ex->num_phys; i++) {
1109 if (ex->ex_phy[i].phy_state == PHY_VACANT ||
1110 ex->ex_phy[i].phy_state == PHY_NOT_PRESENT)
1111 continue;
1112 /*
1113 * Due to races, the phy might not get added to the
1114 * wide port, so we add the phy to the wide port here.
1115 */
1116 if (SAS_ADDR(ex->ex_phy[i].attached_sas_addr) ==
1117 SAS_ADDR(child->sas_addr)) {
1118 ex->ex_phy[i].phy_state= PHY_DEVICE_DISCOVERED;
1119 if (sas_ex_join_wide_port(dev, i))
1120 pr_debug("Attaching ex phy%02d to wide port %016llx\n",
1121 i, SAS_ADDR(ex->ex_phy[i].attached_sas_addr));
1122 }
1123 }
1124 }
1125
1126 return res; 1108 return res;
1127} 1109}
1128 1110