summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Garry <john.garry@huawei.com>2019-04-12 04:57:54 -0400
committerMartin K. Petersen <martin.petersen@oracle.com>2019-04-15 18:55:00 -0400
commita5b38d3159eac6a30c1c57d67707c141b9ac3efb (patch)
tree71fc162fe1d99af616c3b7644bfc48464b5178cb
parentf7ddb43eed7bcb096852defb4f57b38393339695 (diff)
scsi: libsas: Improve vague log in SAS rediscovery
When an expander PHY which was part of a wideport disconnects, we would see a log like this from sas_rediscover(): [ 39.695554] sas: phy20 part of wide port with phy16 Here, phy20 is the PHY that disconnected, and phy16 is the lowest indexed member PHY of the wideport. The log implies the phy20 is still part of the wideport with phy16, so is misleading or, at least, vague. Improve the logs in SAS rediscovery by removing this log and adding a log in sas_rediscover_dev() to tell what's really going on. While we're at it, also make the logs in sas_find_bcast_dev() more informative (and more consistent with the reset of the expander logs). 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_expander.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c
index dfdf3c94d326..6f569a65d791 100644
--- a/drivers/scsi/libsas/sas_expander.c
+++ b/drivers/scsi/libsas/sas_expander.c
@@ -1876,10 +1876,12 @@ 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("Expander phy change count has changed\n"); 1879 pr_info("ex %016llx phy%d change count has changed\n",
1880 SAS_ADDR(dev->sas_addr), phy_id);
1880 return res; 1881 return res;
1881 } else 1882 } else
1882 pr_info("Expander phys DID NOT change\n"); 1883 pr_info("ex %016llx phys DID NOT change\n",
1884 SAS_ADDR(dev->sas_addr));
1883 } 1885 }
1884 list_for_each_entry(ch, &ex->children, siblings) { 1886 list_for_each_entry(ch, &ex->children, siblings) {
1885 if (ch->dev_type == SAS_EDGE_EXPANDER_DEVICE || ch->dev_type == SAS_FANOUT_EXPANDER_DEVICE) { 1887 if (ch->dev_type == SAS_EDGE_EXPANDER_DEVICE || ch->dev_type == SAS_FANOUT_EXPANDER_DEVICE) {
@@ -2028,14 +2030,22 @@ static bool dev_type_flutter(enum sas_device_type new, enum sas_device_type old)
2028 return false; 2030 return false;
2029} 2031}
2030 2032
2031static int sas_rediscover_dev(struct domain_device *dev, int phy_id, bool last) 2033static int sas_rediscover_dev(struct domain_device *dev, int phy_id,
2034 bool last, int sibling)
2032{ 2035{
2033 struct expander_device *ex = &dev->ex_dev; 2036 struct expander_device *ex = &dev->ex_dev;
2034 struct ex_phy *phy = &ex->ex_phy[phy_id]; 2037 struct ex_phy *phy = &ex->ex_phy[phy_id];
2035 enum sas_device_type type = SAS_PHY_UNUSED; 2038 enum sas_device_type type = SAS_PHY_UNUSED;
2036 u8 sas_addr[SAS_ADDR_SIZE]; 2039 u8 sas_addr[SAS_ADDR_SIZE];
2040 char msg[80] = "";
2037 int res; 2041 int res;
2038 2042
2043 if (!last)
2044 sprintf(msg, ", part of a wide port with phy%d", sibling);
2045
2046 pr_debug("ex %016llx rediscovering phy%d%s\n", SAS_ADDR(dev->sas_addr),
2047 phy_id, msg);
2048
2039 memset(sas_addr, 0, SAS_ADDR_SIZE); 2049 memset(sas_addr, 0, SAS_ADDR_SIZE);
2040 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);
2041 switch (res) { 2051 switch (res) {
@@ -2115,13 +2125,11 @@ static int sas_rediscover(struct domain_device *dev, const int phy_id)
2115 continue; 2125 continue;
2116 if (SAS_ADDR(phy->attached_sas_addr) == 2126 if (SAS_ADDR(phy->attached_sas_addr) ==
2117 SAS_ADDR(changed_phy->attached_sas_addr)) { 2127 SAS_ADDR(changed_phy->attached_sas_addr)) {
2118 pr_debug("phy%d part of wide port with phy%d\n",
2119 phy_id, i);
2120 last = false; 2128 last = false;
2121 break; 2129 break;
2122 } 2130 }
2123 } 2131 }
2124 res = sas_rediscover_dev(dev, phy_id, last); 2132 res = sas_rediscover_dev(dev, phy_id, last, i);
2125 } else 2133 } else
2126 res = sas_discover_new(dev, phy_id); 2134 res = sas_discover_new(dev, phy_id);
2127 return res; 2135 return res;