Netdev List
 help / color / mirror / Atom feed
* [PATCH net 0/5] net: dsa: mt7530: fix regulator disable on teardown and error paths
@ 2026-11-24  8:25 Haoran Wang
  2026-11-24  8:25 ` [PATCH net 3/5] net: dsa: mt7530: register the GPIO controller last in setup Haoran Wang
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Haoran Wang @ 2026-11-24  8:25 UTC (permalink / raw)
  To: chester.a.unal, daniel, andrew, olteanv
  Cc: davem, edumazet, kuba, pabeni, matthias.bgg,
	angelogioacchino.delregno, netdev, linux-arm-kernel,
	linux-mediatek, linux-kernel

mt7530_setup() enables the core and io regulators, but they were not
always disabled again:

 - the disable lived in the driver's remove() callback instead of the
   matching teardown callback, so a switch whose sibling failed to set
   up was torn down without reaching remove() and kept its regulators
   enabled, and

 - the error paths in mt7530_setup() and mt753x_setup() returned without
   disabling the regulators, leaving the rails enabled and making the
   regulator core warn when devres later put an enabled regulator. The
   common case is mt7530_setup_irq() returning -EPROBE_DEFER, which
   re-enabled the rails on every re-probe.

This series splits the original patch into five small, independently
obvious changes, as requested by Andrew Lunn:

  1. Move the disable from remove() to teardown().
  2. Factor the disable into mt7530_disable_pwrs().
  3. Register the GPIO controller last so it is not published across a
     failed setup.
  4. Disable the regulators on every mt7530_setup() error path.
  5. Do the same for mt753x_setup(), moving the mdio irq teardown to the
     end.


Haoran Wang (5):
  net: dsa: mt7530: disable regulators on switch teardown
  net: dsa: mt7530: factor out mt7530_disable_pwrs()
  net: dsa: mt7530: register the GPIO controller last in setup
  net: dsa: mt7530: disable regulators on setup failure
  net: dsa: mt7530: disable regulators on mt753x_setup() failure

 drivers/net/dsa/mt7530-mdio.c | 14 +-------
 drivers/net/dsa/mt7530.c      | 60 +++++++++++++++++++++++++----------
 2 files changed, 45 insertions(+), 29 deletions(-)


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-11-24  8:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-24  8:25 [PATCH net 0/5] net: dsa: mt7530: fix regulator disable on teardown and error paths Haoran Wang
2026-11-24  8:25 ` [PATCH net 3/5] net: dsa: mt7530: register the GPIO controller last in setup Haoran Wang
2026-11-24  8:25 ` [PATCH net 2/5] net: dsa: mt7530: factor out mt7530_disable_pwrs() Haoran Wang
2026-11-24  8:25 ` [PATCH net 5/5] net: dsa: mt7530: disable regulators on mt753x_setup() failure Haoran Wang
2026-11-24  8:25 ` [PATCH net 1/5] net: dsa: mt7530: disable regulators on switch teardown Haoran Wang
2026-11-24  8:25 ` [PATCH net 4/5] net: dsa: mt7530: disable regulators on setup failure Haoran Wang
2026-11-24  8:33 ` [PATCH net 0/5] net: dsa: mt7530: fix regulator disable on teardown and error paths netdev-bot+sinfo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox