Linux-Can Archive mirror
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Vincent Mailhol <vincent.mailhol@gmail.com>
Cc: linux-can <linux-can@vger.kernel.org>, kernel@pengutronix.de
Subject: Re: [PATCH 4/5] can: dev: can_restart(): update debug and error messages
Date: Wed, 4 Oct 2023 15:13:54 +0200	[thread overview]
Message-ID: <20231004-radio-synthesis-8f8fd49bafbf-mkl@pengutronix.de> (raw)
In-Reply-To: <CAMZ6RqLebgso6rRbYgeSwp5YaeoUs3gSSDH6Wta=aAOweM3kRQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1837 bytes --]

On 04.10.2023 22:03:01, Vincent Mailhol wrote:
> On Wed. 4 Oct. 2023 at 21:05, Marc Kleine-Budde <mkl@pengutronix.de> wrote:
> > On 04.10.2023 13:33:59, Marc Kleine-Budde wrote:
> > > On 04.10.2023 19:44:15, Vincent Mailhol wrote:
> > > > On Wed. 4 Oct. 2023, 18:18, Marc Kleine-Budde <mkl@pengutronix.de> wrote:
> > > > >
> > > > > Update the debug message from "restarted" to "Attempting restart", as
> > > > > it is actually printed _before_ restarting the CAN device, and that
> > > > > restart may fail.
> > > > >
> > > > > Also update the error message from printing the error number to
> > > > > printing symbolic error names.
> > > > >
> > > > > Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> > > > > ---
> > > > >  drivers/net/can/dev/dev.c | 4 ++--
> > > > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > > > >
> > > > > diff --git a/drivers/net/can/dev/dev.c b/drivers/net/can/dev/dev.c
> > > > > index 9014256c486a..8e4054e2abcc 100644
> > > > > --- a/drivers/net/can/dev/dev.c
> > > > > +++ b/drivers/net/can/dev/dev.c
> > > > > @@ -147,14 +147,14 @@ static void can_restart(struct net_device *dev)
> > > > >                 netif_rx(skb);
> > > > >         }
> > > > >
> > > > > -       netdev_dbg(dev, "restarted\n");
> > > > > +       netdev_dbg(dev, "Attempting restart\n");
> > > > >         priv->can_stats.restarts++;
> >
> > What about that counter? Also move it into the no-error case?
> 
> Indeed. It makes sense to only increment if the restart actually occurred.

Also moved.

Thanks,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde          |
Embedded Linux                   | https://www.pengutronix.de |
Vertretung Nürnberg              | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-9   |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2023-10-04 13:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-04  9:17 [PATCH 0/5] can: dev: fix can_restart() and replace BUG_ON() by error handling Marc Kleine-Budde
2023-10-04  9:17 ` [PATCH 1/5] can: dev: can_restart(): don't crash kernel if carrier is OK Marc Kleine-Budde
2023-10-04  9:17 ` [PATCH 2/5] can: dev: can_restart(): fix race condition between controller restart and netif_carrier_on() Marc Kleine-Budde
2023-10-04  9:17 ` [PATCH 3/5] can: dev: can_restart(): reverse logic to remove need for goto Marc Kleine-Budde
2023-10-04  9:17 ` [PATCH 4/5] can: dev: can_restart(): update debug and error messages Marc Kleine-Budde
2023-10-04 10:44   ` Vincent Mailhol
2023-10-04 11:33     ` Marc Kleine-Budde
2023-10-04 12:05       ` Marc Kleine-Budde
2023-10-04 13:03         ` Vincent Mailhol
2023-10-04 13:13           ` Marc Kleine-Budde [this message]
2023-10-04  9:17 ` [PATCH 5/5] can: dev: can_put_echo_skb(): don't crash kernel if can_priv::echo_skb is accessed out of bounds Marc Kleine-Budde

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=20231004-radio-synthesis-8f8fd49bafbf-mkl@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=kernel@pengutronix.de \
    --cc=linux-can@vger.kernel.org \
    --cc=vincent.mailhol@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).