Skip to contentSkip to conversation

Minor improvements to b53 dmesg output

PATCH In review Paul Barker 3 participants 6 messages Sep 3, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover Minor improvements to b53 dmesg output

These changes were made while debugging the b53 driver for use on a custom board. They've been runtime tested on a patched 4.14.y kernel which supports this board as well as build tested with 5.9-rc3. The changes are straightforward enough that I think this testing is sufficient but let me know if further testing is required.

Unfortunately I don't have a board to hand which boots with a more recent kernel and has a switch supported by the b53 driver. I'd still like to upstream these patches if possible though.

Paul Barker (2):
net: dsa: b53: Use dev_{err,info} instead of pr_*
net: dsa: b53: Print err message on SW_RST timeout

 drivers/net/dsa/b53/b53_common.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)
Signature · 1 line
2.28.0
#1 lore raw

PATCH 1/2 net: dsa: b53: Use dev_{err,info} instead of pr_*

This change allows us to see which device the err or info messages are referring to if we have multiple b53 compatible devices on a board.

As this removes the only pr_*() calls in this file we can drop the definition of pr_fmt().

---
 drivers/net/dsa/b53/b53_common.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/net/dsa/b53/b53_common.c +5 -5
index e731db900ee0..c2ecb1cdef3f 100644
@@ -17,8 +17,6 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
 #include <linux/delay.h>
 #include <linux/export.h>
 #include <linux/gpio.h>
@@ -2620,8 +2618,9 @@ int b53_switch_detect(struct b53_device *dev)
 			dev->chip_id = id32;
 			break;
 		default:
-			pr_err("unsupported switch detected (BCM53%02x/BCM%x)\n",
-			       id8, id32);
+			dev_err(dev->dev,
+				"unsupported switch detected (BCM53%02x/BCM%x)\n",
+				id8, id32);
 			return -ENODEV;
 		}
 	}
@@ -2651,7 +2650,8 @@ int b53_switch_register(struct b53_device *dev)
 	if (ret)
 		return ret;
 
-	pr_info("found switch: %s, rev %i\n", dev->name, dev->core_rev);
+	dev_info(dev->dev, "found switch: %s, rev %i\n",
+		 dev->name, dev->core_rev);
 
 	return dsa_register_switch(dev->ds);
 }
Signature · 1 line
2.28.0
Acked-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] net: dsa: b53: Use dev_{err,info} instead of pr_*

Quoted 7 lines · Paul Barker

This change allows us to see which device the err or info messages are referring to if we have multiple b53 compatible devices on a board.

As this removes the only pr_*() calls in this file we can drop the definition of pr_fmt().

Signature · 1 line
Florian
#3 lore raw

PATCH 2/2 net: dsa: b53: Print err message on SW_RST timeout

In reply to Paul Barker

This allows us to differentiate between the possible failure modes of b53_switch_reset() by looking at the dmesg output.

---
 drivers/net/dsa/b53/b53_common.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/dsa/b53/b53_common.c +4 -1
index c2ecb1cdef3f..26fcff85d881 100644
@@ -765,8 +765,11 @@ static int b53_switch_reset(struct b53_device *dev)
 			usleep_range(1000, 2000);
 		} while (timeout-- > 0);
 
-		if (timeout == 0)
+		if (timeout == 0) {
+			dev_err(dev->dev,
+				"Timeout waiting for SW_RST to clear!\n");
 			return -ETIMEDOUT;
+		}
 	}
 
 	b53_read8(dev, B53_CTRL_PAGE, B53_SWITCH_MODE, &mgmt);
Signature · 1 line
2.28.0
maintainer
#5 lore raw
In reply to Paul Barker

From: Paul Barker <[email protected]>
Date: Thu, 3 Sep 2020 12:26:19 +0100

Quoted 9 lines

These changes were made while debugging the b53 driver for use on a custom board. They've been runtime tested on a patched 4.14.y kernel which supports this board as well as build tested with 5.9-rc3. The changes are straightforward enough that I think this testing is sufficient but let me know if further testing is required.

Unfortunately I don't have a board to hand which boots with a more recent kernel and has a switch supported by the b53 driver. I'd still like to upstream these patches if possible though.

Series applied to net-next, thanks.