From: netdev-bot+sashiko@kernel.org
To: mkl@pengutronix.de
Cc: mailhol@kernel.org, pfink@christ-es.de, eric@evenchick.com,
max@schneidersoft.net, wg@grandegger.com, kernel@pengutronix.de,
linux-can@vger.kernel.org, linux-kernel@vger.kernel.org,
shuangpeng.kernel@gmail.com, stable@vger.kernel.org,
vadim.fedorenko@linux.dev, kuba@kernel.org
Subject: Re: [PATCH can-next v7 6/6] can: gs_usb: properly shut down timestamp worker
Date: Mon, 16 Nov 2026 04:18:34 +0000 [thread overview]
Message-ID: <179480271415.3132.12503701210475918543@kernel.org> (raw)
In-Reply-To: <20261114-gs_usb-fixes-v7-6-58b6341b1c08@pengutronix.de>
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 gives the wrong reason for the change.
--
can: gs_usb: properly shut down timestamp worker
This commit disables the timestamp delayed work at init time, enables it
in gs_usb_timestamp_start(), and switches gs_usb_timestamp_stop() from
cancel_delayed_work_sync() to disable_delayed_work_sync().
> To avoid self-rescheduling of the timestamp worker, shut it down using
> disable_delayed_work_sync() instead of cancel_delayed_work_sync().
[Severity: Low]
Is this reason accurate? cancel_delayed_work_sync() already seems to
handle a self-requeueing work.
cancel_delayed_work_sync() goes through __cancel_work_sync(), and that
function always disables the work before it flushes. It only re-enables
the work after the callback has finished:
kernel/workqueue.c:__cancel_work_sync() {
...
ret = __cancel_work(work, cflags | WORK_CANCEL_DISABLE);
...
if (wq_online)
__flush_work(work, true);
if (!(cflags & WORK_CANCEL_DISABLE))
enable_work(work);
...
}
Suppose gs_usb_timestamp_work() requeues itself while the flush is
waiting:
drivers/net/can/usb/gs_usb.c:gs_usb_timestamp_work() {
...
schedule_delayed_work(&parent->timestamp,
GS_USB_TIMESTAMP_WORK_DELAY_SEC * HZ);
}
The work is still disabled at that point, so the requeue is rejected.
The kernel-doc for cancel_work_sync() also says it "can be used even if
the work re-queues itself".
The only other place that queues parent->timestamp is
gs_usb_timestamp_start(). It runs from gs_can_open() under RTNL, and
only when parent->active_channels == 0. Leaving the work enabled
between stop and start therefore does not appear to be reachable as a
bug.
The enable/disable count added by this patch looks balanced across the
init, start, stop, and open error paths.
The parent commit, "can: gs_usb: fix hardware timestamp state for mixed
channels" (Cc: stable), says this follow-up is needed to avoid
self-rescheduling the timestamp worker. It also says it was split out
to simplify backporting. Together, the two messages could suggest that
stable kernels without this patch still have a live self-rescheduling
bug. Older kernels also blocked the self-requeue during cancel, through
WORK_OFFQ_CANCELING.
Could the commit message describe this as cleanup or hardening, making
the stopped state explicit, rather than as a fix for self-rescheduling?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261114-gs_usb-fixes-v7-0-58b6341b1c08%40pengutronix.de
prev parent reply other threads:[~2026-11-16 4:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-14 15:17 [PATCH can-next v7 0/6] gs_usb: fixes Marc Kleine-Budde
2026-11-14 15:17 ` [PATCH can-next v7 1/6] can: gs_usb: gs_make_candev(): check can_rx_offload_add_manual() return value Marc Kleine-Budde
2026-11-14 15:17 ` [PATCH can-next v7 2/6] can: gs_usb: gs_usb_probe(): init netdev completely before register_candev() Marc Kleine-Budde
2026-11-14 15:17 ` [PATCH can-next v7 3/6] can: gs_usb: gs_usb_receive_bulk_callback(): check for overflow flag if SKB allocation fails Marc Kleine-Budde
2026-11-14 15:17 ` [PATCH can-next v7 4/6] can: gs_usb: gs_usb_receive_bulk_callback(): add missing call to can_rx_offload_irq_finish Marc Kleine-Budde
2026-11-14 15:17 ` [PATCH can-next v7 5/6] can: gs_usb: fix hardware timestamp state for mixed channels Marc Kleine-Budde
2026-11-16 4:18 ` netdev-bot+sashiko
2026-11-14 15:17 ` [PATCH can-next v7 6/6] can: gs_usb: properly shut down timestamp worker Marc Kleine-Budde
2026-11-16 4:18 ` netdev-bot+sashiko [this message]
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=179480271415.3132.12503701210475918543@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=eric@evenchick.com \
--cc=kernel@pengutronix.de \
--cc=kuba@kernel.org \
--cc=linux-can@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mailhol@kernel.org \
--cc=max@schneidersoft.net \
--cc=mkl@pengutronix.de \
--cc=pfink@christ-es.de \
--cc=shuangpeng.kernel@gmail.com \
--cc=stable@vger.kernel.org \
--cc=vadim.fedorenko@linux.dev \
--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
all inboxes | Powered by JetHome®