All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Minor improvements to b53 dmesg output
@ 2020-09-03 11:26 Paul Barker
  2020-09-03 11:26 ` [PATCH 1/2] net: dsa: b53: Use dev_{err,info} instead of pr_* Paul Barker
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Paul Barker @ 2020-09-03 11:26 UTC (permalink / raw)
  To: Florian Fainelli, Andrew Lunn, Vivien Didelot, David S . Miller
  Cc: Paul Barker, netdev

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(-)

-- 
2.28.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] net: dsa: b53: Use dev_{err,info} instead of pr_*
  2020-09-03 11:26 [PATCH 0/2] Minor improvements to b53 dmesg output Paul Barker
@ 2020-09-03 11:26 ` Paul Barker
  2020-09-03 14:21   ` Florian Fainelli
  2020-09-03 11:26 ` [PATCH 2/2] net: dsa: b53: Print err message on SW_RST timeout Paul Barker
  2020-09-03 19:07 ` [PATCH 0/2] Minor improvements to b53 dmesg output David Miller
  2 siblings, 1 reply; 6+ messages in thread
From: Paul Barker @ 2020-09-03 11:26 UTC (permalink / raw)
  To: Florian Fainelli, Andrew Lunn, Vivien Didelot, David S . Miller
  Cc: Paul Barker, netdev

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().

Signed-off-by: Paul Barker <pbarker@konsulko.com>
---
 drivers/net/dsa/b53/b53_common.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index e731db900ee0..c2ecb1cdef3f 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -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);
 }
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] net: dsa: b53: Print err message on SW_RST timeout
  2020-09-03 11:26 [PATCH 0/2] Minor improvements to b53 dmesg output Paul Barker
  2020-09-03 11:26 ` [PATCH 1/2] net: dsa: b53: Use dev_{err,info} instead of pr_* Paul Barker
@ 2020-09-03 11:26 ` Paul Barker
  2020-09-03 14:21   ` Florian Fainelli
  2020-09-03 19:07 ` [PATCH 0/2] Minor improvements to b53 dmesg output David Miller
  2 siblings, 1 reply; 6+ messages in thread
From: Paul Barker @ 2020-09-03 11:26 UTC (permalink / raw)
  To: Florian Fainelli, Andrew Lunn, Vivien Didelot, David S . Miller
  Cc: Paul Barker, netdev

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

Signed-off-by: Paul Barker <pbarker@konsulko.com>
---
 drivers/net/dsa/b53/b53_common.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index c2ecb1cdef3f..26fcff85d881 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -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);
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] net: dsa: b53: Use dev_{err,info} instead of pr_*
  2020-09-03 11:26 ` [PATCH 1/2] net: dsa: b53: Use dev_{err,info} instead of pr_* Paul Barker
@ 2020-09-03 14:21   ` Florian Fainelli
  0 siblings, 0 replies; 6+ messages in thread
From: Florian Fainelli @ 2020-09-03 14:21 UTC (permalink / raw)
  To: Paul Barker, Andrew Lunn, Vivien Didelot, David S . Miller; +Cc: netdev



On 9/3/2020 4:26 AM, Paul Barker wrote:
> 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().
> 
> Signed-off-by: Paul Barker <pbarker@konsulko.com>

Acked-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] net: dsa: b53: Print err message on SW_RST timeout
  2020-09-03 11:26 ` [PATCH 2/2] net: dsa: b53: Print err message on SW_RST timeout Paul Barker
@ 2020-09-03 14:21   ` Florian Fainelli
  0 siblings, 0 replies; 6+ messages in thread
From: Florian Fainelli @ 2020-09-03 14:21 UTC (permalink / raw)
  To: Paul Barker, Andrew Lunn, Vivien Didelot, David S . Miller; +Cc: netdev



On 9/3/2020 4:26 AM, Paul Barker wrote:
> This allows us to differentiate between the possible failure modes of
> b53_switch_reset() by looking at the dmesg output.
> 
> Signed-off-by: Paul Barker <pbarker@konsulko.com>

Acked-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/2] Minor improvements to b53 dmesg output
  2020-09-03 11:26 [PATCH 0/2] Minor improvements to b53 dmesg output Paul Barker
  2020-09-03 11:26 ` [PATCH 1/2] net: dsa: b53: Use dev_{err,info} instead of pr_* Paul Barker
  2020-09-03 11:26 ` [PATCH 2/2] net: dsa: b53: Print err message on SW_RST timeout Paul Barker
@ 2020-09-03 19:07 ` David Miller
  2 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2020-09-03 19:07 UTC (permalink / raw)
  To: pbarker; +Cc: f.fainelli, andrew, vivien.didelot, netdev

From: Paul Barker <pbarker@konsulko.com>
Date: Thu,  3 Sep 2020 12:26:19 +0100

> 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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-09-03 19:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-03 11:26 [PATCH 0/2] Minor improvements to b53 dmesg output Paul Barker
2020-09-03 11:26 ` [PATCH 1/2] net: dsa: b53: Use dev_{err,info} instead of pr_* Paul Barker
2020-09-03 14:21   ` Florian Fainelli
2020-09-03 11:26 ` [PATCH 2/2] net: dsa: b53: Print err message on SW_RST timeout Paul Barker
2020-09-03 14:21   ` Florian Fainelli
2020-09-03 19:07 ` [PATCH 0/2] Minor improvements to b53 dmesg output David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.