🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
1 messages
1 total messages Started by Marc Kleine-Budde Thu, 15 Oct 2026 15:05
Re: [PATCH net v3] can: flexcan: flexcan_get_berr_counter: don't wakeup controller if interface is down
#3624
Author: Marc Kleine-Budde
Date: Thu, 15 Oct 2026 15:05
27 lines
9510 bytes
> [ ... 25 lines skipped ... ]
> diff --git a/drivers/net/can/flexcan/flexcan-core.c b/drivers/net/can/flexcan/flexcan-core.c
> index 30ae7c344a05..5903f450d30c 100644
> --- a/drivers/net/can/flexcan/flexcan-core.c
> +++ b/drivers/net/can/flexcan/flexcan-core.c
> @@ -765,6 +765,9 @@ static int flexcan_get_berr_counter(const struct net_device *dev,
>  	const struct flexcan_priv *priv = netdev_priv(dev);
>  	int err;
>
> +	if (!netif_running(dev))
> +		return 0;
> +

What about fixing it on the CAN netlink level? As far as I can see,
can_fill_info() is called with RTNL lock, so it should be fine to move
the check for netif_running() there.

>  	err = pm_runtime_resume_and_get(priv->dev);
>  	if (err < 0)
>  		return err;

regards,
Marc

-- 
Marc Kleine-Budde <mkl@pengutronix.de>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads