42 lines
1.7 KiB
Diff
42 lines
1.7 KiB
Diff
From 20fc9c7818d49faa1d6587ac2da6cfdb1f4b94b3 Mon Sep 17 00:00:00 2001
|
|
From: Cunhao Lu <1579567540@qq.com>
|
|
Date: Fri, 31 Jul 2026 17:16:27 +0800
|
|
Subject: [PATCH 2/3] can: rockchip_canfd: retry the outstanding TX buffer
|
|
|
|
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>
|
|
---
|
|
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.34.1
|
|
|