🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #13149

Re: [PATCH net v8 03/10] can: rockchip_canfd: retry the outstanding TX buffer

#13149
From: netdev-bot+sashiko
Date: Mon, 09 Nov 2026 11:37
75 lines
11088 bytes
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 for "can: rockchip_canfd: retry the
  outstanding TX buffer" states the user-visible failure ("the pending…

--

can: rockchip_canfd: retry the outstanding TX buffer

This patch changes rkcanfd_xmit_retry() so the erratum 6 retransmission
uses tx_tail instead of tx_head to pick the TX buffer. The goal is to retry
the frame that is still pending rather than the next free buffer. It is
tagged for stable with a Fixes: tag pointing at a5605d61c7dd.

> Use tx_tail to retry the outstanding buffer. Otherwise, the pending echo
> entry can remain incomplete and leave the TX queue stopped.

[Severity: Low]
The tx_tail indexing looks correct. The stable justification is harder to
check, though, because the stall described here depends on how the
hardware handles TX_REQ(n), and the commit message doesn't say.

The controller has one TX frame register window (RKCANFD_REG_FD_TXFRAMEINFO,
RKCANFD_REG_FD_TXID, RKCANFD_REG_FD_TXDATA0..) and two request bits. Every
frame is written into that shared window in rkcanfd_start_xmit() before
TX_REQ(tx_head) is issued.

rkcanfd_xmit_retry() has one caller, rkcanfd_rxstx_filter(). That caller
only gets that far when the nominal frame echo_skb[tx_tail] is EFF:

drivers/net/can/rockchip/rockchip_canfd-rx.c:rkcanfd_rxstx_filter() {
    ...
	if (!(cfd_nominal->can_id & CAN_EFF_FLAG) ||
	    (cfd_rx->can_id & CAN_EFF_FLAG))
		return 0;
    ...
	rkcanfd_xmit_retry(priv);
    ...
}

While the tail frame is EFF, no further frame can be queued:

drivers/net/can/rockchip/rockchip_canfd-tx.c:rkcanfd_get_effective_tx_free() {
    ...
	if (priv->devtype_data.quirks & RKCANFD_QUIRK_RK3568_ERRATUM_6 &&
	    rkcanfd_tx_tail_is_eff(priv))
		return 0;
    ...
}

So whenever the retry runs, exactly one frame should be pending, and it
should be the last frame written into the shared window.

If writing TX_REQ(n) latches the current window into buffer n, wouldn't the
old TX_REQ(tx_head) have resent the correct frame? The echo would then
match echo_skb[tx_tail] and completion would go ahead normally.

As far as I can tell, the stall only happens if buffer n keeps its old
contents and TX_REQ(n) resends them without reloading from the window.

Was the stall actually seen on hardware, or is this mainly making the slot
indexing consistent with the echo_skb[tx_tail] model? The Erratum 6 comment
in rockchip_canfd.h has a canfdtest reproducer, and a5605d61c7dd carries a
Tested-by for the depth-2 change.

