diff options
author | John Garry <john.garry@huawei.com> | 2019-04-12 04:57:57 -0400 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2019-04-15 18:55:01 -0400 |
commit | 3c236f8cc63b4593c9627bf0149f416925db8899 (patch) | |
tree | 4f4f9f5a2ae5f20a3ac436978d656df3b501426f | |
parent | d8649fc1c5e40e691d589ed825998c36a947491c (diff) |
scsi: libsas: Print expander PHY indexes in decimal
Currently we print expander PHY indexes in a mix of decimal and hex.
It is more consistent and also more convenient to read decimal, so
make this change.
We use width of 2 for expander and 1 for root PHYs prints.
Some lines which were needlessly spilling multiple lines are unified.
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r-- | drivers/scsi/libsas/sas_ata.c | 2 | ||||
-rw-r--r-- | drivers/scsi/libsas/sas_expander.c | 44 | ||||
-rw-r--r-- | drivers/scsi/libsas/sas_init.c | 2 | ||||
-rw-r--r-- | drivers/scsi/libsas/sas_phy.c | 7 |
4 files changed, 27 insertions, 28 deletions
diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c index 6f93fee2b21b..1ecca71df8b5 100644 --- a/drivers/scsi/libsas/sas_ata.c +++ b/drivers/scsi/libsas/sas_ata.c | |||
@@ -281,7 +281,7 @@ int sas_get_ata_info(struct domain_device *dev, struct ex_phy *phy) | |||
281 | res = sas_get_report_phy_sata(dev->parent, phy->phy_id, | 281 | res = sas_get_report_phy_sata(dev->parent, phy->phy_id, |
282 | &dev->sata_dev.rps_resp); | 282 | &dev->sata_dev.rps_resp); |
283 | if (res) { | 283 | if (res) { |
284 | pr_debug("report phy sata to %016llx:0x%x returned 0x%x\n", | 284 | pr_debug("report phy sata to %016llx:%02d returned 0x%x\n", |
285 | SAS_ADDR(dev->parent->sas_addr), | 285 | SAS_ADDR(dev->parent->sas_addr), |
286 | phy->phy_id, res); | 286 | phy->phy_id, res); |
287 | return res; | 287 | return res; |
diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c index ad96bc843acc..83f2fd70ce76 100644 --- a/drivers/scsi/libsas/sas_expander.c +++ b/drivers/scsi/libsas/sas_expander.c | |||
@@ -870,7 +870,7 @@ static struct domain_device *sas_ex_discover_end_dev( | |||
870 | 870 | ||
871 | res = sas_discover_sata(child); | 871 | res = sas_discover_sata(child); |
872 | if (res) { | 872 | if (res) { |
873 | pr_notice("sas_discover_sata() for device %16llx at %016llx:0x%x returned 0x%x\n", | 873 | pr_notice("sas_discover_sata() for device %16llx at %016llx:%02d returned 0x%x\n", |
874 | SAS_ADDR(child->sas_addr), | 874 | SAS_ADDR(child->sas_addr), |
875 | SAS_ADDR(parent->sas_addr), phy_id, res); | 875 | SAS_ADDR(parent->sas_addr), phy_id, res); |
876 | goto out_list_del; | 876 | goto out_list_del; |
@@ -895,7 +895,7 @@ static struct domain_device *sas_ex_discover_end_dev( | |||
895 | 895 | ||
896 | res = sas_discover_end_dev(child); | 896 | res = sas_discover_end_dev(child); |
897 | if (res) { | 897 | if (res) { |
898 | pr_notice("sas_discover_end_dev() for device %16llx at %016llx:0x%x returned 0x%x\n", | 898 | pr_notice("sas_discover_end_dev() for device %16llx at %016llx:%02d returned 0x%x\n", |
899 | SAS_ADDR(child->sas_addr), | 899 | SAS_ADDR(child->sas_addr), |
900 | SAS_ADDR(parent->sas_addr), phy_id, res); | 900 | SAS_ADDR(parent->sas_addr), phy_id, res); |
901 | goto out_list_del; | 901 | goto out_list_del; |
@@ -960,7 +960,7 @@ static struct domain_device *sas_ex_discover_expander( | |||
960 | int res; | 960 | int res; |
961 | 961 | ||
962 | if (phy->routing_attr == DIRECT_ROUTING) { | 962 | if (phy->routing_attr == DIRECT_ROUTING) { |
963 | pr_warn("ex %016llx:0x%x:D <--> ex %016llx:0x%x is not allowed\n", | 963 | pr_warn("ex %016llx:%02d:D <--> ex %016llx:0x%x is not allowed\n", |
964 | SAS_ADDR(parent->sas_addr), phy_id, | 964 | SAS_ADDR(parent->sas_addr), phy_id, |
965 | SAS_ADDR(phy->attached_sas_addr), | 965 | SAS_ADDR(phy->attached_sas_addr), |
966 | phy->attached_phy_id); | 966 | phy->attached_phy_id); |
@@ -1070,7 +1070,7 @@ static int sas_ex_discover_dev(struct domain_device *dev, int phy_id) | |||
1070 | ex_phy->attached_dev_type != SAS_FANOUT_EXPANDER_DEVICE && | 1070 | ex_phy->attached_dev_type != SAS_FANOUT_EXPANDER_DEVICE && |
1071 | ex_phy->attached_dev_type != SAS_EDGE_EXPANDER_DEVICE && | 1071 | ex_phy->attached_dev_type != SAS_EDGE_EXPANDER_DEVICE && |
1072 | ex_phy->attached_dev_type != SAS_SATA_PENDING) { | 1072 | ex_phy->attached_dev_type != SAS_SATA_PENDING) { |
1073 | pr_warn("unknown device type(0x%x) attached to ex %016llx phy 0x%x\n", | 1073 | pr_warn("unknown device type(0x%x) attached to ex %016llx phy%02d\n", |
1074 | ex_phy->attached_dev_type, | 1074 | ex_phy->attached_dev_type, |
1075 | SAS_ADDR(dev->sas_addr), | 1075 | SAS_ADDR(dev->sas_addr), |
1076 | phy_id); | 1076 | phy_id); |
@@ -1086,7 +1086,7 @@ static int sas_ex_discover_dev(struct domain_device *dev, int phy_id) | |||
1086 | } | 1086 | } |
1087 | 1087 | ||
1088 | if (sas_ex_join_wide_port(dev, phy_id)) { | 1088 | if (sas_ex_join_wide_port(dev, phy_id)) { |
1089 | pr_debug("Attaching ex phy%d to wide port %016llx\n", | 1089 | pr_debug("Attaching ex phy%02d to wide port %016llx\n", |
1090 | phy_id, SAS_ADDR(ex_phy->attached_sas_addr)); | 1090 | phy_id, SAS_ADDR(ex_phy->attached_sas_addr)); |
1091 | return res; | 1091 | return res; |
1092 | } | 1092 | } |
@@ -1098,7 +1098,7 @@ static int sas_ex_discover_dev(struct domain_device *dev, int phy_id) | |||
1098 | break; | 1098 | break; |
1099 | case SAS_FANOUT_EXPANDER_DEVICE: | 1099 | case SAS_FANOUT_EXPANDER_DEVICE: |
1100 | if (SAS_ADDR(dev->port->disc.fanout_sas_addr)) { | 1100 | if (SAS_ADDR(dev->port->disc.fanout_sas_addr)) { |
1101 | pr_debug("second fanout expander %016llx phy 0x%x attached to ex %016llx phy 0x%x\n", | 1101 | pr_debug("second fanout expander %016llx phy%02d attached to ex %016llx phy%02d\n", |
1102 | SAS_ADDR(ex_phy->attached_sas_addr), | 1102 | SAS_ADDR(ex_phy->attached_sas_addr), |
1103 | ex_phy->attached_phy_id, | 1103 | ex_phy->attached_phy_id, |
1104 | SAS_ADDR(dev->sas_addr), | 1104 | SAS_ADDR(dev->sas_addr), |
@@ -1131,7 +1131,7 @@ static int sas_ex_discover_dev(struct domain_device *dev, int phy_id) | |||
1131 | SAS_ADDR(child->sas_addr)) { | 1131 | SAS_ADDR(child->sas_addr)) { |
1132 | ex->ex_phy[i].phy_state= PHY_DEVICE_DISCOVERED; | 1132 | ex->ex_phy[i].phy_state= PHY_DEVICE_DISCOVERED; |
1133 | if (sas_ex_join_wide_port(dev, i)) | 1133 | if (sas_ex_join_wide_port(dev, i)) |
1134 | pr_debug("Attaching ex phy%d to wide port %016llx\n", | 1134 | pr_debug("Attaching ex phy%02d to wide port %016llx\n", |
1135 | i, SAS_ADDR(ex->ex_phy[i].attached_sas_addr)); | 1135 | i, SAS_ADDR(ex->ex_phy[i].attached_sas_addr)); |
1136 | } | 1136 | } |
1137 | } | 1137 | } |
@@ -1266,7 +1266,7 @@ static int sas_check_ex_subtractive_boundary(struct domain_device *dev) | |||
1266 | else if (SAS_ADDR(sub_sas_addr) != | 1266 | else if (SAS_ADDR(sub_sas_addr) != |
1267 | SAS_ADDR(phy->attached_sas_addr)) { | 1267 | SAS_ADDR(phy->attached_sas_addr)) { |
1268 | 1268 | ||
1269 | pr_notice("ex %016llx phy 0x%x diverges(%016llx) on subtractive boundary(%016llx). Disabled\n", | 1269 | pr_notice("ex %016llx phy%02d diverges(%016llx) on subtractive boundary(%016llx). Disabled\n", |
1270 | SAS_ADDR(dev->sas_addr), i, | 1270 | SAS_ADDR(dev->sas_addr), i, |
1271 | SAS_ADDR(phy->attached_sas_addr), | 1271 | SAS_ADDR(phy->attached_sas_addr), |
1272 | SAS_ADDR(sub_sas_addr)); | 1272 | SAS_ADDR(sub_sas_addr)); |
@@ -1287,7 +1287,7 @@ static void sas_print_parent_topology_bug(struct domain_device *child, | |||
1287 | }; | 1287 | }; |
1288 | struct domain_device *parent = child->parent; | 1288 | struct domain_device *parent = child->parent; |
1289 | 1289 | ||
1290 | pr_notice("%s ex %016llx phy 0x%x <--> %s ex %016llx phy 0x%x has %c:%c routing link!\n", | 1290 | pr_notice("%s ex %016llx phy%02d <--> %s ex %016llx phy%02d has %c:%c routing link!\n", |
1291 | ex_type[parent->dev_type], | 1291 | ex_type[parent->dev_type], |
1292 | SAS_ADDR(parent->sas_addr), | 1292 | SAS_ADDR(parent->sas_addr), |
1293 | parent_phy->phy_id, | 1293 | parent_phy->phy_id, |
@@ -1309,7 +1309,7 @@ static int sas_check_eeds(struct domain_device *child, | |||
1309 | 1309 | ||
1310 | if (SAS_ADDR(parent->port->disc.fanout_sas_addr) != 0) { | 1310 | if (SAS_ADDR(parent->port->disc.fanout_sas_addr) != 0) { |
1311 | res = -ENODEV; | 1311 | res = -ENODEV; |
1312 | pr_warn("edge ex %016llx phy S:0x%x <--> edge ex %016llx phy S:0x%x, while there is a fanout ex %016llx\n", | 1312 | pr_warn("edge ex %016llx phy S:%02d <--> edge ex %016llx phy S:%02d, while there is a fanout ex %016llx\n", |
1313 | SAS_ADDR(parent->sas_addr), | 1313 | SAS_ADDR(parent->sas_addr), |
1314 | parent_phy->phy_id, | 1314 | parent_phy->phy_id, |
1315 | SAS_ADDR(child->sas_addr), | 1315 | SAS_ADDR(child->sas_addr), |
@@ -1332,7 +1332,7 @@ static int sas_check_eeds(struct domain_device *child, | |||
1332 | ; | 1332 | ; |
1333 | else { | 1333 | else { |
1334 | res = -ENODEV; | 1334 | res = -ENODEV; |
1335 | pr_warn("edge ex %016llx phy 0x%x <--> edge ex %016llx phy 0x%x link forms a third EEDS!\n", | 1335 | pr_warn("edge ex %016llx phy%02d <--> edge ex %016llx phy%02d link forms a third EEDS!\n", |
1336 | SAS_ADDR(parent->sas_addr), | 1336 | SAS_ADDR(parent->sas_addr), |
1337 | parent_phy->phy_id, | 1337 | parent_phy->phy_id, |
1338 | SAS_ADDR(child->sas_addr), | 1338 | SAS_ADDR(child->sas_addr), |
@@ -1450,11 +1450,11 @@ static int sas_configure_present(struct domain_device *dev, int phy_id, | |||
1450 | goto out; | 1450 | goto out; |
1451 | res = rri_resp[2]; | 1451 | res = rri_resp[2]; |
1452 | if (res == SMP_RESP_NO_INDEX) { | 1452 | if (res == SMP_RESP_NO_INDEX) { |
1453 | pr_warn("overflow of indexes: dev %016llx phy 0x%x index 0x%x\n", | 1453 | pr_warn("overflow of indexes: dev %016llx phy%02d index 0x%x\n", |
1454 | SAS_ADDR(dev->sas_addr), phy_id, i); | 1454 | SAS_ADDR(dev->sas_addr), phy_id, i); |
1455 | goto out; | 1455 | goto out; |
1456 | } else if (res != SMP_RESP_FUNC_ACC) { | 1456 | } else if (res != SMP_RESP_FUNC_ACC) { |
1457 | pr_notice("%s: dev %016llx phy 0x%x index 0x%x result 0x%x\n", | 1457 | pr_notice("%s: dev %016llx phy%02d index 0x%x result 0x%x\n", |
1458 | __func__, SAS_ADDR(dev->sas_addr), phy_id, | 1458 | __func__, SAS_ADDR(dev->sas_addr), phy_id, |
1459 | i, res); | 1459 | i, res); |
1460 | goto out; | 1460 | goto out; |
@@ -1520,7 +1520,7 @@ static int sas_configure_set(struct domain_device *dev, int phy_id, | |||
1520 | goto out; | 1520 | goto out; |
1521 | res = cri_resp[2]; | 1521 | res = cri_resp[2]; |
1522 | if (res == SMP_RESP_NO_INDEX) { | 1522 | if (res == SMP_RESP_NO_INDEX) { |
1523 | pr_warn("overflow of indexes: dev %016llx phy 0x%x index 0x%x\n", | 1523 | pr_warn("overflow of indexes: dev %016llx phy%02d index 0x%x\n", |
1524 | SAS_ADDR(dev->sas_addr), phy_id, index); | 1524 | SAS_ADDR(dev->sas_addr), phy_id, index); |
1525 | } | 1525 | } |
1526 | out: | 1526 | out: |
@@ -1876,7 +1876,7 @@ static int sas_find_bcast_dev(struct domain_device *dev, | |||
1876 | if (phy_id != -1) { | 1876 | if (phy_id != -1) { |
1877 | *src_dev = dev; | 1877 | *src_dev = dev; |
1878 | ex->ex_change_count = ex_change_count; | 1878 | ex->ex_change_count = ex_change_count; |
1879 | pr_info("ex %016llx phy%d change count has changed\n", | 1879 | pr_info("ex %016llx phy%02d change count has changed\n", |
1880 | SAS_ADDR(dev->sas_addr), phy_id); | 1880 | SAS_ADDR(dev->sas_addr), phy_id); |
1881 | return res; | 1881 | return res; |
1882 | } else | 1882 | } else |
@@ -1991,7 +1991,7 @@ static int sas_discover_new(struct domain_device *dev, int phy_id) | |||
1991 | struct domain_device *child; | 1991 | struct domain_device *child; |
1992 | int res; | 1992 | int res; |
1993 | 1993 | ||
1994 | pr_debug("ex %016llx phy%d new device attached\n", | 1994 | pr_debug("ex %016llx phy%02d new device attached\n", |
1995 | SAS_ADDR(dev->sas_addr), phy_id); | 1995 | SAS_ADDR(dev->sas_addr), phy_id); |
1996 | res = sas_ex_phy_discover(dev, phy_id); | 1996 | res = sas_ex_phy_discover(dev, phy_id); |
1997 | if (res) | 1997 | if (res) |
@@ -2041,10 +2041,10 @@ static int sas_rediscover_dev(struct domain_device *dev, int phy_id, | |||
2041 | int res; | 2041 | int res; |
2042 | 2042 | ||
2043 | if (!last) | 2043 | if (!last) |
2044 | sprintf(msg, ", part of a wide port with phy%d", sibling); | 2044 | sprintf(msg, ", part of a wide port with phy%02d", sibling); |
2045 | 2045 | ||
2046 | pr_debug("ex %016llx rediscovering phy%d%s\n", SAS_ADDR(dev->sas_addr), | 2046 | pr_debug("ex %016llx rediscovering phy%02d%s\n", |
2047 | phy_id, msg); | 2047 | SAS_ADDR(dev->sas_addr), phy_id, msg); |
2048 | 2048 | ||
2049 | memset(sas_addr, 0, SAS_ADDR_SIZE); | 2049 | memset(sas_addr, 0, SAS_ADDR_SIZE); |
2050 | res = sas_get_phy_attached_dev(dev, phy_id, sas_addr, &type); | 2050 | res = sas_get_phy_attached_dev(dev, phy_id, sas_addr, &type); |
@@ -2083,13 +2083,13 @@ static int sas_rediscover_dev(struct domain_device *dev, int phy_id, | |||
2083 | 2083 | ||
2084 | if (ata_dev && phy->attached_dev_type == SAS_SATA_PENDING) | 2084 | if (ata_dev && phy->attached_dev_type == SAS_SATA_PENDING) |
2085 | action = ", needs recovery"; | 2085 | action = ", needs recovery"; |
2086 | pr_debug("ex %016llx phy 0x%x broadcast flutter%s\n", | 2086 | pr_debug("ex %016llx phy%02d broadcast flutter%s\n", |
2087 | SAS_ADDR(dev->sas_addr), phy_id, action); | 2087 | SAS_ADDR(dev->sas_addr), phy_id, action); |
2088 | return res; | 2088 | return res; |
2089 | } | 2089 | } |
2090 | 2090 | ||
2091 | /* we always have to delete the old device when we went here */ | 2091 | /* we always have to delete the old device when we went here */ |
2092 | pr_info("ex %016llx phy 0x%x replace %016llx\n", | 2092 | pr_info("ex %016llx phy%02d replace %016llx\n", |
2093 | SAS_ADDR(dev->sas_addr), phy_id, | 2093 | SAS_ADDR(dev->sas_addr), phy_id, |
2094 | SAS_ADDR(phy->attached_sas_addr)); | 2094 | SAS_ADDR(phy->attached_sas_addr)); |
2095 | sas_unregister_devs_sas_addr(dev, phy_id, last); | 2095 | sas_unregister_devs_sas_addr(dev, phy_id, last); |
@@ -2119,7 +2119,7 @@ static int sas_rediscover(struct domain_device *dev, const int phy_id) | |||
2119 | int i; | 2119 | int i; |
2120 | bool last = true; /* is this the last phy of the port */ | 2120 | bool last = true; /* is this the last phy of the port */ |
2121 | 2121 | ||
2122 | pr_debug("ex %016llx phy%d originated BROADCAST(CHANGE)\n", | 2122 | pr_debug("ex %016llx phy%02d originated BROADCAST(CHANGE)\n", |
2123 | SAS_ADDR(dev->sas_addr), phy_id); | 2123 | SAS_ADDR(dev->sas_addr), phy_id); |
2124 | 2124 | ||
2125 | if (SAS_ADDR(changed_phy->attached_sas_addr) != 0) { | 2125 | if (SAS_ADDR(changed_phy->attached_sas_addr) != 0) { |
diff --git a/drivers/scsi/libsas/sas_init.c b/drivers/scsi/libsas/sas_init.c index 213c85557bf9..28a460c36c0b 100644 --- a/drivers/scsi/libsas/sas_init.c +++ b/drivers/scsi/libsas/sas_init.c | |||
@@ -625,7 +625,7 @@ struct asd_sas_event *sas_alloc_event(struct asd_sas_phy *phy) | |||
625 | if (atomic_read(&phy->event_nr) > phy->ha->event_thres) { | 625 | if (atomic_read(&phy->event_nr) > phy->ha->event_thres) { |
626 | if (i->dft->lldd_control_phy) { | 626 | if (i->dft->lldd_control_phy) { |
627 | if (cmpxchg(&phy->in_shutdown, 0, 1) == 0) { | 627 | if (cmpxchg(&phy->in_shutdown, 0, 1) == 0) { |
628 | pr_notice("The phy%02d bursting events, shut it down.\n", | 628 | pr_notice("The phy%d bursting events, shut it down.\n", |
629 | phy->id); | 629 | phy->id); |
630 | sas_notify_phy_event(phy, PHYE_SHUTDOWN); | 630 | sas_notify_phy_event(phy, PHYE_SHUTDOWN); |
631 | } | 631 | } |
diff --git a/drivers/scsi/libsas/sas_phy.c b/drivers/scsi/libsas/sas_phy.c index 0374243c85d0..e030e1452136 100644 --- a/drivers/scsi/libsas/sas_phy.c +++ b/drivers/scsi/libsas/sas_phy.c | |||
@@ -122,11 +122,10 @@ static void sas_phye_shutdown(struct work_struct *work) | |||
122 | phy->enabled = 0; | 122 | phy->enabled = 0; |
123 | ret = i->dft->lldd_control_phy(phy, PHY_FUNC_DISABLE, NULL); | 123 | ret = i->dft->lldd_control_phy(phy, PHY_FUNC_DISABLE, NULL); |
124 | if (ret) | 124 | if (ret) |
125 | pr_notice("lldd disable phy%02d returned %d\n", | 125 | pr_notice("lldd disable phy%d returned %d\n", phy->id, |
126 | phy->id, ret); | 126 | ret); |
127 | } else | 127 | } else |
128 | pr_notice("phy%02d is not enabled, cannot shutdown\n", | 128 | pr_notice("phy%d is not enabled, cannot shutdown\n", phy->id); |
129 | phy->id); | ||
130 | } | 129 | } |
131 | 130 | ||
132 | /* ---------- Phy class registration ---------- */ | 131 | /* ---------- Phy class registration ---------- */ |