]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.12.14/gianfar-fix-tx-flow-control-deactivation.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.12.14 / gianfar-fix-tx-flow-control-deactivation.patch
CommitLineData
9ac87053
GKH
1From foo@baz Thu Sep 14 23:20:23 PDT 2017
2From: Claudiu Manoil <claudiu.manoil@nxp.com>
3Date: Mon, 4 Sep 2017 10:45:28 +0300
4Subject: gianfar: Fix Tx flow control deactivation
5
6From: Claudiu Manoil <claudiu.manoil@nxp.com>
7
8
9[ Upstream commit 5d621672bc1a1e5090c1ac5432a18c79e0e13e03 ]
10
11The wrong register is checked for the Tx flow control bit,
12it should have been maccfg1 not maccfg2.
13This went unnoticed for so long probably because the impact is
14hardly visible, not to mention the tangled code from adjust_link().
15First, link flow control (i.e. handling of Rx/Tx link level pause frames)
16is disabled by default (needs to be enabled via 'ethtool -A').
17Secondly, maccfg2 always returns 0 for tx_flow_oldval (except for a few
18old boards), which results in Tx flow control remaining always on
19once activated.
20
21Fixes: 45b679c9a3ccd9e34f28e6ec677b812a860eb8eb ("gianfar: Implement PAUSE frame generation support")
22Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
23Signed-off-by: David S. Miller <davem@davemloft.net>
24Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
25---
26 drivers/net/ethernet/freescale/gianfar.c | 2 +-
27 1 file changed, 1 insertion(+), 1 deletion(-)
28
29--- a/drivers/net/ethernet/freescale/gianfar.c
30+++ b/drivers/net/ethernet/freescale/gianfar.c
31@@ -3687,7 +3687,7 @@ static noinline void gfar_update_link_st
32 u32 tempval1 = gfar_read(&regs->maccfg1);
33 u32 tempval = gfar_read(&regs->maccfg2);
34 u32 ecntrl = gfar_read(&regs->ecntrl);
35- u32 tx_flow_oldval = (tempval & MACCFG1_TX_FLOW);
36+ u32 tx_flow_oldval = (tempval1 & MACCFG1_TX_FLOW);
37
38 if (phydev->duplex != priv->oldduplex) {
39 if (!(phydev->duplex))