From: netdev-bot+sashiko@kernel.org
To: 1579567540@qq.com
Cc: mkl@pengutronix.de, kernel@pengutronix.de, mailhol@kernel.org,
heiko@sntech.de, socketcan@hartkopp.net, davem@davemloft.net,
edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
horms@kernel.org, corbet@lwn.net, skhan@linuxfoundation.org,
rdunlap@infradead.org, wg@grandegger.com,
linux-can@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org,
linux-doc@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH net v10 05/10] can: rockchip_canfd: cancel bus-off restart before closing the device
Date: Sat, 21 Nov 2026 00:02:19 +0000 [thread overview]
Message-ID: <179521933978.3131.189047644390163242@kernel.org> (raw)
In-Reply-To: <20261119-rockchip-canfd-restart-close-v10-5-df23913aa33a@qq.com>
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] The commit message says late restart work (queued by a bus-off
IRQ after the early close_candev_cancel_restart_sync() in…
--
can: rockchip_canfd: cancel bus-off restart before closing the device
This patch adds a call to close_candev_cancel_restart_sync() at the start
of rkcanfd_stop(), so that a running bus-off restart is cancelled while
the IRQ, RX offload and controller are still available. Echo cleanup and
the final restart cancellation stay in close_candev().
> A bus-off IRQ can pass the scheduling check before close, then queue
> restart work after the early cancellation. The final cancellation after
> free_irq() drains that late work so it cannot survive close.
[Severity: Low]
Is this explanation complete? Late-queued restart work does not have to
wait for the final cancel. With a short restart_ms it can run anywhere
between the early cancel and close_candev().
That window covers rkcanfd_chip_interrupts_disable(), free_irq(),
can_rx_offload_disable() and rkcanfd_chip_stop_sync(). The final
cancel_delayed_work_sync() in close_candev() can't undo a restart that
has already run there.
In that window, only this check in can_restart() stops the restart:
drivers/net/can/dev/dev.c:can_restart() {
...
if (!netif_running(dev))
return -ENETDOWN;
...
}
Without that check, the work would reach rkcanfd_set_mode():
case CAN_MODE_START:
rkcanfd_chip_start(priv);
rkcanfd_chip_interrupts_enable(priv);
netif_wake_queue(ndev);
That check, and the "scheduling check" in can_bus_off():
restart = priv->restart_ms && netif_running(dev);
both come from the earlier patch in this series, "can: dev: check
netif_running() before bus-off recovery".
Neither the commit message nor the Cc: stable tag names that dependency.
The patch only needs "can: dev: add close_candev_cancel_restart_sync()"
to build. So a backport that takes this patch and the helper, but not
the netif_running() patch, would build cleanly and still have the
restart-after-teardown race.
Could the commit message say that late work which runs before the final
cancel is stopped by the netif_running() check in can_restart()? Could
the netif_running() patch also be listed as a stable prerequisite?
> diff --git a/drivers/net/can/rockchip/rockchip_canfd-core.c b/drivers/net/can/rockchip/rockchip_canfd-core.c
> index 1cae86973da5a..59a79fe057e66 100644
> --- a/drivers/net/can/rockchip/rockchip_canfd-core.c
> +++ b/drivers/net/can/rockchip/rockchip_canfd-core.c
> @@ -758,6 +758,7 @@ static int rkcanfd_stop(struct net_device *ndev)
> {
> struct rkcanfd_priv *priv = netdev_priv(ndev);
>
> + close_candev_cancel_restart_sync(ndev);
> netif_stop_queue(ndev);
>
> rkcanfd_chip_interrupts_disable(priv);
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261119-rockchip-canfd-restart-close-v10-0-df23913aa33a%40qq.com
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
next prev parent reply other threads:[~2026-11-21 0:02 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 8:39 [PATCH net v10 00/10] can: fix Rockchip TX stalls and bus-off restart/close races Cunhao Lu via B4 Relay
2026-11-19 8:39 ` [PATCH net v10 01/10] can: rockchip_canfd: prevent TX stall on echo skb failure Cunhao Lu via B4 Relay
2026-11-19 8:39 ` [PATCH net v10 02/10] can: rockchip_canfd: serialize TX state and command writes Cunhao Lu via B4 Relay
2026-11-19 8:39 ` [PATCH net v10 03/10] can: dev: check netif_running() before bus-off recovery Cunhao Lu via B4 Relay
2026-11-19 8:39 ` [PATCH net v10 04/10] can: dev: add close_candev_cancel_restart_sync() Cunhao Lu via B4 Relay
2026-11-19 8:39 ` [PATCH net v10 05/10] can: rockchip_canfd: cancel bus-off restart before closing the device Cunhao Lu via B4 Relay
2026-11-21 0:02 ` netdev-bot+sashiko [this message]
2026-11-19 8:39 ` [PATCH net v10 06/10] can: rockchip_canfd: disable RX offload on open failure Cunhao Lu via B4 Relay
2026-11-19 8:39 ` [PATCH net v10 07/10] can: rockchip_canfd: serialize TX with bus-off and restart Cunhao Lu via B4 Relay
2026-11-21 0:02 ` netdev-bot+sashiko
2026-11-19 8:39 ` [PATCH net v10 08/10] can: rockchip_canfd: retry the outstanding TX buffer Cunhao Lu via B4 Relay
2026-11-21 0:02 ` netdev-bot+sashiko
2026-11-19 8:39 ` [PATCH net v10 09/10] can: rockchip_canfd: prevent timestamp work from rearming after bus-off Cunhao Lu via B4 Relay
2026-11-19 8:39 ` [PATCH net v10 10/10] can: rockchip_canfd: serialize timecounter timestamp conversion Cunhao Lu via B4 Relay
2026-11-21 0:02 ` netdev-bot+sashiko
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=179521933978.3131.189047644390163242@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=1579567540@qq.com \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=heiko@sntech.de \
--cc=horms@kernel.org \
--cc=kernel@pengutronix.de \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-can@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=mailhol@kernel.org \
--cc=mkl@pengutronix.de \
--cc=pabeni@redhat.com \
--cc=rdunlap@infradead.org \
--cc=skhan@linuxfoundation.org \
--cc=socketcan@hartkopp.net \
--cc=stable@vger.kernel.org \
--cc=wg@grandegger.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