blob: a83cec395089b80f316b725564610d60d27b5125 [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001From 434d2312cd8057aa6972f2b39aa0b359d02af9f4 Mon Sep 17 00:00:00 2001
2From: Paul Barker <pbarker@konsulko.com>
3Date: Thu, 3 Sep 2020 12:26:21 +0100
4Subject: [PATCH] net: dsa: b53: Print err message on SW_RST timeout
5
6This allows us to differentiate between the possible failure modes of
7b53_switch_reset() by looking at the dmesg output.
8
9Signed-off-by: Paul Barker <pbarker@konsulko.com>
10Acked-by: Florian Fainelli <f.fainelli@gmail.com>
11Signed-off-by: David S. Miller <davem@davemloft.net>
12---
13 drivers/net/dsa/b53/b53_common.c | 5 ++++-
14 1 file changed, 4 insertions(+), 1 deletion(-)
15
16--- a/drivers/net/dsa/b53/b53_common.c
17+++ b/drivers/net/dsa/b53/b53_common.c
18@@ -783,8 +783,11 @@ static int b53_switch_reset(struct b53_d
19 usleep_range(1000, 2000);
20 } while (timeout-- > 0);
21
22- if (timeout == 0)
23+ if (timeout == 0) {
24+ dev_err(dev->dev,
25+ "Timeout waiting for SW_RST to clear!\n");
26 return -ETIMEDOUT;
27+ }
28 }
29
30 b53_read8(dev, B53_CTRL_PAGE, B53_SWITCH_MODE, &mgmt);