[PATCH net-next 1/3] net: stmmac: dwmac-sun8i: allow controlling TX and RX flow control separately
From: Maxime Chevallier
Date: Sun Nov 22 2026 - 09:49:54 EST
Currently, the sun8i flow control setup only looks at FLOW_AUTO (which
is FLOW_RX | FLOW_TX), and enables RX/TX based on that.
Allow enabling RX/TX flow control directions separately.
Signed-off-by: Maxime Chevallier <maxime.chevallier@xxxxxxxxxxx>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
index 2ece7ba9dd73..c63f4d87de50 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
@@ -760,14 +760,14 @@ static void sun8i_dwmac_flow_ctrl(struct mac_device_info *hw,
u32 v;
v = readl(ioaddr + EMAC_RX_CTL0);
- if (fc == FLOW_AUTO)
+ if (fc & FLOW_RX)
v |= EMAC_RX_FLOW_CTL_EN;
else
v &= ~EMAC_RX_FLOW_CTL_EN;
writel(v, ioaddr + EMAC_RX_CTL0);
v = readl(ioaddr + EMAC_TX_FLOW_CTL);
- if (fc == FLOW_AUTO)
+ if (fc & FLOW_TX)
v |= EMAC_TX_FLOW_CTL_EN;
else
v &= ~EMAC_TX_FLOW_CTL_EN;
--
2.56.1