Could the commit message say which TX_REQ(n) behaviour the fix relies on,
or add a Tested-by or reproducer, so stable backporters can judge it?

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261108-rockchip-canfd-restart-close-v8-0-3e7a23fd9eae%40qq.com
Technical Details
Message-ID: <179422426444.994134.7825659732864102594@kernel.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-359239-linux-kernel-netdev=dewy.ru
References: <20261108-rockchip-canfd-restart-close-v8-3-3e7a23fd9eae@qq.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-359239-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v8 03/10] can: rockchip_canfd: retry the outstanding TX buffer
Date: Mon, 09 Nov 2026 11:37:44 +0000
Organization: Usenet Network
Message-ID: <179422426444.994134.7825659732864102594@kernel.org>
References: <20261108-rockchip-canfd-restart-close-v8-3-3e7a23fd9eae@qq.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="341932"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:Oe/zAZHjHqaiwCIAyqRpQ1AijiI= sha256:q/mlM+kOTU3vRxWvZXHmzU3FqP82bA2L23BvPZ+Ylys=
	sha1:L2qHkkjCrp3cK9FMRN1l/EUTeto= sha256:l+qanxLLn4ilsys9r4nP7PzLpOsTheY4z8jO9xYt4/s=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 090DC1137B7; Mon,  9 Nov 2026 14:42:08 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id nMpm-jJ_3cXW;
	Mon,  9 Nov 2026 14:42:04 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-359239-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 5A48F1137A8; Mon,  9 Nov 2026 14:41:56 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 4920636D42; Mon,  9 Nov 2026 11:38:12 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794224282;
	b=L/VIBg6hmzB/FAI3iqFuMML0WOaIF2kzQxZbc9ukdJOMRbcgEhRjyKz6fST573SkRQyG
	 eKIWq7+UNC/D2ehGHQgL3dufuVIzcgLUwrR92ksDSyqSolaYSi/4aS/D7NY5n4RbnhfQD
	 ZJo8mrTP46GPJoxV7cZMbUf07eSoardEg+7CAZ2/b/hohvhGwDRnkgm405t0dvMtb/b6F
	 GS5w6isbelGfF5WoPeoJLhBcEjqDVirUnIOiYY8N+gRVXof59qcqh1UeMt4PU4VDVq3Jq
	 iN2JFUOuFl1TXTRvIgPmql+6tEfSP8CMqpAvtFatRN71M4K85C+h1+P2nosnCx/pQKQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794224282;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=2ViT3Yo4M3SsUpvja1R5K7/sF1YFo5i6DucfxLblQBU=;
	b=OaCePJhO1mb4ehRhiQFUQ5A8LYKBliD64rLslklmvvQ7rKiCenjAzZqZmEIbItXG88bK
	 lo+ZD7oJbVkA/d+qT0iiuljUB0lRI1kz21IefE+Cbf9IZx5voeZFYpfiAyhar/w2B/uHC
	 +7lDQlYOMtJa+n8sVEOhhYi37LoLKIYkkR1TYMTmhvFKiI/Sjq7pWcCCCMt/KOnddmser
	 FXG5KQuK9hBvEOd6/4fiD5p2sVRWnmpwhETDcTz8++0faxxBbV2xkrNWjRSNcLkN6rnMt
	 cVYWZw0QETb+Jr/7mbSXYOQck06JHa+TmADQNyyufGAvEw+SHiHHfjFlm+r5DMJ6D/A==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=BsNl7ZDe;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 6C176606D820;
	Mon,  9 Nov 2026 11:38:02 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=BsNl7ZDe
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794224266;
	b=o6Twq0hs2sIqjk3xA7J2QJC066THdPlOibG/TWghmeBPA7o0pHtHE3YudH8hGQXDAj4E
	 VnQRLfrYmznlV3tpGHI2KUmj+Wgc/F2SEcg/y+y+qFqC/AYldHNy/ebPYdHLefAXp2L/E
	 D2FCWhnvp7tk8JodpYHEA6rf7TwHzDyvGCpjE5wOYVSJmgfk6iNNFpX2acfNd4MrRt+Mt
	 ztZDcdZTpkxFwqSIXKR9lMDYHGfF0FsYkHSrQLhqSh0eyxc04kAQII/XIoWPye8Zn5Vlq
	 iA1M/IE2+7SHo0iUQG3o+uHyPFWsinbpBRX6BF23SXZWjzyM+mH54rnpojv+v3zKdbA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794224266;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=2ViT3Yo4M3SsUpvja1R5K7/sF1YFo5i6DucfxLblQBU=;
	b=Cj2OwRhU39mQR75Ur2nN9z8GWlmAjSs7m0rNcJI8XLsPzM2g+d0J2lGPkCUe+syG+MHc
	 EOKwJcjhGqtdDI1ObdeBeGxnbp0VAHCrrVyW5tVgcZ3PsdY59pGvmQ8LctYbQhrh8MlrC
	 r5Ec3j90qr0DcUL0WyCHbEq40LIEkug1rdDeYRD72sQUSXuYOYVV+reE5C7WeyDZDBDJw
	 MXvJI8HtmGBD8yiPSHOnrE/3WpWvXlcH1seLJ3TIrMIXjVTTBR5nBfC9f6yUltcxMwmFB
	 NEdlQzknJG47I296wCA3/Uoxo6bQ3C0DEDkGnQ8zNcXsTSigaIvRuix2o2h2WmnkYHQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=BsNl7ZDe;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 499A6606A330;
	Mon,  9 Nov 2026 11:37:46 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id D21341F0089F;
	Mon,  9 Nov 2026 11:37:44 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794224265;
	bh=2ViT3Yo4M3SsUpvja1R5K7/sF1YFo5i6DucfxLblQBU=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=BsNl7ZDeGyPFQKK2Sj1fAO+4RkRF1uiZ6sP5hR44G7QzyBrQ44q9NwfvOW/fxL2n6
	 1GgkdTCTfIHUWTTx+NhQtw/CVAybuER3+EHRhrGsmvVzn14YrIP9RG2aOMLXDapPfB
	 FTcDrtf/1N9pKXuB+yw2ztzN8T96RVDxGQnnzftygYfPR6rhvkqUEyUgtq2PKSUkvR
	 zkKXPatfQr+bwb57/ifJYEpOR9/QZqsHtrXWmEdCCHNZPT9JNCB6SY/bThhSbCYMbK
	 i8P762UuS7STpaLKdWxNs40zTEM5U939heEyAKA/tqh6mf9b9LN5u7HKTI45OKXUFm
	 CfMbFacbIj/wg==
X-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, netdev@vger.kernel.org,
 linux-doc@vger.kernel.org
X-In-Reply-To: <20261108-rockchip-canfd-restart-close-v8-3-3e7a23fd9eae@qq.com>
X-sashiko-severity: Low
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list