From patchwork Fri May 24 21:02:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Serge Semin X-Patchwork-Id: 13673751 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 23D77C25B74 for ; Fri, 24 May 2024 21:03:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=WbPsqoB7VUIMP6VbA9P0MpM19BmvBfhTHp+1fuu8dP0=; b=v1Vi1jWc1qnPKu 3FD9uUy64G04xhAHZinClTj8CdtjGjyqZ3/bbx7d+q4dpQAaCdco7oiMjHUuPdkjGOO1uS9BiDfHN MX1d6ZDfVLzPuqdZLmEP3iyHoduCgt5B8FI94D2ZMwjnQjXQ5mUt9OXmNTkVRN+O38C47L/YQXEpk fY2xwFT3ik1cSILlCtpCUHEjSojwkBol6XgFVf8nahybdXd0S31uKECdUp9JKAAJWx0HyMOGk+LID gqOTwAbMJloDmcpwMvxehknkzjFZglWXx3SqVRWhMkDhdhNRnu7jJXMp0LtM4ZktuH1S44tc5pKja +ou9ZmYv7V44L5aeSfXA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sAc4c-00000009ssp-12Sm; Fri, 24 May 2024 21:03:34 +0000 Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sAc4Y-00000009sr6-2TGV for linux-arm-kernel@lists.infradead.org; Fri, 24 May 2024 21:03:32 +0000 Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-5295bcb9bc1so1194746e87.0 for ; Fri, 24 May 2024 14:03:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716584601; x=1717189401; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jfTzYX+duGMsU7h/VpsgnG4SbDyXgyQ9P7UXQAwHfVg=; b=mzGB7VmHkqM+0vDNZVVLpFxAk2lr3COQH+AnCiSzbBXWDtQLqfAmeg06aWG8yCp/ov C71uO1os0nRMey0js90XZ/uB4VtrLu6h3Yrk5mm9HV8KRO8ta5aROrgbxbMVzTMje/Rb R068QwyKOo8HBpOChh1aihESNBXo0cQBip4zuFJB7HD5nkPi+NVm96Y+pbCFjxA6c7w2 j5D8K3LZhYt3v1+tYPnIamdmASug8QMn+GbXAIxgOjPnUDH5fdwO6EQZaQ8XGsy0JW5L JAUWCfzPYf4khfWhTQHah7tzYo5fM1fPRMJUytrXRgsuUb+BHrAUXzcoIj5QkZcfwueq pVxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716584601; x=1717189401; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jfTzYX+duGMsU7h/VpsgnG4SbDyXgyQ9P7UXQAwHfVg=; b=DS6IKq/nF+YljL4UVUXOrnSi4lAY6OZ/4xJwAP7pUlH80tvJRJIA0PePmmITezXHO2 X3zocbBG6fXVHlpxqIraXC+Z5P7iPIQkIy0kr+eRJSjHjbNjV9+uxBGE/NHTXlXM71+M Kn7riFvsJXVehzofoi7ggWjWoNtsp+JJ9jHSM3nv3lvOnCk11b9TUf7r1NoYNzznEBIX GF5l2cXaPIu4l2mWuQ3+4v4O2qLc0zHNdTlVcpA7h98bUaognlDIavbQSzbv6TzEqq45 TliTyfeIILv/v5C4Lc1LUZ+GvFFeEONRGrRykKCCcrcE1NWFAFO2QZwSiE6TvMyXd2VC hdlg== X-Forwarded-Encrypted: i=1; AJvYcCXcfI7ojGO3EDqrI7ymUFw4lW/W7UDycL6K9sNMINEEJEgrFtms5Mi8/v3l3tsVXxDghDTvgmYfs47c55SebYIRIgIBAd1KC/iHzSohMD5brwKVqak= X-Gm-Message-State: AOJu0YyDITDWsqY19u3FN7hoS31g8dOAwLDEM+ksa1AGxWhhp3545wmB QD+gODTdvsHZvUykfYzQT58+/ExBwUYYHsJQNedDAAxyS4blbgF8 X-Google-Smtp-Source: AGHT+IFsvg+3eW+uFt+8zbMHGOvvmM7wbkkNlpRI+IgIK/fpNCjG+0mt4y0mWAeB+ZHjQFEWsw7fgQ== X-Received: by 2002:a19:381d:0:b0:523:889a:ebd with SMTP id 2adb3069b0e04-52964ea947bmr1972965e87.24.1716584601070; Fri, 24 May 2024 14:03:21 -0700 (PDT) Received: from localhost ([95.79.182.53]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-52970e1ef56sm236078e87.228.2024.05.24.14.03.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 May 2024 14:03:20 -0700 (PDT) From: Serge Semin To: Russell King , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin Cc: Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , bpf@vger.kernel.org, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH RFC net-next 1/3] net: stmmac: Prevent RGSMIIIS IRQs flood Date: Sat, 25 May 2024 00:02:57 +0300 Message-ID: <20240524210304.9164-1-fancer.lancer@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240524_140330_784798_30F25AA1 X-CRM114-Status: GOOD ( 11.29 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Without reading the GMAC_RGSMIIIS/MAC_PHYIF_Control_Status the IRQ line won't be de-asserted causing interrupt handler executed over and over. As a quick-fix let's just dummy-read the CSR for now. Signed-off-by: Serge Semin --- drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c | 2 ++ drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c index adb872d5719f..2ae8467c588e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c @@ -304,6 +304,8 @@ static int dwmac1000_irq_status(struct mac_device_info *hw, dwmac_pcs_isr(ioaddr, GMAC_PCS_BASE, intr_status, x); if (intr_status & PCS_RGSMIIIS_IRQ) { + /* TODO Dummy-read to clear the IRQ status */ + readl(ioaddr + GMAC_RGSMIIIS); phylink_pcs_change(&hw->mac_pcs, false); x->irq_rgmii_n++; } diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c index a892d361a4e4..cd2ca1d0222c 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c @@ -896,6 +896,8 @@ static int dwmac4_irq_status(struct mac_device_info *hw, dwmac_pcs_isr(ioaddr, GMAC_PCS_BASE, intr_status, x); if (intr_status & PCS_RGSMIIIS_IRQ) { + /* TODO Dummy-read to clear the IRQ status */ + readl(ioaddr + GMAC_PHYIF_CONTROL_STATUS); phylink_pcs_change(&hw->mac_pcs, false); x->irq_rgmii_n++; }