]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.9.70/stmmac-reset-last-tso-segment-size-after-device-open.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.9.70 / stmmac-reset-last-tso-segment-size-after-device-open.patch
1 From foo@baz Thu Dec 14 11:45:58 CET 2017
2 From: Lars Persson <lars.persson@axis.com>
3 Date: Fri, 1 Dec 2017 11:12:44 +0100
4 Subject: stmmac: reset last TSO segment size after device open
5
6 From: Lars Persson <lars.persson@axis.com>
7
8
9 [ Upstream commit 45ab4b13e46325d00f4acdb365d406e941a15f81 ]
10
11 The mss variable tracks the last max segment size sent to the TSO
12 engine. We do not update the hardware as long as we receive skb:s with
13 the same value in gso_size.
14
15 During a network device down/up cycle (mapped to stmmac_release() and
16 stmmac_open() callbacks) we issue a reset to the hardware and it
17 forgets the setting for mss. However we did not zero out our mss
18 variable so the next transmission of a gso packet happens with an
19 undefined hardware setting.
20
21 This triggers a hang in the TSO engine and eventuelly the netdev
22 watchdog will bark.
23
24 Fixes: f748be531d70 ("stmmac: support new GMAC4")
25 Signed-off-by: Lars Persson <larper@axis.com>
26 Signed-off-by: David S. Miller <davem@davemloft.net>
27 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
28 ---
29 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 1 +
30 1 file changed, 1 insertion(+)
31
32 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
33 +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
34 @@ -1795,6 +1795,7 @@ static int stmmac_open(struct net_device
35
36 priv->dma_buf_sz = STMMAC_ALIGN(buf_sz);
37 priv->rx_copybreak = STMMAC_RX_COPYBREAK;
38 + priv->mss = 0;
39
40 ret = alloc_dma_desc_resources(priv);
41 if (ret < 0) {