All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND net-next] net: dsa: mv88e6xxx: debug ATU Age Time
@ 2017-03-29 19:38 Vivien Didelot
  2017-03-30 22:35 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Vivien Didelot @ 2017-03-29 19:38 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, kernel, David S. Miller, Florian Fainelli,
	Andrew Lunn, Jason Cobham, Vivien Didelot

The ATU ageing time value programmed in the switch is rounded up to the
nearest multiple of its coefficient (variable depending on the model.)

Add a debug message to inform the user about the exact programmed value.

On 6352, "brctl setageing br0 18" gives "AgeTime set to 0x01 (15000 ms)"
while on 6390 we get "AgeTime set to 0x05 (18750 ms)".

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
---
 drivers/net/dsa/mv88e6xxx/global1_atu.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/net/dsa/mv88e6xxx/global1_atu.c b/drivers/net/dsa/mv88e6xxx/global1_atu.c
index 492e00dea3ce..fa7e7db5171b 100644
--- a/drivers/net/dsa/mv88e6xxx/global1_atu.c
+++ b/drivers/net/dsa/mv88e6xxx/global1_atu.c
@@ -63,7 +63,14 @@ int mv88e6xxx_g1_atu_set_age_time(struct mv88e6xxx_chip *chip,
 	val &= ~0xff0;
 	val |= age_time << 4;
 
-	return mv88e6xxx_g1_write(chip, GLOBAL_ATU_CONTROL, val);
+	err = mv88e6xxx_g1_write(chip, GLOBAL_ATU_CONTROL, val);
+	if (err)
+		return err;
+
+	dev_dbg(chip->dev, "AgeTime set to 0x%02x (%d ms)\n", age_time,
+		age_time * coeff);
+
+	return 0;
 }
 
 /* Offset 0x0B: ATU Operation Register */
-- 
2.12.1

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

* Re: [PATCH RESEND net-next] net: dsa: mv88e6xxx: debug ATU Age Time
  2017-03-29 19:38 [PATCH RESEND net-next] net: dsa: mv88e6xxx: debug ATU Age Time Vivien Didelot
@ 2017-03-30 22:35 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-03-30 22:35 UTC (permalink / raw)
  To: vivien.didelot; +Cc: netdev, linux-kernel, kernel, f.fainelli, andrew, jcobham

From: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Date: Wed, 29 Mar 2017 15:38:37 -0400

> The ATU ageing time value programmed in the switch is rounded up to the
> nearest multiple of its coefficient (variable depending on the model.)
> 
> Add a debug message to inform the user about the exact programmed value.
> 
> On 6352, "brctl setageing br0 18" gives "AgeTime set to 0x01 (15000 ms)"
> while on 6390 we get "AgeTime set to 0x05 (18750 ms)".
> 
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>

Applied.

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

end of thread, other threads:[~2017-03-30 22:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-29 19:38 [PATCH RESEND net-next] net: dsa: mv88e6xxx: debug ATU Age Time Vivien Didelot
2017-03-30 22:35 ` 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.