From: Andrew Lunn <andrew@lunn.ch>
To: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel@savoirfairelinux.com,
"David S. Miller" <davem@davemloft.net>,
Florian Fainelli <f.fainelli@gmail.com>,
Jason Cobham <jcobham@questertangent.com>
Subject: Re: [PATCH net-next] net: dsa: mv88e6xxx: debug ATU Age Time
Date: Mon, 13 Mar 2017 23:39:32 +0100 [thread overview]
Message-ID: <20170313223932.GC14183@lunn.ch> (raw)
In-Reply-To: <20170313192043.12478-1-vivien.didelot@savoirfairelinux.com>
On Mon, Mar 13, 2017 at 03:20:43PM -0400, Vivien Didelot wrote:
> 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 f6cd3c939da4..bac34737b096 100644
> --- a/drivers/net/dsa/mv88e6xxx/global1_atu.c
> +++ b/drivers/net/dsa/mv88e6xxx/global1_atu.c
> @@ -65,7 +65,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);
> +
Hi Vivien
You could put the dev_dbg before the mv88e6xxx_g1_write(), to keep the
code simpler. If this write fails, we expect a lot of other things to
go horribly wrong, so having one debug message being not quite accurate
is not important.
Andrew
next prev parent reply other threads:[~2017-03-13 22:39 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-13 19:20 [PATCH net-next] net: dsa: mv88e6xxx: debug ATU Age Time Vivien Didelot
2017-03-13 22:39 ` Andrew Lunn [this message]
2017-03-13 22:42 ` Florian Fainelli
2017-03-13 22:58 ` Andrew Lunn
2017-03-14 11:12 ` Matthias May
2017-03-14 12:05 ` Andrew Lunn
2017-03-14 13:56 ` Vivien Didelot
2017-03-14 14:18 ` Andrew Lunn
2017-03-28 18:13 ` Vivien Didelot
2017-03-29 4:55 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170313223932.GC14183@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=jcobham@questertangent.com \
--cc=kernel@savoirfairelinux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=vivien.didelot@savoirfairelinux.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.