From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3805CC10F0E for ; Mon, 15 Apr 2019 07:49:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0644520825 for ; Mon, 15 Apr 2019 07:49:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725972AbfDOHtv (ORCPT ); Mon, 15 Apr 2019 03:49:51 -0400 Received: from bastet.se.axis.com ([195.60.68.11]:54949 "EHLO bastet.se.axis.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725779AbfDOHtv (ORCPT ); Mon, 15 Apr 2019 03:49:51 -0400 Received: from localhost (localhost [127.0.0.1]) by bastet.se.axis.com (Postfix) with ESMTP id 06B00183B0; Mon, 15 Apr 2019 09:49:49 +0200 (CEST) X-Axis-User: NO X-Axis-NonUser: YES X-Virus-Scanned: Debian amavisd-new at bastet.se.axis.com Received: from bastet.se.axis.com ([IPv6:::ffff:127.0.0.1]) by localhost (bastet.se.axis.com [::ffff:127.0.0.1]) (amavisd-new, port 10024) with LMTP id Oa4ibzPNxxjl; Mon, 15 Apr 2019 09:49:48 +0200 (CEST) Received: from boulder03.se.axis.com (boulder03.se.axis.com [10.0.8.17]) by bastet.se.axis.com (Postfix) with ESMTPS id CCA4A180E6; Mon, 15 Apr 2019 09:49:47 +0200 (CEST) Received: from boulder03.se.axis.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AAF411E0AD; Mon, 15 Apr 2019 09:49:47 +0200 (CEST) Received: from boulder03.se.axis.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9F58B1E0AC; Mon, 15 Apr 2019 09:49:47 +0200 (CEST) Received: from thoth.se.axis.com (unknown [10.0.2.173]) by boulder03.se.axis.com (Postfix) with ESMTP; Mon, 15 Apr 2019 09:49:47 +0200 (CEST) Received: from pc32929-1845.se.axis.com (pc32929-1845.se.axis.com [10.88.129.17]) by thoth.se.axis.com (Postfix) with ESMTP id 92F8916F8; Mon, 15 Apr 2019 09:49:47 +0200 (CEST) Received: by pc32929-1845.se.axis.com (Postfix, from userid 20456) id 8EBCD409C2; Mon, 15 Apr 2019 09:49:47 +0200 (CEST) From: Lars Persson To: stable@vger.kernel.org Cc: peppe.cavallaro@st.com, alexandre.torgue@st.com, joabreu@synopsys.com, Lars Persson Subject: [PATCH stable 4.14] net: stmmac: Set dma ring length before enabling the DMA Date: Mon, 15 Apr 2019 09:49:47 +0200 Message-Id: <20190415074947.6144-1-larper@axis.com> X-Mailer: git-send-email 2.11.0 X-TM-AS-GCONF: 00 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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 --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 4a9dbee6f054..f2429ec07b57 100644 --- 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_device *dev, bool init_ptp) 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_device *dev, bool init_ptp) priv->hw->dma->enable_tso(priv->ioaddr, 1, chan); } + /* Start the ball rolling... */ + stmmac_start_all_dma(priv); + return 0; } -- 2.11.0