]>
Commit | Line | Data |
---|---|---|
9ac87053 GKH |
1 | From foo@baz Thu Sep 14 23:20:23 PDT 2017 |
2 | From: Claudiu Manoil <claudiu.manoil@nxp.com> | |
3 | Date: Mon, 4 Sep 2017 10:45:28 +0300 | |
4 | Subject: gianfar: Fix Tx flow control deactivation | |
5 | ||
6 | From: Claudiu Manoil <claudiu.manoil@nxp.com> | |
7 | ||
8 | ||
9 | [ Upstream commit 5d621672bc1a1e5090c1ac5432a18c79e0e13e03 ] | |
10 | ||
11 | The wrong register is checked for the Tx flow control bit, | |
12 | it should have been maccfg1 not maccfg2. | |
13 | This went unnoticed for so long probably because the impact is | |
14 | hardly visible, not to mention the tangled code from adjust_link(). | |
15 | First, link flow control (i.e. handling of Rx/Tx link level pause frames) | |
16 | is disabled by default (needs to be enabled via 'ethtool -A'). | |
17 | Secondly, maccfg2 always returns 0 for tx_flow_oldval (except for a few | |
18 | old boards), which results in Tx flow control remaining always on | |
19 | once activated. | |
20 | ||
21 | Fixes: 45b679c9a3ccd9e34f28e6ec677b812a860eb8eb ("gianfar: Implement PAUSE frame generation support") | |
22 | Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com> | |
23 | Signed-off-by: David S. Miller <davem@davemloft.net> | |
24 | Signed-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(®s->maccfg1); | |
33 | u32 tempval = gfar_read(®s->maccfg2); | |
34 | u32 ecntrl = gfar_read(®s->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)) |