From: Greg Kroah-Hartman Date: Wed, 17 Apr 2019 20:48:40 +0000 (+0200) Subject: 4.14-stable patches X-Git-Tag: v4.9.170~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7f6536629fee5443257ac00aeb49e6d22708ed1d;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: net-stmmac-set-dma-ring-length-before-enabling-the-dma.patch --- diff --git a/queue-4.14/net-stmmac-set-dma-ring-length-before-enabling-the-dma.patch b/queue-4.14/net-stmmac-set-dma-ring-length-before-enabling-the-dma.patch new file mode 100644 index 00000000000..e8bcc480fc8 --- /dev/null +++ b/queue-4.14/net-stmmac-set-dma-ring-length-before-enabling-the-dma.patch @@ -0,0 +1,53 @@ +From lars.persson@axis.com Wed Apr 17 22:13:54 2019 +From: Lars Persson +Date: Mon, 15 Apr 2019 09:49:47 +0200 +Subject: net: stmmac: Set dma ring length before enabling the DMA +To: stable@vger.kernel.org +Cc: peppe.cavallaro@st.com, alexandre.torgue@st.com, joabreu@synopsys.com, Lars Persson +Message-ID: <20190415074947.6144-1-larper@axis.com> + +From: Lars Persson + +This was fixed in upstream by commit 7d9e6c5afab6 ("net: stmmac: Integrate +XGMAC into main driver flow") that is a new feature commit. + +We found a race condition in the DMA init sequence that hits if the +PHY already has link up during stmmac_hw_setup. Since the ring length +was programmed after enabling the RX path, we might receive a packet +before the correct ring length is programmed. When that happened we +could not get reliable interrupts for DMA RX and the MTL complained +about RX FIFO overrun. + +Signed-off-by: Lars Persson +Cc: stable@vger.kernel.org # 4.14.x +Cc: Giuseppe Cavallaro +Cc: Alexandre Torgue +Cc: Jose Abreu +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c ++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +@@ -2536,9 +2536,6 @@ static int stmmac_hw_setup(struct net_de + netdev_warn(priv->dev, "%s: failed debugFS registration\n", + __func__); + #endif +- /* Start the ball rolling... */ +- stmmac_start_all_dma(priv); +- + priv->tx_lpi_timer = STMMAC_DEFAULT_TWT_LS; + + if ((priv->use_riwt) && (priv->hw->dma->rx_watchdog)) { +@@ -2558,6 +2555,9 @@ static int stmmac_hw_setup(struct net_de + priv->hw->dma->enable_tso(priv->ioaddr, 1, chan); + } + ++ /* Start the ball rolling... */ ++ stmmac_start_all_dma(priv); ++ + return 0; + } + diff --git a/queue-4.14/series b/queue-4.14/series index 5810cf55ed8..a04902d5a7d 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -88,3 +88,4 @@ bpf-do-not-restore-dst_reg-when-cur_state-is-freed.patch bpf-fix-sanitation-rewrite-in-case-of-non-pointers.patch bpf-fix-selftests-are-changes-for-cve-2019-7308.patch tools-include-adopt-linux-bits.h.patch +net-stmmac-set-dma-ring-length-before-enabling-the-dma.patch