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