Linux kernel -stable discussions
 help / color / mirror / Atom feed
* Re: [PATCH can-next v9 08/13] can: gs_usb: gs_usb_receive_bulk_callback(): use dev_info() to print re-submit info messages
       [not found] <20261121-gs_usb-fixes-v9-8-db121d488945@pengutronix.de>
@ 2026-11-23 12:00 ` netdev-bot+sashiko
  0 siblings, 0 replies; only message in thread
From: netdev-bot+sashiko @ 2026-11-23 12:00 UTC (permalink / raw)
  To: mkl
  Cc: mailhol, pfink, eric, max, wg, kernel, linux-can,
	shuangpeng.kernel, stable, vadim.fedorenko, kuba

Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] In gs_usb_receive_bulk_callback() (drivers/net/can/usb/gs_usb.c),
  the patch replaces netdev_info() with dev_info_ratelimited() but…

--

can: gs_usb: gs_usb_receive_bulk_callback(): use dev_info() to print re-submit info messages

When an IN URB fails to re-submit before the network device is known,
gs_usb_receive_bulk_callback() used to call netdev_info() with a NULL
netdev. This patch logs against the USB device with
dev_info_ratelimited() instead. It also removes the NULL initialization
of the local netdev variable.

Closes: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260729102802.505168-1-mkl@pengutronix.de

> diff --git a/drivers/net/can/usb/gs_usb.c b/drivers/net/can/usb/gs_usb.c
> index 308daa2645ada..f49179cbd7876 100644
> --- a/drivers/net/can/usb/gs_usb.c
> +++ b/drivers/net/can/usb/gs_usb.c

[ ... ]

> @@ -820,8 +820,9 @@ static void gs_usb_receive_bulk_callback(struct urb *urb)
>  				netif_device_detach(parent->canch[rc]->netdev);
>  		}
>  	} else if (rc != -ESHUTDOWN && net_ratelimit()) {
> -		netdev_info(netdev, "failed to re-submit IN URB: %pe\n",
> -			    ERR_PTR(rc));
> +		dev_info_ratelimited(&parent->udev->dev,
> +				     "failed to re-submit IN URB: %pe\n",
> +				     ERR_PTR(rc));

[Severity: Low]
Is the net_ratelimit() check still needed here?

dev_info_ratelimited() already has its own per-callsite limiter through
dev_level_ratelimited() in include/linux/dev_printk.h:

	static DEFINE_RATELIMIT_STATE(_rs, DEFAULT_RATELIMIT_INTERVAL,
				      DEFAULT_RATELIMIT_BURST);
	if (__ratelimit(&_rs))
		dev_level(dev, fmt, ##__VA_ARGS__);

That means this message now goes through two rate limiters. If
net_ratelimit() returns true but the local limiter suppresses the print,
a token from the global networking budget is used up and nothing gets
printed.

The short-read message earlier in the same function also logs against
the USB device, and it uses only the dev_*_ratelimited() helper:

	if (urb->actual_length < minimum_length) {
		dev_err_ratelimited(&parent->udev->dev,
				    "short read (actual_length=%u, minimum_length=%u)\n",
				    urb->actual_length, minimum_length);

Should this site drop the "&& net_ratelimit()" part to match?

The commit message also doesn't quite match the code:

  "and also rate limit the number of messages to prevent log flooding."

net_ratelimit() was already limiting this message before the patch, so
the patch doesn't add rate limiting here. The subject says "use
dev_info()", but the code uses dev_info_ratelimited().

The duplicate limiting is also still present at the end of the series.

>  	}
>  }
>

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261121-gs_usb-fixes-v9-0-db121d488945%40pengutronix.de

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-23 12:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20261121-gs_usb-fixes-v9-8-db121d488945@pengutronix.de>
2026-11-23 12:00 ` [PATCH can-next v9 08/13] can: gs_usb: gs_usb_receive_bulk_callback(): use dev_info() to print re-submit info messages netdev-bot+sashiko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox