From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx1.white.stw.pengutronix.de (mx1.white.stw.pengutronix.de [185.203.200.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C9EAD3BFAF7; Wed, 26 Aug 2026 12:10:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.200.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787746252; cv=none; b=jiXwDakjU7SBVwWH5HH310q5Fr1sUJWs6m0F5mEvn6aXp3YNm04kd3chf0qOQBLCZ8G+ncgBAcpM5nfkXtL9T2k7mbJNn43udJysDGVxuWkFpG05K+zEHTQvwe+C3RoDdxKVmIgtlVnZcsppdXFyMQ9aBn7CHzCpvRk/lmfG9Ds= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787746252; c=relaxed/simple; bh=O6rCarU79GtS2+kUAgaj4XkFMBVGh+LEuW8xWRiNYl8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=S28LWC1UXSqxWVIfghyaZQZJ1crIYvP6TmIhXHoz2jhr7T+JXqvfRDSaxYJknngKZsKP4lxTuwOVc1YCwjjN2VoDX/kxLYIKlaFQn1Zw+7p7UlsilOR6L78OLYDcSEGrc1MtMGc/0exRrtlHCJG0dNezrzVmPEKyzP4xRK/MN3U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.200.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de (drehscheibe.grey.stw.pengutronix.de [IPv6:2a0a:edc0:0:c01:1d::a2]) (Authenticated sender: relay-from-drehscheibe.grey.stw.pengutronix.de) by mx1.white.stw.pengutronix.de (Postfix) with ESMTPSA id C6DB12021DE; Wed, 26 Aug 2026 14:10:38 +0200 (CEST) Received: from moin.white.stw.pengutronix.de ([2a0a:edc0:0:b01:1d::7b] helo=bjornoya.blackshift.org) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wzCSk-003R92-2I; Wed, 26 Aug 2026 14:10:38 +0200 Received: from blackshift.org (p4ffb23c7.dip0.t-ipconnect.de [79.251.35.199]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519MLKEM768 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: mkl-all@blackshift.org) by smtp.blackshift.org (Postfix) with ESMTPSA id 6B73B58CCFD; Wed, 26 Aug 2026 12:10:38 +0000 (UTC) From: Marc Kleine-Budde To: netdev@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, linux-can@vger.kernel.org, kernel@pengutronix.de, Cunhao Lu <1579567540@qq.com>, stable@vger.kernel.org, Marc Kleine-Budde Subject: [PATCH net 06/14] can: rockchip_canfd: retry the outstanding TX buffer Date: Wed, 26 Aug 2026 14:02:16 +0200 Message-ID: <20260826121036.2706424-7-mkl@pengutronix.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260826121036.2706424-1-mkl@pengutronix.de> References: <20260826121036.2706424-1-mkl@pengutronix.de> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Cunhao Lu <1579567540@qq.com> rkcanfd_xmit_retry() originally operated with a TX FIFO depth of one. At that depth, the masked head and tail indices both select buffer 0, so using tx_head happened to select the correct buffer. After the FIFO depth was increased to two, tx_head instead identifies the next free buffer when one frame is outstanding. The erratum 6 workaround therefore requests transmission from the wrong buffer, leaving the outstanding echo entry incomplete and the netdev TX queue stopped. Use tx_tail to select the outstanding buffer for retransmission. Fixes: a5605d61c7dd ("can: rockchip_canfd: enable full TX-FIFO depth of 2") Cc: stable@vger.kernel.org Signed-off-by: Cunhao Lu <1579567540@qq.com> Link: https://patch.msgid.link/tencent_2CCE005FC440BF8026599A6999EC04BE1107@qq.com Signed-off-by: Marc Kleine-Budde --- drivers/net/can/rockchip/rockchip_canfd-tx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/can/rockchip/rockchip_canfd-tx.c b/drivers/net/can/rockchip/rockchip_canfd-tx.c index 86fa8f2e1c8b..fc338ea865fe 100644 --- a/drivers/net/can/rockchip/rockchip_canfd-tx.c +++ b/drivers/net/can/rockchip/rockchip_canfd-tx.c @@ -57,8 +57,8 @@ static void rkcanfd_start_xmit_write_cmd(const struct rkcanfd_priv *priv, void rkcanfd_xmit_retry(struct rkcanfd_priv *priv) { - const unsigned int tx_head = rkcanfd_get_tx_head(priv); - const u32 reg_cmd = RKCANFD_REG_CMD_TX_REQ(tx_head); + const unsigned int tx_tail = rkcanfd_get_tx_tail(priv); + const u32 reg_cmd = RKCANFD_REG_CMD_TX_REQ(tx_tail); rkcanfd_start_xmit_write_cmd(priv, reg_cmd); } -- 2.53.0