Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp242353pxj; Thu, 20 May 2021 08:25:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCB+YDcIb7IgdOJcebfiv7zpG50WKKCggPTZ1B2fHuY7xmo/6x2cqe8V9f+u3kMj9m3zLC X-Received: by 2002:a92:cd44:: with SMTP id v4mr6347297ilq.12.1621524325369; Thu, 20 May 2021 08:25:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621524325; cv=none; d=google.com; s=arc-20160816; b=yTrMAnpJDB33FtYjsnY+lL5sFcE8CHSOyFqHOIbwJX/pOGZCfwsvB8NOsfTCHtuJff Vcvuw9ACAdFseyAbK4Uj6w1byUAStRb78sLHpGHhdhQXGxJeOIJ7EKacXXWRtNSNUjFc Rwg2QfHNFqQNJbJl5QneNmgD1S2ZwCVBTeVBokruXvr/QdRxNpKucZx+IW+oO059CcY7 Fr29DwS9Kt7rYIuPQPR+RaIEcx7MrXSNwcc4aBY8btM0VgrK6jiQf4e3mLydUNI+KGFB hcxkPm0Ap+BMOUn6/Kj8mmLR0TdT7dRg3IQDkfNL3Rfm2Ffl7ySubbjoBez87gQ0TQsq A8aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=RPmjyV0PRDrWT/tPLlX948zlmCHqhRtSCuUa1q+arAY=; b=A1p9kd9Gyu8CGUFtYjeeBnEnRa3W7b6BpMe5bGnLezKiGXQdLLNabyoCX5BlswFi4p sAiJ0ne/dQQYLCaCRhnK5fyqah9vKQvWLXFxDCvSD3w1tWqxuE9xuU4N61LFwCUSgYf0 Q13kOkVmt9cSd9Zs23561VyV8lZL+ctJUIBLnINwsLKzYS4VF5bZXPwlmLqCxd1dzqPO /rzjsXduNqM+VR9Yq4LAWL8kMNTFa/lV3dBkbX6mYaYT6Fprr58zYC2IaYsR1iEr38er oJ/44MVQeL3/ECbS8AeqziwmixUl2PMeyz2VpN6SyzXJGlBB3TWg3uenmhDOnhCRqUYC o+XA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SzRUNAKo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w12si2871304ill.144.2021.05.20.08.25.11; Thu, 20 May 2021 08:25:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SzRUNAKo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232740AbhETJf7 (ORCPT + 99 others); Thu, 20 May 2021 05:35:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:60418 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231743AbhETJdi (ORCPT ); Thu, 20 May 2021 05:33:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D7BF1613F4; Thu, 20 May 2021 09:28:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621502929; bh=eumWB6XYrKh4r8+SrrJ93BOgFZZJLEKh31NxM4tb/68=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SzRUNAKoBYHtg/LBucJVrqxAVOMuWn+3pYDuc3oCLr1fVKduq2TtpNvqY4O0ILsNx hI7XwnwDsBANGkv9Exyhi2S2szy1lorCKR/jJ0fPATIF1zJV79y4PVE4h6sciwPpfY sjk8Y0GXalaEop3WgKvAJJ/heEO6HE9sVW+gOUTk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yannick Vignon , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.4 30/37] net: stmmac: Do not enable RX FIFO overflow interrupts Date: Thu, 20 May 2021 11:22:51 +0200 Message-Id: <20210520092053.265602288@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092052.265851579@linuxfoundation.org> References: <20210520092052.265851579@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yannick Vignon [ Upstream commit 8a7cb245cf28cb3e541e0d6c8624b95d079e155b ] The RX FIFO overflows when the system is not able to process all received packets and they start accumulating (first in the DMA queue in memory, then in the FIFO). An interrupt is then raised for each overflowing packet and handled in stmmac_interrupt(). This is counter-productive, since it brings the system (or more likely, one CPU core) to its knees to process the FIFO overflow interrupts. stmmac_interrupt() handles overflow interrupts by writing the rx tail ptr into the corresponding hardware register (according to the MAC spec, this has the effect of restarting the MAC DMA). However, without freeing any rx descriptors, the DMA stops right away, and another overflow interrupt is raised as the FIFO overflows again. Since the DMA is already restarted at the end of stmmac_rx_refill() after freeing descriptors, disabling FIFO overflow interrupts and the corresponding handling code has no side effect, and eliminates the interrupt storm when the RX FIFO overflows. Signed-off-by: Yannick Vignon Link: https://lore.kernel.org/r/20210506143312.20784-1-yannick.vignon@oss.nxp.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c | 7 +------ drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 14 ++------------ 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c index a41ac13cc4e5..0d993f4b701c 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c @@ -211,7 +211,7 @@ static void dwmac4_dma_rx_chan_op_mode(void __iomem *ioaddr, int mode, u32 channel, int fifosz, u8 qmode) { unsigned int rqs = fifosz / 256 - 1; - u32 mtl_rx_op, mtl_rx_int; + u32 mtl_rx_op; mtl_rx_op = readl(ioaddr + MTL_CHAN_RX_OP_MODE(channel)); @@ -282,11 +282,6 @@ static void dwmac4_dma_rx_chan_op_mode(void __iomem *ioaddr, int mode, } writel(mtl_rx_op, ioaddr + MTL_CHAN_RX_OP_MODE(channel)); - - /* Enable MTL RX overflow */ - mtl_rx_int = readl(ioaddr + MTL_CHAN_INT_CTRL(channel)); - writel(mtl_rx_int | MTL_RX_OVERFLOW_INT_EN, - ioaddr + MTL_CHAN_INT_CTRL(channel)); } static void dwmac4_dma_tx_chan_op_mode(void __iomem *ioaddr, int mode, diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 8e7c60e02fa0..10d28be73f45 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -3855,7 +3855,6 @@ static irqreturn_t stmmac_interrupt(int irq, void *dev_id) /* To handle GMAC own interrupts */ if ((priv->plat->has_gmac) || xmac) { int status = stmmac_host_irq_status(priv, priv->hw, &priv->xstats); - int mtl_status; if (unlikely(status)) { /* For LPI we need to save the tx status */ @@ -3866,17 +3865,8 @@ static irqreturn_t stmmac_interrupt(int irq, void *dev_id) } for (queue = 0; queue < queues_count; queue++) { - struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue]; - - mtl_status = stmmac_host_mtl_irq_status(priv, priv->hw, - queue); - if (mtl_status != -EINVAL) - status |= mtl_status; - - if (status & CORE_IRQ_MTL_RX_OVERFLOW) - stmmac_set_rx_tail_ptr(priv, priv->ioaddr, - rx_q->rx_tail_addr, - queue); + status = stmmac_host_mtl_irq_status(priv, priv->hw, + queue); } /* PCS link status */ -- 2.30.2