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 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 78A0DC982DF for ; Fri, 18 Sep 2026 11:35:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:CC:To:In-Reply-To:References :Message-ID:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=cgDLBulkAeltn45c4TvF3DNcfoNg/22Fz02VNu9Izhg=; b=ettNVbmzG40jmCcIEUmd4ohNf5 gDdKYAQxjTrPaKBF23Zxp62KRPVWlqLwlXXnUxP1Cy0ON3HUtCD61csusIHah9VuECBJJjZJJcofN 7Ii3PpRK5hPJ7sbS/QpIYcZh0P4skSCp3IYsMxiBwFpA9JiNJNRSAe4XBoyhDc1nnSqhMyErpmWqA sjanSd3Jux8e4CPt7C/2exa7eKUtxigopma9b++tL+CBYgB4qGoi8kt2JpoIec362ueowFiOJKm61 2FKfBIVF63m0N8SCFYtb14RIlGn7z4jKLRKtaFELTyEYbwUAyNMw98pk/dhqSlyTuTCN6SsmdbFpk kbV9r2xQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x7Wrp-0000000EEu0-1cdS; Fri, 18 Sep 2026 11:34:57 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1x7Wrh-0000000EEqN-3y6S for linux-arm-kernel@bombadil.infradead.org; Fri, 18 Sep 2026 11:34:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=CC:To:In-Reply-To:References: Message-ID:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=cgDLBulkAeltn45c4TvF3DNcfoNg/22Fz02VNu9Izhg=; b=MS8xp0nRrjJxtOX0jM3BGJFN2W vowynL1A8upBg6m31SLq2IEvMvPVsCOtVw3RgpMuLjEY8Avf/ZI6nzBsl17kgv0GFRpKYH3dkQIMW ZFjRdPpzV6YBAIwcCBT/647TibtuXLirDYICRzD/Sh8QZn3JicB8VhZYouXAtWyEL6e7GbhajGW7x dw4sjIZIxq7zo8PH2cuBe9N2yRJdXB+oJdX3fOBi1LnJoKmIhopO+pE7pcFb3hJiKAM8w4hA8xzFl UOeP0VFX+WOYphUJQedGHwKNvPXpdrYWZu3Phsvez04a1nnw2QgqS4tllomUj8SJFkQa/b5oI1tjX hC/0z7VA==; Received: from esa.microchip.iphmx.com ([68.232.153.233]) by desiato.infradead.org with esmtps (Exim 4.99.2 #2 (Red Hat Linux)) id 1x7Wre-0000000A0Ff-2ANd for linux-arm-kernel@lists.infradead.org; Fri, 18 Sep 2026 11:34:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1789731287; x=1821267287; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=rVpMMDlK7E+NlpQ9MahYaWBp6KhJAh4OQm2tWvl9qOI=; b=zt7LTmNIMyDZIX33y2nYG6pPI8yF3jwNnFy1dYZ6HSC+n8GhZ3ulhCI2 G8sU2grM+GFaJiAtZn/UbT854vpycT3T1pdD0fx8gNFusNAcO02C1Vwjf iailu0uFBrxA7BezIoHRtG9X5odmqYfIG2YI16tO0GfOnHGEVAL2VJ6vS c8djMWNrMvKAkHGzWOtkF5bl9ur43HcT1wFMEvS6m8R8ulFJ6+SSJMNjU xnwWELAS/CN7hqdOLPDPx7XrattkxK989MXNnG2gkRp+mBFQeqgvv1Irx B5ZVdUr3jFGB/MxzpS0t508jxE/H/y87GBYrfdQnzZJZFo3E5d7ZGYFO1 w==; X-CSE-ConnectionGUID: iVJHd0nWRKCxmVKcpc8qdg== X-CSE-MsgGUID: wMYJoxRlTLGjgraOvSG/wA== X-IronPort-AV: E=Sophos;i="6.27,108,1787036400"; d="scan'208";a="295223735" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 18 Sep 2026 04:34:44 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.58; Fri, 18 Sep 2026 04:34:43 -0700 Received: from DEN-DL-M70577.microsemi.net (10.10.85.11) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2507.58 via Frontend Transport; Fri, 18 Sep 2026 04:34:39 -0700 From: Daniel Machon Date: Fri, 18 Sep 2026 13:34:00 +0200 Subject: [PATCH net-next v7 08/14] net: lan966x: clear FDMA interrupt stickies after switch reset MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-ID: <20260918-lan966x-pci-fdma-v7-8-0ecc179c8a2c@microchip.com> References: <20260918-lan966x-pci-fdma-v7-0-0ecc179c8a2c@microchip.com> In-Reply-To: <20260918-lan966x-pci-fdma-v7-0-0ecc179c8a2c@microchip.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Horatiu Vultur , Steen Hegelund , , "Alexei Starovoitov" , Daniel Borkmann , "Jesper Dangaard Brouer" , John Fastabend , Stanislav Fomichev , Herve Codina , Arnd Bergmann , Greg Kroah-Hartman , Mohsin Bashir CC: Richard Cochran , , , , X-Mailer: b4 0.14.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260918_123447_172822_8EF19244 X-CRM114-Status: GOOD ( 14.34 ) 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 When in PCI mode, the GCB soft reset issued by the reset controller can latch spurious bits in the FDMA error stickies. The latched bits sit in FDMA_INTR_ERR until the FDMA IRQ is requested later in probe, at which point the handler fires immediately and WARNs. Clear FDMA_ERRORS, FDMA_INTR_ERR and FDMA_INTR_DB right after the switch reset so the FDMA comes out clean and the IRQ handler does not see ghost errors on probe. The clear runs on both the PCI and platform paths. On the platform path it has no effect — there are no spurious stickies to clear — but keeping it unconditional avoids a PCI-specific code path here. Tested-by: Herve Codina Signed-off-by: Daniel Machon --- drivers/net/ethernet/microchip/lan966x/lan966x_main.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c index 6e6c08bb8eea..11094a381ec2 100644 --- a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c @@ -1067,6 +1067,15 @@ static int lan966x_reset_switch(struct lan966x *lan966x) reset_control_reset(switch_reset); + /* When in PCI mode, the GCB soft reset issued by the reset + * controller can latch spurious bits in the FDMA error stickies. + * Clear them before request_irq hooks up the FDMA IRQ line, + * otherwise the handler fires immediately on probe. + */ + lan_wr(lan_rd(lan966x, FDMA_ERRORS), lan966x, FDMA_ERRORS); + lan_wr(lan_rd(lan966x, FDMA_INTR_ERR), lan966x, FDMA_INTR_ERR); + lan_wr(lan_rd(lan966x, FDMA_INTR_DB), lan966x, FDMA_INTR_DB); + /* Don't reinitialize the switch core, if it is already initialized. In * case it is initialized twice, some pointers inside the queue system * in HW will get corrupted and then after a while the queue system gets -- 2.34.1