On 18.02.2024 01:10:44, Vincent MAILHOL wrote: > On Fri. 16 Feb. 2024, 22:57, Stephane Grosjean > <s.grosjean@xxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxx> > > --- > > 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:
signature.asc
Description: PGP signature