rtase: Fix flow control configuration
Subsystems (3)
Justin Lai
maintainerPATCH v2 1/1 rtase: Fix flow control configuration
The hardware has two sets of registers controlling TX/RX flow control. The effective flow control state is determined by the logical OR of these two sets of bits.
RTASE_FORCE_TXFLOW_EN and RTASE_FORCE_RXFLOW_EN in RTASE_CPLUS_CMD are the bits used by the driver to control TX/RX flow control according to the ethtool pause configuration.
RTASE_TXFLOW_EN and RTASE_RXFLOW_EN in RTASE_GPHY_STD_00 are another set of TX/RX flow control enable bits. Clear them by default so they do not keep flow control enabled independently of the driver setting.
With the RTASE_GPHY_STD_00 bits cleared, the effective flow control state is controlled through RTASE_CPLUS_CMD, so the ethtool setting can take effect correctly.
---
v1 -> v2:
- Rebase onto net-next.
- Expand commit message.
--- drivers/net/ethernet/realtek/rtase/rtase.h | 4 ++++ drivers/net/ethernet/realtek/rtase/rtase_main.c | 3 +++ 2 files changed, 7 insertions(+)
drivers/net/ethernet/realtek/rtase/rtase.h +4 -0
@@ -153,6 +153,10 @@ enum rtase_registers {#define RTASE_FORCE_TXFLOW_EN BIT(10)#define RTASE_RX_CHKSUM BIT(5) + RTASE_GPHY_STD_00 = 0x6024, +#define RTASE_RXFLOW_EN BIT(7) +#define RTASE_TXFLOW_EN BIT(6) +RTASE_Q0_RX_DESC_ADDR0 =0x00E4 ,RTASE_Q0_RX_DESC_ADDR4 =0x00E8 , RTASE_Q1_RX_DESC_ADDR0 = 0x4000,
drivers/net/ethernet/realtek/rtase/rtase_main.c +3 -0
@@ -974,6 +974,9 @@ static void rtase_hw_config(struct net_device *dev)rtase_hw_set_features (dev, dev->features);/* enable flow control */ + reg_data16 =rtase_r16 (tp,RTASE_GPHY_STD_00 ); + reg_data16 &= ~(RTASE_TXFLOW_EN |RTASE_RXFLOW_EN ); +rtase_w16 (tp,RTASE_GPHY_STD_00 , reg_data16); reg_data16 =rtase_r16 (tp,RTASE_CPLUS_CMD ); reg_data16 |= (RTASE_FORCE_TXFLOW_EN |RTASE_FORCE_RXFLOW_EN );rtase_w16 (tp,RTASE_CPLUS_CMD , reg_data16);
Signature · 1 line
2.40.1
Quoted 3 lines · Justin Lai
The hardware has two sets of registers controlling TX/RX flow control. The effective flow control state is determined by the logical OR of these two sets of bits.
Odd design.
Andrew
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Tue, 5 May 2026 14:41:21 +0800 you wrote:
The hardware has two sets of registers controlling TX/RX flow control. The effective flow control state is determined by the logical OR of these two sets of bits.
RTASE_FORCE_TXFLOW_ENandRTASE_FORCE_RXFLOW_ENinRTASE_CPLUS_CMDare the bits used by the driver to control TX/RX flow control according to the ethtool pause configuration.[...]
Here is the summary with links:
- [net-next,v2] rtase: Fix flow control configuration
https://git.kernel.org/netdev/net-next/c/fea3521e043f
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html