Re: [PATCH net v6 1/6] can: dev: prevent bus-off recovery when the interface is not running

From: Cunhao Lu

Date: Wed Nov 04 2026 - 02:52:38 EST


Hi,

> Does this check actually close the window the subject line describes?

No. The checks reject recovery that observes the interface down, but do
not serialize recovery with close. The FlexCAN teardown race and the
HI3110 stale-work case are real, pre-existing issues. This patch narrows
their entry windows without closing them. Rockchip's early cancellation
and final cancellation after IRQ teardown do not fix other drivers.

> Can restart_work still be queued after close_candev() and then
> outlive the net_device?

Yes. HI3110's IRQ thread can retain a true running snapshot across the
cancel, then queue the core work before free_irq() finishes. Removal has
no later cancellation of that work. Destroying the driver's private
workqueue does not drain the core restart work on the system workqueue.
Checking netif_running() from the callback cannot protect freed memory.

Best regards,
Cunhao Lu