From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CA965606A322 for ; Fri, 4 Dec 2026 07:51:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=filTlajl; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=P6iSrJGn 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:MIME-Version: Content-Transfer-Encoding:Content-Type:References:In-Reply-To:Message-ID:Date :Cc:To:From:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=dFcKv4ocPOD5ezkh3P5RWyOwM1Uugkqkv1ugGcphHAU=; b=filTlajl5nyBW3xNPze9vXDtzE uWh87/CX4tM+BY+SSgYJlj9xHDCQzGBzuQ71adyW375KaGpg84negG1s5KToLAYDdEIkOcsjUtxQS IHL5aqkmN/rcLqPoyZK6hN9KrrS21bg+FoABcySt5hclVe7q7WF0FX6i6PRbZOZe7B7Xsvy6fueFG BuGKY5xVe3y9YVf1YGQUkOiVvEDaxQs3FIDrAjwbDySOcCWd/qTB1hjRVvbcpOLk963bENRkHkAYR MMdoXFXdRYKTpzt9v1OtL3x8YJsqib3taFuAsJpVZKkP80d3aUZb/pAbMdBNxJjo39MhtyJuTPYu/ o216f+iQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZO4c-0000000H1T9-3Gvz; Fri, 04 Dec 2026 07:51:18 +0000 Received: from tor.source.kernel.org ([172.105.4.254]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZO4O-0000000H1Oo-0TGl; Fri, 04 Dec 2026 07:51:10 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id A79966261A; Fri, 4 Dec 2026 07:51:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8A7C41F000C2; Fri, 4 Dec 2026 07:51:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796370662; bh=dFcKv4ocPOD5ezkh3P5RWyOwM1Uugkqkv1ugGcphHAU=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=P6iSrJGnuWsDxvy86EJg0nChj4IH1PZunPAfbPl5DazpwoMhLtfNskTw0vIR3CP1I hPpJsC8cVAXlUs9ZgSuNxg0sq50yS+rjZOhIcKU7nLpRNztWQY2EcWEmJl+Vs+9CvW HNNokVrMb/bT1utvTKgOjCfoWxJxEv/LFIGhqXF0/+sUdyWsQrYoEKCkC9lb18pO2f Y01QSk+NYD+u8SnWNxBe692OWiRWJq45l3mxkH/cSx6NHoNJAPBll/RMWao+zdWvXE 1z6SIkfuoW2u6k8NAFSWa4t2ZIGlT67jx9Qh8UG0r6Rn9O4dLwoYISRKr60PfEVrGU i7ARLpldcXtDQ== Subject: Re: [PATCH net-next v2 1/5] net: dsa: mt7530: disable regulators on switch teardown From: netdev-bot+sashiko@kernel.org To: wanghr2026@mail.zgclab.edu.cn Cc: chester.a.unal@arinc9.com, daniel@makrotopia.org, andrew@lunn.ch, olteanv@gmail.com, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Date: Fri, 04 Dec 2026 07:51:01 +0000 Message-ID: <179637066109.3146.17558378695130953570@kernel.org> In-Reply-To: <179628050300.1224.2498848542937309110@mail.zgclab.edu.cn> References: <179628050300.1224.2498848542937309110@mail.zgclab.edu.cn> X-sashiko-severity: Low Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Archived-By: MIME-Version: 1.0 X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-11.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Thank you for your contribution! Sashiko AI review found more severe issue(s) in other patches of this series. This mail is only an FYI, in case you want to address the nit picks below when you respin. Low priority / nit picks for your consideration: - [Low] mt753x_teardown() (drivers/net/dsa/mt7530.c) now turns off the MT7530 core and io regulators (regulator_disable(priv->core_pwr) /… -- net: dsa: mt7530: disable regulators on switch teardown This moves the MT7530 core and io regulator disable from mt7530_remove() to mt753x_teardown(), after the stats polling work is cancelled. The aim is to turn off the regulators of a switch that is torn down because a sibling in a multi-switch tree failed setup. > diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c > index d5a199293f78a..c2f12ae2c6d7b 100644 > --- a/drivers/net/dsa/mt7530.c > +++ b/drivers/net/dsa/mt7530.c > @@ -3237,9 +3237,22 @@ static void > mt753x_teardown(struct dsa_switch *ds) > { > struct mt7530_priv *priv = ds->priv; > + int ret; > > if (priv->bus) > cancel_delayed_work_sync(&priv->stats_work); > + > + if (priv->id == ID_MT7530) { > + ret = regulator_disable(priv->core_pwr); > + if (ret < 0) > + dev_err(priv->dev, > + "Failed to disable core power: %d\n", ret); > + > + ret = regulator_disable(priv->io_pwr); > + if (ret < 0) > + dev_err(priv->dev, "Failed to disable io pwr: %d\n", > + ret); > + } > } [Severity: Low] Is it safe to cut power here while resources registered by mt753x_setup() are still live? stats_work is the only thing stopped before the regulators go off. The regmap IRQ chip, the internal MDIO bus and the GPIO controller are all devm-managed. They are only released when the driver unbinds: mt7530_setup_irq(): ret = devm_regmap_add_irq_chip_fwnode(dev, dev_fwnode(dev), priv->regmap, irq, ... mt7530_setup_mdio(): ret = devm_of_mdiobus_register(dev, bus, mnp); mt7530_setup_gpio(): return devm_gpiochip_add_data(dev, gc, priv); The commit message describes a case where a sibling switch fails setup and the tree is torn down: dsa_tree_setup() dsa_tree_teardown_switches() dsa_switch_teardown() ds->ops->teardown() mt753x_teardown() Here the MT7530 probe has already returned 0, so mt7530_remove() never runs. The device stays bound and the chip has no power, but the parent IRQ handler, the MDIO bus (mt753x_phy_read_c22() and related accessors) and the GPIO chip are all still registered. Before this patch the rails stayed on in this state. mt7530_setup_irq() sets TOP_SIG_CTRL_NORMAL so the chip drives its INT pin. If that line floats or reads as asserted after power is removed, regmap_irq_thread() would read and ack MT7530_SYS_INT_STS over MDIO on an unpowered device. The nested PHY IRQs were already freed during port teardown. Could this keep returning IRQ_NONE until the IRQ core reports "nobody cared" and disables the line? Anything still using the GPIO chip (for example gpio-leds on the switch LED pins) would also read garbage or have its writes lost. The commit message gives this reason for the ordering: "after the stats polling work is cancelled so that no poll can run against an unpowered switch" That covers stats_work, but not the IRQ thread, the MDIO bus or the GPIO chip. Setup powers the chip on and then registers these. Teardown powers it off while they are still registered. A later patch in the series, "net: dsa: mt7530: register the GPIO controller last in setup", says the GPIO controller must not stay registered across a powered-off failed setup. The same state seems to exist after teardown here. The final patch in the series, "net: dsa: mt7530: disable regulators on mt753x_setup() failure", moves the disable into sw_teardown() but keeps the same order. So this seems to still be present at the end of the series. -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/179628050300.1224.11499384961750115678%40mail.zgclab.edu.cn