Linux-Can Archive mirror
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Vincent MAILHOL <mailhol.vincent@wanadoo.fr>
Cc: Stephane Grosjean <s.grosjean@peak-system.com>,
	 linux-can Mailing List <linux-can@vger.kernel.org>
Subject: Re: [PATCH v2] can: peak_usb: fix potential kernel log flooding
Date: Mon, 19 Feb 2024 13:31:44 +0100	[thread overview]
Message-ID: <20240219-marvelous-unkempt-ea6e6174d3f4-mkl@pengutronix.de> (raw)
In-Reply-To: <CAMZ6RqLknp_R+5_UgkMS20R_usP6+c7ywtzHKnQXo4AWroMgHQ@mail.gmail.com>

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

On 18.02.2024 01:10:44, Vincent MAILHOL wrote:
> On Fri. 16 Feb. 2024, 22:57, Stephane Grosjean
> <s.grosjean@peak-system.com> wrote:
> >
> > In rare cases of very high bus load, the firmware of the PEAK-System
> > PCAN-USB Pro FD HW v4 can generate messages warning that the receive cache
> > capacity is about to be exceeded. This modification prevents the driver
> > from flooding the kernel log with messages and memory dumps that are far
> > too verbose in such cases, by limiting their production to once for all.
> >
> > Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com>
> > ---
> >  drivers/net/can/usb/peak_usb/pcan_usb_fd.c | 21 +++++++++++++++++++++
> >  1 file changed, 21 insertions(+)
> >
> > diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_fd.c b/drivers/net/can/usb/peak_usb/pcan_usb_fd.c
> > index a1c339716776..aa0b68c1ae81 100644
> > --- a/drivers/net/can/usb/peak_usb/pcan_usb_fd.c
> > +++ b/drivers/net/can/usb/peak_usb/pcan_usb_fd.c
> > @@ -667,6 +667,19 @@ static int pcan_usb_fd_decode_error(struct pcan_usb_fd_if *usb_if,
> >         return 0;
> >  }
> >
> > +/* Handle uCAN Rx cache warning messages.
> > + *
> > + * Such messages SHOULD NOT occur. If they do, then this might come from
> > + * massive PING host flooding that prevents PCAN-USB Pro FD HW v4 to handle
> > + * CAN traffic anymore.
> > + */
> > +static void pcan_usb_fd_handle_rx_cache_warn(struct peak_usb_device *dev,
> > +                                            struct pucan_msg *rx_msg)
>                                                                  ^^^^^^
> 
> That rx_msg parameter is unused.
> 
> Do you think it is worth keeping that
> pcan_usb_fd_handle_rx_cache_warn() function? Wouldn't it be easier to
> directly call netdev_warn_once() from pcan_usb_fd_decode_buf()?

+1

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:[~2024-02-19 12:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-16 13:55 [PATCH v2] can: peak_usb: fix potential kernel log flooding Stephane Grosjean
2024-02-17 16:10 ` Vincent MAILHOL
2024-02-19 12:31   ` Marc Kleine-Budde [this message]

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=20240219-marvelous-unkempt-ea6e6174d3f4-mkl@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=linux-can@vger.kernel.org \
    --cc=mailhol.vincent@wanadoo.fr \
    --cc=s.grosjean@peak-system.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).