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 3C968CA5FA3 for ; Mon, 28 Sep 2026 19:34:08 +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=BmMtnUZRm1LKJ7kSP17rtdMloKy1N5ocSgtjdsDXb6E=; b=DuUYFVzCNjXQ3ZSoq2k/RG6HBx pMUBN/neOIieIIL51sDuSlfeIOPnA9LxRJU1cNV716Ha67UBT/PFg8aT4hmZkJJHXmghf3YySk7A5 Cb2XvCpJB08CCiyC1lIoiCyT/hbRBzlMouyKGFIPF+knl1H0K0Yd9YoNGyI5R8q7FQ/5NDjJ9RBwD g/jCrS7aa/Mg8FdnHae0i0xDN8nXfLbg1m1LwD8zUyMIJ4w8Uq+KkJ3UlilpGu/t6EgGUc3wmkK7r PhgesWlktyALjYeFr8RY1DHNPlDAdltLAcexlOpQIVpvWEp7kOfX3mhBWch8M6NCpKXDHp4qKU1Zk CpHTcuZw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1xBH6v-00000001S5D-2dVA; Mon, 28 Sep 2026 19:34:01 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1xBH6W-00000001Roz-23eV for linux-arm-kernel@lists.infradead.org; Mon, 28 Sep 2026 19:33:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1790624017; x=1822160017; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=y0vF6b41qbK3wylCJn2vV8VV9O4lTAJzwOWZxknr6bc=; b=mh8vbssCiIm1OXeOZytNdVz5/h3Yll7pQqo2hqPpHG0woLUS8C+MLYRU iVi8JhuPVcUmZ4iPsDvTRYLhsoSLebROYQSbgwj2Uh6shPqt/pgCHd+Pg nesg/iDzwPuzbbF1sSoHWDOpRF6EcxxK4Y++9pScS4L1mKNLxi6omjojV g8ulNdEnFD2UuzwOV6I2OBd/6BrYdbIutIXWj/8YMAGpQZBC+DkNN5a4S 3v6B/jg8FC0kCdbinMagM/I7ip6Jb7LhXwNWy5Ck05f+xnw/Za7XKO2dz QCfP5hQXtQOIt2Dpeo7YJKNcCRB+2fLgAANSusejGHtaq7DnTTmLBHDMk w==; X-CSE-ConnectionGUID: 4vqIt39FSuO3oiMgGffP1g== X-CSE-MsgGUID: Sa3nKSI8RH6sxLABZqxiwA== X-IronPort-AV: E=Sophos;i="6.27,129,1787036400"; d="scan'208";a="64282785" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa3.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2026 12:33:36 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.87.72) by chn-vm-ex4.mchp-main.com (10.10.87.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.2562.49; Mon, 28 Sep 2026 12:33:34 -0700 Received: from DEN-DL-M70577.microsemi.net (10.10.85.11) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.58 via Frontend Transport; Mon, 28 Sep 2026 12:33:31 -0700 From: Daniel Machon Date: Mon, 28 Sep 2026 21:32:57 +0200 Subject: [PATCH net-next v9 09/15] 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: <20260928-lan966x-pci-fdma-v9-9-a17caf60f89a@microchip.com> References: <20260928-lan966x-pci-fdma-v9-0-a17caf60f89a@microchip.com> In-Reply-To: <20260928-lan966x-pci-fdma-v9-0-a17caf60f89a@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 , "Simon Horman" 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-20260928_123336_553797_695ACC0A X-CRM114-Status: GOOD ( 13.96 ) 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 Reviewed-by: Simon Horman --- 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..259d81e75907 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 and + * data-block 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