mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Cunhao Lu" <1579567540@qq.com>
To: netdev-bot+sashiko <netdev-bot+sashiko@kernel.org>
Cc: mkl <mkl@pengutronix.de>, kernel <kernel@pengutronix.de>,
	mailhol <mailhol@kernel.org>, heiko <heiko@sntech.de>,
	socketcan <socketcan@hartkopp.net>, davem <davem@davemloft.net>,
	edumazet <edumazet@kernel.org>, kuba <kuba@kernel.org>,
	pabeni <pabeni@redhat.com>, horms <horms@kernel.org>,
	corbet <corbet@lwn.net>, skhan <skhan@linuxfoundation.org>,
	rdunlap <rdunlap@infradead.org>, wg <wg@grandegger.com>,
	linux-can <linux-can@vger.kernel.org>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	linux-rockchip <linux-rockchip@lists.infradead.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-doc <linux-doc@vger.kernel.org>,
	stable <stable@vger.kernel.org>
Subject: Re: [PATCH net v9 08/10] can: rockchip_canfd: serialize TX with bus-off and restart
Date: Fri, 13 Nov 2026 13:15:24 +0800	[thread overview]
Message-ID: <tencent_AD03F810B3FDBC9A3A69DA65641264469409@qq.com> (raw)
In-Reply-To: <179452273462.488853.12444870521885218967@kernel.org>

Hi,

> [Severity: Medium]
> Is irq_suspended working as a lock here?

The flag is an IRQ entry gate used with device interrupt masking and
synchronize_irq(). During restart, the driver masks and flushes device
interrupts, sets the flag, then drains handlers before reinitialization.
In this tree, the IRQ descriptor lock used by synchronization and
dispatch orders the flag store against later handler entry. The
release-clear publishes the initialized state to the handler's
acquire-load.

Open sets the gate before request_irq(), when no previous handler is
registered, so there is no old handler to drain there. TX and timecounter
state have their own locks. The BEC getter is outside this IRQ protocol;
its cache synchronization issue predates the patch. I have not found a
concrete new race in this sequence that warrants replacing the gate with
another lock.

> [Severity: Low]
> Is the CAN core known to be out of reset when this INT_MASK write
> arrives?
> ...
> Should there be a short settle delay after deassertion, or a check of the
> read-back value?

On RK3588 rev2.2, I tested 300 reset samples per controller, 600 in total,
covering open, close and direct restart callbacks while idle. The tests
preserved the production order: deassert, write 0x7fff, then first
readback, with no extra MMIO, logging or delay before that write. Every
first readback was 0x3fff; bit 14 consistently read as zero and was not
mistaken for a lost write.

These tests found no lost first mask write or evidence that this change
introduces or worsens the suspected problem.

Best regards,
Cunhao Lu

  reply	other threads:[~2026-11-13  5:15 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-11  6:17 [PATCH net v9 00/10] can: fix Rockchip TX stalls and bus-off restart/close races Cunhao Lu via B4 Relay
2026-11-11  6:17 ` [PATCH net v9 01/10] can: rockchip_canfd: prevent TX stall on echo skb failure Cunhao Lu via B4 Relay
2026-11-12 22:32   ` netdev-bot+sashiko
2026-11-11  6:17 ` [PATCH net v9 02/10] can: rockchip_canfd: serialize TX state and command writes Cunhao Lu via B4 Relay
2026-11-12 22:32   ` netdev-bot+sashiko
2026-11-11  6:17 ` [PATCH net v9 03/10] can: rockchip_canfd: retry the outstanding TX buffer Cunhao Lu via B4 Relay
2026-11-12 22:32   ` netdev-bot+sashiko
2026-11-11  6:17 ` [PATCH net v9 04/10] can: dev: check netif_running() before bus-off recovery Cunhao Lu via B4 Relay
2026-11-12 22:32   ` netdev-bot+sashiko
2026-11-13  5:08     ` Cunhao Lu
2026-11-11  6:17 ` [PATCH net v9 05/10] can: dev: add close_candev_cancel_restart_sync() Cunhao Lu via B4 Relay
2026-11-12 22:32   ` netdev-bot+sashiko
2026-11-11  6:18 ` [PATCH net v9 06/10] can: rockchip_canfd: cancel bus-off restart before closing the device Cunhao Lu via B4 Relay
2026-11-12 22:32   ` netdev-bot+sashiko
2026-11-11  6:18 ` [PATCH net v9 07/10] can: rockchip_canfd: disable RX offload on open failure Cunhao Lu via B4 Relay
2026-11-11  6:18 ` [PATCH net v9 08/10] can: rockchip_canfd: serialize TX with bus-off and restart Cunhao Lu via B4 Relay
2026-11-12 22:32   ` netdev-bot+sashiko
2026-11-13  5:15     ` Cunhao Lu [this message]
2026-11-11  6:18 ` [PATCH net v9 09/10] can: rockchip_canfd: prevent timestamp work from rearming after bus-off Cunhao Lu via B4 Relay
2026-11-12 22:32   ` netdev-bot+sashiko
2026-11-11  6:18 ` [PATCH net v9 10/10] can: rockchip_canfd: serialize timecounter timestamp conversion Cunhao Lu via B4 Relay

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=tencent_AD03F810B3FDBC9A3A69DA65641264469409@qq.com \
    --to=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=netdev-bot+sashiko@kernel.org \
    --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

all inboxes | Powered by JetHome®