]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: stmmac: xgmac: Fix TSA selection
authorJose Abreu <Jose.Abreu@synopsys.com>
Wed, 6 Nov 2019 15:02:59 +0000 (16:02 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Dec 2019 21:33:57 +0000 (22:33 +0100)
[ Upstream commit 97add93fbcfa566735d6a4b96684110d356ebd35 ]

When we change between Transmission Scheduling Algorithms, we need to
clear previous values so that the new chosen algorithm is correctly
selected.

Fixes: ec6ea8e3eee9 ("net: stmmac: Add CBS support in XGMAC2")
Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c

index 91d7dec2540a1da49f2b5d3d5cc763baad9d676b..341c7a70fc71ab35e4b73cc5ff30df8ffaf1aa5c 100644 (file)
@@ -196,6 +196,7 @@ static void dwxgmac2_config_cbs(struct mac_device_info *hw,
        writel(low_credit, ioaddr + XGMAC_MTL_TCx_LOCREDIT(queue));
 
        value = readl(ioaddr + XGMAC_MTL_TCx_ETS_CONTROL(queue));
+       value &= ~XGMAC_TSA;
        value |= XGMAC_CC | XGMAC_CBS;
        writel(value, ioaddr + XGMAC_MTL_TCx_ETS_CONTROL(queue));
 }