Linux kernel -stable discussions
 help / color / mirror / Atom feed
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 10/10] can: rockchip_canfd: serialize timecounter timestamp conversion
Date: Sat, 21 Nov 2026 00:02:25 +0000	[thread overview]
Message-ID: <179521934595.3131.13988876249908602124@kernel.org> (raw)
In-Reply-To: <20261119-rockchip-canfd-restart-close-v10-10-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 patch is tagged `Cc: stable@vger.kernel.org` with `Fixes:
  4e1a18bab124 ("can: rockchip_canfd: add hardware timestamping…

--

can: rockchip_canfd: serialize timecounter timestamp conversion

This commit holds priv->timestamp_lock around timecounter_cyc2time() in
rkcanfd_skb_set_timestamp(). That serializes the RX, TX completion and
error-frame timestamp conversion against timecounter_read() in the
timestamp worker. The comment on timestamp_lock in struct rkcanfd_priv is
also changed to say it protects tc and timestamp_active.

> Hold timestamp_lock across timecounter_cyc2time(), using the same lock
> as timecounter_read() and timecounter_init(). Keep the SKB timestamp
> assignment outside the critical section.

[ ... ]

> Fixes: 4e1a18bab124 ("can: rockchip_canfd: add hardware timestamping support")
> Cc: stable@vger.kernel.org

[Severity: Low]
Should the stable tag mention that this depends on the earlier patch in
the series, "can: rockchip_canfd: prevent timestamp work from rearming
after bus-off"?

The timestamp_lock and timestamp_active members of struct rkcanfd_priv are
not in 4e1a18bab124. The earlier patch adds them. It also puts
timecounter_read() in rkcanfd_timestamp_work() and timecounter_init() in
rkcanfd_timestamp_start() under the lock:

    spin_lock_irqsave(&priv->timestamp_lock, flags);
    if (priv->timestamp_active)
        timecounter_read(&priv->tc);
    spin_unlock_irqrestore(&priv->timestamp_lock, flags);

If this patch is picked on its own for a stable kernel that only has
4e1a18bab124, it will not build. A backporter could add just the lock to
get it building. timecounter_read() and timecounter_init() would still
not take that lock, so the race would stay open.

Other patches in the series list their stable prerequisites, for example
"# prerequisite for the Rockchip restart/close fix". Would something like
this work here?

    Cc: stable@vger.kernel.org # depends on "can: rockchip_canfd: prevent timestamp work from rearming after bus-off"

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261119-rockchip-canfd-restart-close-v10-0-df23913aa33a%40qq.com

      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
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 [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=179521934595.3131.13988876249908602124@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