aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libsas/sas_expander.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/libsas/sas_expander.c')
-rw-r--r--drivers/scsi/libsas/sas_expander.c238
1 files changed, 112 insertions, 126 deletions
diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c
index 0d1f72752ca2..f21c93bbb35c 100644
--- a/drivers/scsi/libsas/sas_expander.c
+++ b/drivers/scsi/libsas/sas_expander.c
@@ -99,17 +99,17 @@ static int smp_execute_task_sg(struct domain_device *dev,
99 99
100 if (res) { 100 if (res) {
101 del_timer(&task->slow_task->timer); 101 del_timer(&task->slow_task->timer);
102 SAS_DPRINTK("executing SMP task failed:%d\n", res); 102 pr_notice("executing SMP task failed:%d\n", res);
103 break; 103 break;
104 } 104 }
105 105
106 wait_for_completion(&task->slow_task->completion); 106 wait_for_completion(&task->slow_task->completion);
107 res = -ECOMM; 107 res = -ECOMM;
108 if ((task->task_state_flags & SAS_TASK_STATE_ABORTED)) { 108 if ((task->task_state_flags & SAS_TASK_STATE_ABORTED)) {
109 SAS_DPRINTK("smp task timed out or aborted\n"); 109 pr_notice("smp task timed out or aborted\n");
110 i->dft->lldd_abort_task(task); 110 i->dft->lldd_abort_task(task);
111 if (!(task->task_state_flags & SAS_TASK_STATE_DONE)) { 111 if (!(task->task_state_flags & SAS_TASK_STATE_DONE)) {
112 SAS_DPRINTK("SMP task aborted and not done\n"); 112 pr_notice("SMP task aborted and not done\n");
113 break; 113 break;
114 } 114 }
115 } 115 }
@@ -134,11 +134,11 @@ static int smp_execute_task_sg(struct domain_device *dev,
134 task->task_status.stat == SAS_DEVICE_UNKNOWN) 134 task->task_status.stat == SAS_DEVICE_UNKNOWN)
135 break; 135 break;
136 else { 136 else {
137 SAS_DPRINTK("%s: task to dev %016llx response: 0x%x " 137 pr_notice("%s: task to dev %016llx response: 0x%x status 0x%x\n",
138 "status 0x%x\n", __func__, 138 __func__,
139 SAS_ADDR(dev->sas_addr), 139 SAS_ADDR(dev->sas_addr),
140 task->task_status.resp, 140 task->task_status.resp,
141 task->task_status.stat); 141 task->task_status.stat);
142 sas_free_task(task); 142 sas_free_task(task);
143 task = NULL; 143 task = NULL;
144 } 144 }
@@ -347,11 +347,11 @@ static void sas_set_ex_phy(struct domain_device *dev, int phy_id, void *rsp)
347 if (test_bit(SAS_HA_ATA_EH_ACTIVE, &ha->state)) 347 if (test_bit(SAS_HA_ATA_EH_ACTIVE, &ha->state))
348 set_bit(DISCE_REVALIDATE_DOMAIN, &dev->port->disc.pending); 348 set_bit(DISCE_REVALIDATE_DOMAIN, &dev->port->disc.pending);
349 349
350 SAS_DPRINTK("%sex %016llx phy%02d:%c:%X attached: %016llx (%s)\n", 350 pr_debug("%sex %016llx phy%02d:%c:%X attached: %016llx (%s)\n",
351 test_bit(SAS_HA_ATA_EH_ACTIVE, &ha->state) ? "ata: " : "", 351 test_bit(SAS_HA_ATA_EH_ACTIVE, &ha->state) ? "ata: " : "",
352 SAS_ADDR(dev->sas_addr), phy->phy_id, 352 SAS_ADDR(dev->sas_addr), phy->phy_id,
353 sas_route_char(dev, phy), phy->linkrate, 353 sas_route_char(dev, phy), phy->linkrate,
354 SAS_ADDR(phy->attached_sas_addr), type); 354 SAS_ADDR(phy->attached_sas_addr), type);
355} 355}
356 356
357/* check if we have an existing attached ata device on this expander phy */ 357/* check if we have an existing attached ata device on this expander phy */
@@ -393,7 +393,7 @@ static int sas_ex_phy_discover_helper(struct domain_device *dev, u8 *disc_req,
393 return res; 393 return res;
394 dr = &((struct smp_resp *)disc_resp)->disc; 394 dr = &((struct smp_resp *)disc_resp)->disc;
395 if (memcmp(dev->sas_addr, dr->attached_sas_addr, SAS_ADDR_SIZE) == 0) { 395 if (memcmp(dev->sas_addr, dr->attached_sas_addr, SAS_ADDR_SIZE) == 0) {
396 sas_printk("Found loopback topology, just ignore it!\n"); 396 pr_notice("Found loopback topology, just ignore it!\n");
397 return 0; 397 return 0;
398 } 398 }
399 sas_set_ex_phy(dev, single, disc_resp); 399 sas_set_ex_phy(dev, single, disc_resp);
@@ -500,12 +500,12 @@ static int sas_ex_general(struct domain_device *dev)
500 RG_RESP_SIZE); 500 RG_RESP_SIZE);
501 501
502 if (res) { 502 if (res) {
503 SAS_DPRINTK("RG to ex %016llx failed:0x%x\n", 503 pr_notice("RG to ex %016llx failed:0x%x\n",
504 SAS_ADDR(dev->sas_addr), res); 504 SAS_ADDR(dev->sas_addr), res);
505 goto out; 505 goto out;
506 } else if (rg_resp->result != SMP_RESP_FUNC_ACC) { 506 } else if (rg_resp->result != SMP_RESP_FUNC_ACC) {
507 SAS_DPRINTK("RG:ex %016llx returned SMP result:0x%x\n", 507 pr_debug("RG:ex %016llx returned SMP result:0x%x\n",
508 SAS_ADDR(dev->sas_addr), rg_resp->result); 508 SAS_ADDR(dev->sas_addr), rg_resp->result);
509 res = rg_resp->result; 509 res = rg_resp->result;
510 goto out; 510 goto out;
511 } 511 }
@@ -513,8 +513,8 @@ static int sas_ex_general(struct domain_device *dev)
513 ex_assign_report_general(dev, rg_resp); 513 ex_assign_report_general(dev, rg_resp);
514 514
515 if (dev->ex_dev.configuring) { 515 if (dev->ex_dev.configuring) {
516 SAS_DPRINTK("RG: ex %llx self-configuring...\n", 516 pr_debug("RG: ex %llx self-configuring...\n",
517 SAS_ADDR(dev->sas_addr)); 517 SAS_ADDR(dev->sas_addr));
518 schedule_timeout_interruptible(5*HZ); 518 schedule_timeout_interruptible(5*HZ);
519 } else 519 } else
520 break; 520 break;
@@ -568,12 +568,12 @@ static int sas_ex_manuf_info(struct domain_device *dev)
568 568
569 res = smp_execute_task(dev, mi_req, MI_REQ_SIZE, mi_resp,MI_RESP_SIZE); 569 res = smp_execute_task(dev, mi_req, MI_REQ_SIZE, mi_resp,MI_RESP_SIZE);
570 if (res) { 570 if (res) {
571 SAS_DPRINTK("MI: ex %016llx failed:0x%x\n", 571 pr_notice("MI: ex %016llx failed:0x%x\n",
572 SAS_ADDR(dev->sas_addr), res); 572 SAS_ADDR(dev->sas_addr), res);
573 goto out; 573 goto out;
574 } else if (mi_resp[2] != SMP_RESP_FUNC_ACC) { 574 } else if (mi_resp[2] != SMP_RESP_FUNC_ACC) {
575 SAS_DPRINTK("MI ex %016llx returned SMP result:0x%x\n", 575 pr_debug("MI ex %016llx returned SMP result:0x%x\n",
576 SAS_ADDR(dev->sas_addr), mi_resp[2]); 576 SAS_ADDR(dev->sas_addr), mi_resp[2]);
577 goto out; 577 goto out;
578 } 578 }
579 579
@@ -828,6 +828,7 @@ static struct domain_device *sas_ex_discover_end_dev(
828 rphy = sas_end_device_alloc(phy->port); 828 rphy = sas_end_device_alloc(phy->port);
829 if (!rphy) 829 if (!rphy)
830 goto out_free; 830 goto out_free;
831 rphy->identify.phy_identifier = phy_id;
831 832
832 child->rphy = rphy; 833 child->rphy = rphy;
833 get_device(&rphy->dev); 834 get_device(&rphy->dev);
@@ -836,10 +837,9 @@ static struct domain_device *sas_ex_discover_end_dev(
836 837
837 res = sas_discover_sata(child); 838 res = sas_discover_sata(child);
838 if (res) { 839 if (res) {
839 SAS_DPRINTK("sas_discover_sata() for device %16llx at " 840 pr_notice("sas_discover_sata() for device %16llx at %016llx:0x%x returned 0x%x\n",
840 "%016llx:0x%x returned 0x%x\n", 841 SAS_ADDR(child->sas_addr),
841 SAS_ADDR(child->sas_addr), 842 SAS_ADDR(parent->sas_addr), phy_id, res);
842 SAS_ADDR(parent->sas_addr), phy_id, res);
843 goto out_list_del; 843 goto out_list_del;
844 } 844 }
845 } else 845 } else
@@ -855,22 +855,22 @@ static struct domain_device *sas_ex_discover_end_dev(
855 855
856 child->rphy = rphy; 856 child->rphy = rphy;
857 get_device(&rphy->dev); 857 get_device(&rphy->dev);
858 rphy->identify.phy_identifier = phy_id;
858 sas_fill_in_rphy(child, rphy); 859 sas_fill_in_rphy(child, rphy);
859 860
860 list_add_tail(&child->disco_list_node, &parent->port->disco_list); 861 list_add_tail(&child->disco_list_node, &parent->port->disco_list);
861 862
862 res = sas_discover_end_dev(child); 863 res = sas_discover_end_dev(child);
863 if (res) { 864 if (res) {
864 SAS_DPRINTK("sas_discover_end_dev() for device %16llx " 865 pr_notice("sas_discover_end_dev() for device %16llx at %016llx:0x%x returned 0x%x\n",
865 "at %016llx:0x%x returned 0x%x\n", 866 SAS_ADDR(child->sas_addr),
866 SAS_ADDR(child->sas_addr), 867 SAS_ADDR(parent->sas_addr), phy_id, res);
867 SAS_ADDR(parent->sas_addr), phy_id, res);
868 goto out_list_del; 868 goto out_list_del;
869 } 869 }
870 } else { 870 } else {
871 SAS_DPRINTK("target proto 0x%x at %016llx:0x%x not handled\n", 871 pr_notice("target proto 0x%x at %016llx:0x%x not handled\n",
872 phy->attached_tproto, SAS_ADDR(parent->sas_addr), 872 phy->attached_tproto, SAS_ADDR(parent->sas_addr),
873 phy_id); 873 phy_id);
874 goto out_free; 874 goto out_free;
875 } 875 }
876 876
@@ -927,11 +927,10 @@ static struct domain_device *sas_ex_discover_expander(
927 int res; 927 int res;
928 928
929 if (phy->routing_attr == DIRECT_ROUTING) { 929 if (phy->routing_attr == DIRECT_ROUTING) {
930 SAS_DPRINTK("ex %016llx:0x%x:D <--> ex %016llx:0x%x is not " 930 pr_warn("ex %016llx:0x%x:D <--> ex %016llx:0x%x is not allowed\n",
931 "allowed\n", 931 SAS_ADDR(parent->sas_addr), phy_id,
932 SAS_ADDR(parent->sas_addr), phy_id, 932 SAS_ADDR(phy->attached_sas_addr),
933 SAS_ADDR(phy->attached_sas_addr), 933 phy->attached_phy_id);
934 phy->attached_phy_id);
935 return NULL; 934 return NULL;
936 } 935 }
937 child = sas_alloc_device(); 936 child = sas_alloc_device();
@@ -1038,25 +1037,24 @@ static int sas_ex_discover_dev(struct domain_device *dev, int phy_id)
1038 ex_phy->attached_dev_type != SAS_FANOUT_EXPANDER_DEVICE && 1037 ex_phy->attached_dev_type != SAS_FANOUT_EXPANDER_DEVICE &&
1039 ex_phy->attached_dev_type != SAS_EDGE_EXPANDER_DEVICE && 1038 ex_phy->attached_dev_type != SAS_EDGE_EXPANDER_DEVICE &&
1040 ex_phy->attached_dev_type != SAS_SATA_PENDING) { 1039 ex_phy->attached_dev_type != SAS_SATA_PENDING) {
1041 SAS_DPRINTK("unknown device type(0x%x) attached to ex %016llx " 1040 pr_warn("unknown device type(0x%x) attached to ex %016llx phy 0x%x\n",
1042 "phy 0x%x\n", ex_phy->attached_dev_type, 1041 ex_phy->attached_dev_type,
1043 SAS_ADDR(dev->sas_addr), 1042 SAS_ADDR(dev->sas_addr),
1044 phy_id); 1043 phy_id);
1045 return 0; 1044 return 0;
1046 } 1045 }
1047 1046
1048 res = sas_configure_routing(dev, ex_phy->attached_sas_addr); 1047 res = sas_configure_routing(dev, ex_phy->attached_sas_addr);
1049 if (res) { 1048 if (res) {
1050 SAS_DPRINTK("configure routing for dev %016llx " 1049 pr_notice("configure routing for dev %016llx reported 0x%x. Forgotten\n",
1051 "reported 0x%x. Forgotten\n", 1050 SAS_ADDR(ex_phy->attached_sas_addr), res);
1052 SAS_ADDR(ex_phy->attached_sas_addr), res);
1053 sas_disable_routing(dev, ex_phy->attached_sas_addr); 1051 sas_disable_routing(dev, ex_phy->attached_sas_addr);
1054 return res; 1052 return res;
1055 } 1053 }
1056 1054
1057 if (sas_ex_join_wide_port(dev, phy_id)) { 1055 if (sas_ex_join_wide_port(dev, phy_id)) {
1058 SAS_DPRINTK("Attaching ex phy%d to wide port %016llx\n", 1056 pr_debug("Attaching ex phy%d to wide port %016llx\n",
1059 phy_id, SAS_ADDR(ex_phy->attached_sas_addr)); 1057 phy_id, SAS_ADDR(ex_phy->attached_sas_addr));
1060 return res; 1058 return res;
1061 } 1059 }
1062 1060
@@ -1067,12 +1065,11 @@ static int sas_ex_discover_dev(struct domain_device *dev, int phy_id)
1067 break; 1065 break;
1068 case SAS_FANOUT_EXPANDER_DEVICE: 1066 case SAS_FANOUT_EXPANDER_DEVICE:
1069 if (SAS_ADDR(dev->port->disc.fanout_sas_addr)) { 1067 if (SAS_ADDR(dev->port->disc.fanout_sas_addr)) {
1070 SAS_DPRINTK("second fanout expander %016llx phy 0x%x " 1068 pr_debug("second fanout expander %016llx phy 0x%x attached to ex %016llx phy 0x%x\n",
1071 "attached to ex %016llx phy 0x%x\n", 1069 SAS_ADDR(ex_phy->attached_sas_addr),
1072 SAS_ADDR(ex_phy->attached_sas_addr), 1070 ex_phy->attached_phy_id,
1073 ex_phy->attached_phy_id, 1071 SAS_ADDR(dev->sas_addr),
1074 SAS_ADDR(dev->sas_addr), 1072 phy_id);
1075 phy_id);
1076 sas_ex_disable_phy(dev, phy_id); 1073 sas_ex_disable_phy(dev, phy_id);
1077 break; 1074 break;
1078 } else 1075 } else
@@ -1101,9 +1098,8 @@ static int sas_ex_discover_dev(struct domain_device *dev, int phy_id)
1101 SAS_ADDR(child->sas_addr)) { 1098 SAS_ADDR(child->sas_addr)) {
1102 ex->ex_phy[i].phy_state= PHY_DEVICE_DISCOVERED; 1099 ex->ex_phy[i].phy_state= PHY_DEVICE_DISCOVERED;
1103 if (sas_ex_join_wide_port(dev, i)) 1100 if (sas_ex_join_wide_port(dev, i))
1104 SAS_DPRINTK("Attaching ex phy%d to wide port %016llx\n", 1101 pr_debug("Attaching ex phy%d to wide port %016llx\n",
1105 i, SAS_ADDR(ex->ex_phy[i].attached_sas_addr)); 1102 i, SAS_ADDR(ex->ex_phy[i].attached_sas_addr));
1106
1107 } 1103 }
1108 } 1104 }
1109 } 1105 }
@@ -1154,13 +1150,11 @@ static int sas_check_level_subtractive_boundary(struct domain_device *dev)
1154 if (sas_find_sub_addr(child, s2) && 1150 if (sas_find_sub_addr(child, s2) &&
1155 (SAS_ADDR(sub_addr) != SAS_ADDR(s2))) { 1151 (SAS_ADDR(sub_addr) != SAS_ADDR(s2))) {
1156 1152
1157 SAS_DPRINTK("ex %016llx->%016llx-?->%016llx " 1153 pr_notice("ex %016llx->%016llx-?->%016llx diverges from subtractive boundary %016llx\n",
1158 "diverges from subtractive " 1154 SAS_ADDR(dev->sas_addr),
1159 "boundary %016llx\n", 1155 SAS_ADDR(child->sas_addr),
1160 SAS_ADDR(dev->sas_addr), 1156 SAS_ADDR(s2),
1161 SAS_ADDR(child->sas_addr), 1157 SAS_ADDR(sub_addr));
1162 SAS_ADDR(s2),
1163 SAS_ADDR(sub_addr));
1164 1158
1165 sas_ex_disable_port(child, s2); 1159 sas_ex_disable_port(child, s2);
1166 } 1160 }
@@ -1239,12 +1233,10 @@ static int sas_check_ex_subtractive_boundary(struct domain_device *dev)
1239 else if (SAS_ADDR(sub_sas_addr) != 1233 else if (SAS_ADDR(sub_sas_addr) !=
1240 SAS_ADDR(phy->attached_sas_addr)) { 1234 SAS_ADDR(phy->attached_sas_addr)) {
1241 1235
1242 SAS_DPRINTK("ex %016llx phy 0x%x " 1236 pr_notice("ex %016llx phy 0x%x diverges(%016llx) on subtractive boundary(%016llx). Disabled\n",
1243 "diverges(%016llx) on subtractive " 1237 SAS_ADDR(dev->sas_addr), i,
1244 "boundary(%016llx). Disabled\n", 1238 SAS_ADDR(phy->attached_sas_addr),
1245 SAS_ADDR(dev->sas_addr), i, 1239 SAS_ADDR(sub_sas_addr));
1246 SAS_ADDR(phy->attached_sas_addr),
1247 SAS_ADDR(sub_sas_addr));
1248 sas_ex_disable_phy(dev, i); 1240 sas_ex_disable_phy(dev, i);
1249 } 1241 }
1250 } 1242 }
@@ -1262,19 +1254,17 @@ static void sas_print_parent_topology_bug(struct domain_device *child,
1262 }; 1254 };
1263 struct domain_device *parent = child->parent; 1255 struct domain_device *parent = child->parent;
1264 1256
1265 sas_printk("%s ex %016llx phy 0x%x <--> %s ex %016llx " 1257 pr_notice("%s ex %016llx phy 0x%x <--> %s ex %016llx phy 0x%x has %c:%c routing link!\n",
1266 "phy 0x%x has %c:%c routing link!\n", 1258 ex_type[parent->dev_type],
1267 1259 SAS_ADDR(parent->sas_addr),
1268 ex_type[parent->dev_type], 1260 parent_phy->phy_id,
1269 SAS_ADDR(parent->sas_addr),
1270 parent_phy->phy_id,
1271 1261
1272 ex_type[child->dev_type], 1262 ex_type[child->dev_type],
1273 SAS_ADDR(child->sas_addr), 1263 SAS_ADDR(child->sas_addr),
1274 child_phy->phy_id, 1264 child_phy->phy_id,
1275 1265
1276 sas_route_char(parent, parent_phy), 1266 sas_route_char(parent, parent_phy),
1277 sas_route_char(child, child_phy)); 1267 sas_route_char(child, child_phy));
1278} 1268}
1279 1269
1280static int sas_check_eeds(struct domain_device *child, 1270static int sas_check_eeds(struct domain_device *child,
@@ -1286,13 +1276,12 @@ static int sas_check_eeds(struct domain_device *child,
1286 1276
1287 if (SAS_ADDR(parent->port->disc.fanout_sas_addr) != 0) { 1277 if (SAS_ADDR(parent->port->disc.fanout_sas_addr) != 0) {
1288 res = -ENODEV; 1278 res = -ENODEV;
1289 SAS_DPRINTK("edge ex %016llx phy S:0x%x <--> edge ex %016llx " 1279 pr_warn("edge ex %016llx phy S:0x%x <--> edge ex %016llx phy S:0x%x, while there is a fanout ex %016llx\n",
1290 "phy S:0x%x, while there is a fanout ex %016llx\n", 1280 SAS_ADDR(parent->sas_addr),
1291 SAS_ADDR(parent->sas_addr), 1281 parent_phy->phy_id,
1292 parent_phy->phy_id, 1282 SAS_ADDR(child->sas_addr),
1293 SAS_ADDR(child->sas_addr), 1283 child_phy->phy_id,
1294 child_phy->phy_id, 1284 SAS_ADDR(parent->port->disc.fanout_sas_addr));
1295 SAS_ADDR(parent->port->disc.fanout_sas_addr));
1296 } else if (SAS_ADDR(parent->port->disc.eeds_a) == 0) { 1285 } else if (SAS_ADDR(parent->port->disc.eeds_a) == 0) {
1297 memcpy(parent->port->disc.eeds_a, parent->sas_addr, 1286 memcpy(parent->port->disc.eeds_a, parent->sas_addr,
1298 SAS_ADDR_SIZE); 1287 SAS_ADDR_SIZE);
@@ -1310,12 +1299,11 @@ static int sas_check_eeds(struct domain_device *child,
1310 ; 1299 ;
1311 else { 1300 else {
1312 res = -ENODEV; 1301 res = -ENODEV;
1313 SAS_DPRINTK("edge ex %016llx phy 0x%x <--> edge ex %016llx " 1302 pr_warn("edge ex %016llx phy 0x%x <--> edge ex %016llx phy 0x%x link forms a third EEDS!\n",
1314 "phy 0x%x link forms a third EEDS!\n", 1303 SAS_ADDR(parent->sas_addr),
1315 SAS_ADDR(parent->sas_addr), 1304 parent_phy->phy_id,
1316 parent_phy->phy_id, 1305 SAS_ADDR(child->sas_addr),
1317 SAS_ADDR(child->sas_addr), 1306 child_phy->phy_id);
1318 child_phy->phy_id);
1319 } 1307 }
1320 1308
1321 return res; 1309 return res;
@@ -1429,14 +1417,13 @@ static int sas_configure_present(struct domain_device *dev, int phy_id,
1429 goto out; 1417 goto out;
1430 res = rri_resp[2]; 1418 res = rri_resp[2];
1431 if (res == SMP_RESP_NO_INDEX) { 1419 if (res == SMP_RESP_NO_INDEX) {
1432 SAS_DPRINTK("overflow of indexes: dev %016llx " 1420 pr_warn("overflow of indexes: dev %016llx phy 0x%x index 0x%x\n",
1433 "phy 0x%x index 0x%x\n", 1421 SAS_ADDR(dev->sas_addr), phy_id, i);
1434 SAS_ADDR(dev->sas_addr), phy_id, i);
1435 goto out; 1422 goto out;
1436 } else if (res != SMP_RESP_FUNC_ACC) { 1423 } else if (res != SMP_RESP_FUNC_ACC) {
1437 SAS_DPRINTK("%s: dev %016llx phy 0x%x index 0x%x " 1424 pr_notice("%s: dev %016llx phy 0x%x index 0x%x result 0x%x\n",
1438 "result 0x%x\n", __func__, 1425 __func__, SAS_ADDR(dev->sas_addr), phy_id,
1439 SAS_ADDR(dev->sas_addr), phy_id, i, res); 1426 i, res);
1440 goto out; 1427 goto out;
1441 } 1428 }
1442 if (SAS_ADDR(sas_addr) != 0) { 1429 if (SAS_ADDR(sas_addr) != 0) {
@@ -1500,9 +1487,8 @@ static int sas_configure_set(struct domain_device *dev, int phy_id,
1500 goto out; 1487 goto out;
1501 res = cri_resp[2]; 1488 res = cri_resp[2];
1502 if (res == SMP_RESP_NO_INDEX) { 1489 if (res == SMP_RESP_NO_INDEX) {
1503 SAS_DPRINTK("overflow of indexes: dev %016llx phy 0x%x " 1490 pr_warn("overflow of indexes: dev %016llx phy 0x%x index 0x%x\n",
1504 "index 0x%x\n", 1491 SAS_ADDR(dev->sas_addr), phy_id, index);
1505 SAS_ADDR(dev->sas_addr), phy_id, index);
1506 } 1492 }
1507out: 1493out:
1508 kfree(cri_req); 1494 kfree(cri_req);
@@ -1549,8 +1535,8 @@ static int sas_configure_parent(struct domain_device *parent,
1549 } 1535 }
1550 1536
1551 if (ex_parent->conf_route_table == 0) { 1537 if (ex_parent->conf_route_table == 0) {
1552 SAS_DPRINTK("ex %016llx has self-configuring routing table\n", 1538 pr_debug("ex %016llx has self-configuring routing table\n",
1553 SAS_ADDR(parent->sas_addr)); 1539 SAS_ADDR(parent->sas_addr));
1554 return 0; 1540 return 0;
1555 } 1541 }
1556 1542
@@ -1611,8 +1597,8 @@ static int sas_discover_expander(struct domain_device *dev)
1611 1597
1612 res = sas_expander_discover(dev); 1598 res = sas_expander_discover(dev);
1613 if (res) { 1599 if (res) {
1614 SAS_DPRINTK("expander %016llx discovery failed(0x%x)\n", 1600 pr_warn("expander %016llx discovery failed(0x%x)\n",
1615 SAS_ADDR(dev->sas_addr), res); 1601 SAS_ADDR(dev->sas_addr), res);
1616 goto out_err; 1602 goto out_err;
1617 } 1603 }
1618 1604
@@ -1856,10 +1842,10 @@ static int sas_find_bcast_dev(struct domain_device *dev,
1856 if (phy_id != -1) { 1842 if (phy_id != -1) {
1857 *src_dev = dev; 1843 *src_dev = dev;
1858 ex->ex_change_count = ex_change_count; 1844 ex->ex_change_count = ex_change_count;
1859 SAS_DPRINTK("Expander phy change count has changed\n"); 1845 pr_info("Expander phy change count has changed\n");
1860 return res; 1846 return res;
1861 } else 1847 } else
1862 SAS_DPRINTK("Expander phys DID NOT change\n"); 1848 pr_info("Expander phys DID NOT change\n");
1863 } 1849 }
1864 list_for_each_entry(ch, &ex->children, siblings) { 1850 list_for_each_entry(ch, &ex->children, siblings) {
1865 if (ch->dev_type == SAS_EDGE_EXPANDER_DEVICE || ch->dev_type == SAS_FANOUT_EXPANDER_DEVICE) { 1851 if (ch->dev_type == SAS_EDGE_EXPANDER_DEVICE || ch->dev_type == SAS_FANOUT_EXPANDER_DEVICE) {
@@ -1969,8 +1955,8 @@ static int sas_discover_new(struct domain_device *dev, int phy_id)
1969 struct domain_device *child; 1955 struct domain_device *child;
1970 int res; 1956 int res;
1971 1957
1972 SAS_DPRINTK("ex %016llx phy%d new device attached\n", 1958 pr_debug("ex %016llx phy%d new device attached\n",
1973 SAS_ADDR(dev->sas_addr), phy_id); 1959 SAS_ADDR(dev->sas_addr), phy_id);
1974 res = sas_ex_phy_discover(dev, phy_id); 1960 res = sas_ex_phy_discover(dev, phy_id);
1975 if (res) 1961 if (res)
1976 return res; 1962 return res;
@@ -2048,15 +2034,15 @@ static int sas_rediscover_dev(struct domain_device *dev, int phy_id, bool last)
2048 2034
2049 if (ata_dev && phy->attached_dev_type == SAS_SATA_PENDING) 2035 if (ata_dev && phy->attached_dev_type == SAS_SATA_PENDING)
2050 action = ", needs recovery"; 2036 action = ", needs recovery";
2051 SAS_DPRINTK("ex %016llx phy 0x%x broadcast flutter%s\n", 2037 pr_debug("ex %016llx phy 0x%x broadcast flutter%s\n",
2052 SAS_ADDR(dev->sas_addr), phy_id, action); 2038 SAS_ADDR(dev->sas_addr), phy_id, action);
2053 return res; 2039 return res;
2054 } 2040 }
2055 2041
2056 /* we always have to delete the old device when we went here */ 2042 /* we always have to delete the old device when we went here */
2057 SAS_DPRINTK("ex %016llx phy 0x%x replace %016llx\n", 2043 pr_info("ex %016llx phy 0x%x replace %016llx\n",
2058 SAS_ADDR(dev->sas_addr), phy_id, 2044 SAS_ADDR(dev->sas_addr), phy_id,
2059 SAS_ADDR(phy->attached_sas_addr)); 2045 SAS_ADDR(phy->attached_sas_addr));
2060 sas_unregister_devs_sas_addr(dev, phy_id, last); 2046 sas_unregister_devs_sas_addr(dev, phy_id, last);
2061 2047
2062 return sas_discover_new(dev, phy_id); 2048 return sas_discover_new(dev, phy_id);
@@ -2084,8 +2070,8 @@ static int sas_rediscover(struct domain_device *dev, const int phy_id)
2084 int i; 2070 int i;
2085 bool last = true; /* is this the last phy of the port */ 2071 bool last = true; /* is this the last phy of the port */
2086 2072
2087 SAS_DPRINTK("ex %016llx phy%d originated BROADCAST(CHANGE)\n", 2073 pr_debug("ex %016llx phy%d originated BROADCAST(CHANGE)\n",
2088 SAS_ADDR(dev->sas_addr), phy_id); 2074 SAS_ADDR(dev->sas_addr), phy_id);
2089 2075
2090 if (SAS_ADDR(changed_phy->attached_sas_addr) != 0) { 2076 if (SAS_ADDR(changed_phy->attached_sas_addr) != 0) {
2091 for (i = 0; i < ex->num_phys; i++) { 2077 for (i = 0; i < ex->num_phys; i++) {
@@ -2095,8 +2081,8 @@ static int sas_rediscover(struct domain_device *dev, const int phy_id)
2095 continue; 2081 continue;
2096 if (SAS_ADDR(phy->attached_sas_addr) == 2082 if (SAS_ADDR(phy->attached_sas_addr) ==
2097 SAS_ADDR(changed_phy->attached_sas_addr)) { 2083 SAS_ADDR(changed_phy->attached_sas_addr)) {
2098 SAS_DPRINTK("phy%d part of wide port with " 2084 pr_debug("phy%d part of wide port with phy%d\n",
2099 "phy%d\n", phy_id, i); 2085 phy_id, i);
2100 last = false; 2086 last = false;
2101 break; 2087 break;
2102 } 2088 }
@@ -2154,23 +2140,23 @@ void sas_smp_handler(struct bsg_job *job, struct Scsi_Host *shost,
2154 case SAS_FANOUT_EXPANDER_DEVICE: 2140 case SAS_FANOUT_EXPANDER_DEVICE:
2155 break; 2141 break;
2156 default: 2142 default:
2157 printk("%s: can we send a smp request to a device?\n", 2143 pr_err("%s: can we send a smp request to a device?\n",
2158 __func__); 2144 __func__);
2159 goto out; 2145 goto out;
2160 } 2146 }
2161 2147
2162 dev = sas_find_dev_by_rphy(rphy); 2148 dev = sas_find_dev_by_rphy(rphy);
2163 if (!dev) { 2149 if (!dev) {
2164 printk("%s: fail to find a domain_device?\n", __func__); 2150 pr_err("%s: fail to find a domain_device?\n", __func__);
2165 goto out; 2151 goto out;
2166 } 2152 }
2167 2153
2168 /* do we need to support multiple segments? */ 2154 /* do we need to support multiple segments? */
2169 if (job->request_payload.sg_cnt > 1 || 2155 if (job->request_payload.sg_cnt > 1 ||
2170 job->reply_payload.sg_cnt > 1) { 2156 job->reply_payload.sg_cnt > 1) {
2171 printk("%s: multiple segments req %u, rsp %u\n", 2157 pr_info("%s: multiple segments req %u, rsp %u\n",
2172 __func__, job->request_payload.payload_len, 2158 __func__, job->request_payload.payload_len,
2173 job->reply_payload.payload_len); 2159 job->reply_payload.payload_len);
2174 goto out; 2160 goto out;
2175 } 2161 }
2176 2162