b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | From 434d2312cd8057aa6972f2b39aa0b359d02af9f4 Mon Sep 17 00:00:00 2001 |
| 2 | From: Paul Barker <pbarker@konsulko.com> |
| 3 | Date: Thu, 3 Sep 2020 12:26:21 +0100 |
| 4 | Subject: [PATCH] net: dsa: b53: Print err message on SW_RST timeout |
| 5 | |
| 6 | This allows us to differentiate between the possible failure modes of |
| 7 | b53_switch_reset() by looking at the dmesg output. |
| 8 | |
| 9 | Signed-off-by: Paul Barker <pbarker@konsulko.com> |
| 10 | Acked-by: Florian Fainelli <f.fainelli@gmail.com> |
| 11 | Signed-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); |