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 6E487C9830E for ; Thu, 24 Sep 2026 17:44:51 +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=1wKZkkE2xLR0im7GAkRWZzs8Zs+Mbht27bASwGvGU3E=; b=srYQGNTnisP1+DaCmzirJK5h8s 54i7YpXIuUtSaclDC+0HxpBrtXMNAHM4DWuu99F5Tpyin2uysaB8C9HPU1XLxhA4HKn0U2bte80O1 5tiEU8ppXJIi2eNwmG8xLSOdxNVir94zCDSTN+6NNA/NoPnPcIxrPBUh177P1zD5Lj+JPkcZqDFp4 TcsfOrBhGJ0sJoqkl1Nnm9p4N9UJEuEr8XnOV9ZZUsWBaY3x0qlznPiubiveRbWRGz9ocXXl6ozr+ JzBK/l2yCuVyOQ2usllFRUawy/ImYuz9WuI1rPssN4+0nV47C4PqAzDeS9POSzadJwEzJfqxfdOaO eO8DJzqA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x9nUu-0000000BoJ2-3fJG; Thu, 24 Sep 2026 17:44:41 +0000 Received: from mail-oo2-x0d.google.com ([2607:f8b0:4864:31::d]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1x9nUs-0000000BoI1-263e for linux-arm-kernel@lists.infradead.org; Thu, 24 Sep 2026 17:44:39 +0000 Received: by mail-oo2-x0d.google.com with SMTP id 006d021491bc7-6b1ae721872so62251eaf.1 for ; Thu, 24 Sep 2026 10:44:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1790271877; x=1790876677; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=1wKZkkE2xLR0im7GAkRWZzs8Zs+Mbht27bASwGvGU3E=; b=X1Qhuz1aBvHcFkwZqxKcAaqahJlTIC4Dx3gzVVS6h5KDG8YnJmnWh4i3Gaz/87Ljep HFPKmdx4BTPJ1M/+UNDyR5G2mP5IhVTiuzSFlYqwj+Yd31F9s2OkHO3FharVRPAHZpjw Of12PyN2o3mHC8PRoknBSfRohm3sTg4jhe8ReLWIb9ukNcuCr+MGXzAi5Nk5/XbvLezg 8ejrikyWjJWR/NppeB8q448b2xYHmfZM/o9fC6MzhkPA24mk21U9aoluKtMqWqny4aqU 8V6L5BFPRzciSr9w/XARVHz2vOxomQuJ/qYf8xF6bedQasNiMdURuytJis0VltTpZo4N XQWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790271877; x=1790876677; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=1wKZkkE2xLR0im7GAkRWZzs8Zs+Mbht27bASwGvGU3E=; b=eqZ8KjGDgBmLsNjNtEdeifrb4IA3yUtV2TdUSP+s35meyGhrZCoNXHGTl3L8jWIN8D jWKoETyvqlPgC/vb9cdnGjSC9Q+j8vpO1ByuRWoEeOZVCdAbVvNyP6xWXdx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PxdEJLwXx46fj2Pxr7mU2FYDYixLYltKd6ux47MEq0YH38IABGVmQ0D6Ch kl51dRef2OFOPohh5Z0cmJg== X-Received: by 2002:a05:6820:f005:b0:6b7:83d6:2924 with SMTP id 006d021491bc7-6d43f7a5ca3mr3335705eaf.39.1790271877265; Thu, 24 Sep 2026 10:44:37 -0700 (PDT) Received: from [127.0.1.1] (174-29-1-49.hlrn.qwest.net. [174.29.1.49]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-491e8f8d14asm3027802fac.0.2026.09.24.10.44.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Sep 2026 10:44:36 -0700 (PDT) From: James Hilliard Date: Thu, 24 Sep 2026 11:44:31 -0600 Subject: [PATCH net v3 01/10] net: stmmac: unwind the WoL IRQ after a safety IRQ request failure MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260924-submit-stmmac-reset-fixes-v1-v3-1-c031e3f3a282@gmail.com> References: <20260924-submit-stmmac-reset-fixes-v1-v3-0-c031e3f3a282@gmail.com> In-Reply-To: <20260924-submit-stmmac-reset-fixes-v1-v3-0-c031e3f3a282@gmail.com> To: Russell King , Andrew Lunn , Heiner Kallweit , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Joakim Zhang , "Russell King (Oracle)" , Maxime Chevallier , Andrew Lunn , Maxime Coquelin , Alexandre Torgue , Christian Marangi , Tiezhu Yang , Huacai Chen , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Stanislav Fomichev , Serge Semin , Suraj Jaiswal , Richard Cochran , Joao Pinto , Vladimir Oltean , Ong Boon Leong , Voon Weifeng , "Song, Yoong Siang" Cc: Richard Genoud , Alastair D'Silva , Maxime Ripard , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, bpf@vger.kernel.org, ZhaoJinming , Lorenzo Bianconi , Ding Hui , James Hilliard X-Mailer: b4 0.15.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260924_104438_560288_903231F3 X-CRM114-Status: GOOD ( 13.55 ) 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 The IRQ setup paths request the MAC IRQ, then the optional WoL IRQ, then the common safety IRQ. If requesting the safety IRQ fails, cleanup must release the WoL and MAC IRQs, but not the failed safety IRQ. The REQ_IRQ_ERR_SFTY case instead frees the safety IRQ and skips the WoL IRQ. Allocation fault injection during live XDP reopening reproduces a "Trying to free already-free IRQ" warning and leaves the WoL handler registered after the datapath resources have been released. A subsequent open can then fail to request that still-owned IRQ. Move safety IRQ cleanup before REQ_IRQ_ERR_SFTY and WoL IRQ cleanup after it. This restores reverse acquisition order for both shared and MSI IRQ setup, including unwind after failures in later per-queue IRQ requests. Fixes: 5c2215167d12 ("net: stmmac: Add driver support for common safety IRQ") Signed-off-by: James Hilliard --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 3f34d491c959..4f3d452c3503 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -3797,13 +3797,13 @@ static void stmmac_free_irq(struct net_device *dev, free_irq(msi->sfty_ce_irq, dev); fallthrough; case REQ_IRQ_ERR_SFTY_CE: - if (priv->wol_irq > 0 && priv->wol_irq != dev->irq) - free_irq(priv->wol_irq, dev); - fallthrough; - case REQ_IRQ_ERR_SFTY: if (priv->sfty_irq > 0 && priv->sfty_irq != dev->irq) free_irq(priv->sfty_irq, dev); fallthrough; + case REQ_IRQ_ERR_SFTY: + if (priv->wol_irq > 0 && priv->wol_irq != dev->irq) + free_irq(priv->wol_irq, dev); + fallthrough; case REQ_IRQ_ERR_WOL: free_irq(dev->irq, dev); fallthrough; -- 2.53.0