]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.9.170/net-stmmac-set-dma-ring-length-before-enabling-the-dma.patch
remove unneeded perf patch from 4.9
[thirdparty/kernel/stable-queue.git] / releases / 4.9.170 / net-stmmac-set-dma-ring-length-before-enabling-the-dma.patch
1 From lars.persson@axis.com Wed Apr 17 22:13:01 2019
2 From: Lars Persson <lars.persson@axis.com>
3 Date: Mon, 15 Apr 2019 09:50:34 +0200
4 Subject: net: stmmac: Set dma ring length before enabling the DMA
5 To: stable@vger.kernel.org
6 Cc: peppe.cavallaro@st.com, alexandre.torgue@st.com, joabreu@synopsys.com, Lars Persson <larper@axis.com>
7 Message-ID: <20190415075034.6236-1-larper@axis.com>
8
9 From: Lars Persson <lars.persson@axis.com>
10
11 This was fixed in upstream by commit 7d9e6c5afab6 ("net: stmmac: Integrate
12 XGMAC into main driver flow") that is a new feature commit.
13
14 We found a race condition in the DMA init sequence that hits if the
15 PHY already has link up during stmmac_hw_setup. Since the ring length
16 was programmed after enabling the RX path, we might receive a packet
17 before the correct ring length is programmed. When that happened we
18 could not get reliable interrupts for DMA RX and the MTL complained
19 about RX FIFO overrun.
20
21 Signed-off-by: Lars Persson <larper@axis.com>
22 Cc: stable@vger.kernel.org # 4.9.x
23 Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
24 Cc: Alexandre Torgue <alexandre.torgue@st.com>
25 Cc: Jose Abreu <joabreu@synopsys.com>
26 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
27
28 ---
29 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 10 +++++-----
30 1 file changed, 5 insertions(+), 5 deletions(-)
31
32 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
33 +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
34 @@ -1747,11 +1747,6 @@ static int stmmac_hw_setup(struct net_de
35 if (ret < 0)
36 pr_warn("%s: failed debugFS registration\n", __func__);
37 #endif
38 - /* Start the ball rolling... */
39 - pr_debug("%s: DMA RX/TX processes started...\n", dev->name);
40 - priv->hw->dma->start_tx(priv->ioaddr);
41 - priv->hw->dma->start_rx(priv->ioaddr);
42 -
43 /* Dump DMA/MAC registers */
44 if (netif_msg_hw(priv)) {
45 priv->hw->mac->dump_regs(priv->hw);
46 @@ -1779,6 +1774,11 @@ static int stmmac_hw_setup(struct net_de
47 if (priv->tso)
48 priv->hw->dma->enable_tso(priv->ioaddr, 1, STMMAC_CHAN0);
49
50 + /* Start the ball rolling... */
51 + pr_debug("%s: DMA RX/TX processes started...\n", dev->name);
52 + priv->hw->dma->start_tx(priv->ioaddr);
53 + priv->hw->dma->start_rx(priv->ioaddr);
54 +
55 return 0;
56 }
57