Re: [PATCH net v10 10/10] can: rockchip_canfd: serialize timecounter timestamp conversion

From: netdev-bot+sashiko

Date: Fri Nov 20 2026 - 19:02:44 EST


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@xxxxxxxxxxxxxxx` 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@xxxxxxxxxxxxxxx

[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@xxxxxxxxxxxxxxx # 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