Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp218211pxj; Thu, 20 May 2021 07:55:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHROqwA06Y0Axg/Z4x4RIcJvqObflkz9eQm05jc4cDAIECWyOSn7vVaG7U+WceovN4Ulf8 X-Received: by 2002:aa7:dd41:: with SMTP id o1mr5249323edw.361.1621522556297; Thu, 20 May 2021 07:55:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621522556; cv=none; d=google.com; s=arc-20160816; b=aUpNivXO57uDVfRw6jFR9ZKayh5vsGv0Yu9xuB/DV/+rtNlFMLJYM8kBeLpAb7J0aD 38zhMmvhX7KmN9h1Qr+VElsuyuGe6COLt/LDd+jr8Ki80x5um+5ZFwsKKiEx/R+StpiV SHyv9i+SB1+D+iUXNu/Wo52z2N8ueI8gOVa5C0tcMknu9ze2iLuA91gGk1qxTOeq1PED MNbZArXrxlXzCOHG4FVHUsUoQr1xoWZrjuEBaZSeXVW9JbLQj/dhg9Bds8QbmHLt4OTE SZxdoCqc7OM+9y+mDhwrg/baEjPYaXt+NZiajhxN6aOUOVfpMebFOL9r2y9BqJzTG/5B +9Ng== 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=MKqpz2qG363V6YvoFD91kMTA5douo18WUO9vhTERqtU=; b=veVt9Ll1Dt4J4swXCBiTvG1hCXU28aRa4SjkzIkvZCDb5XhbOZtDI2TFnBuXixzRRq d/v5Vs/S3yLNu4Tydb7dUpj9XjoOpgXFowJEC3GU/nJYoS0sOasruxgFl0NhGEkioXea JOpVFDscIL0JHOYQj5b3Nzo2nw0cvhJzALaFsgeR+yUI6V2keEgeNF2OEmqamCKjZNwN WdkxoL68F6MDUWmaQrqQ0YvoJeO1Vnj/9ufjuI4CePcrBD50vWz771Bgjzh6jEBHldil Ea4c9jpaDQNSKDB2kQA9FoqydabaK9j84KQvvSjmUrFqdi7VihAqOTHrQCcpiDLFrenf KmNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NEqkAMHv; 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 rl24si2660905ejb.25.2021.05.20.07.55.30; Thu, 20 May 2021 07:55:56 -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=NEqkAMHv; 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 S231960AbhETJ2d (ORCPT + 99 others); Thu, 20 May 2021 05:28:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:54612 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231949AbhETJ13 (ORCPT ); Thu, 20 May 2021 05:27:29 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5D742613AF; Thu, 20 May 2021 09:26:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621502768; bh=XfOG0g//+326VFrb4SwTXN4+EJDKWWQrZWubkNsbX/4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NEqkAMHvR142nRRd1iN6wRe3GYDsblzpVG/U1RvlI4+MzYA0wo0I/bSflaxfv3Dde taTwaCvsXPQD5aO0pOcmgwU/fsl5/PMJNbxaTOOI6LLipFpMhpRRODCpwwj3HzFrrI DvNMNCt6ZTmyWl/TTFyn1kVBEyZyOXHI74fxCdDQ= 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.12 41/45] net: stmmac: Do not enable RX FIFO overflow interrupts Date: Thu, 20 May 2021 11:22:29 +0200 Message-Id: <20210520092054.850459249@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092053.516042993@linuxfoundation.org> References: <20210520092053.516042993@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 62aa0e95beb7..a7249e4071f1 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c @@ -222,7 +222,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)); @@ -283,11 +283,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 c6f24abf6432..369d7cde3993 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -4168,7 +4168,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 */ @@ -4179,17 +4178,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