All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] scsi: ufs-mediatek: fix va09 regulator lifecycle
@ 2026-11-18  3:20 Xiangwu Lai
  2026-11-18  3:20 ` [PATCH v2 1/2] scsi: ufs-mediatek: use devm_regulator_get() for the va09 regulator Xiangwu Lai
  2026-11-18  3:20 ` [PATCH v2 2/2] scsi: ufs-mediatek: keep mphy state in sync when va09 disable fails Xiangwu Lai
  0 siblings, 2 replies; 4+ messages in thread
From: Xiangwu Lai @ 2026-11-18  3:20 UTC (permalink / raw)
  To: peter.wang, chaotian.jing
  Cc: chu.stanley, alim.akhtar, bvanassche, stanley.chu, sashiko-bot,
	linux-scsi, linux-mediatek, linux-kernel, Xiangwu Lai

This is v2 of the va09 regulator reference fix.  Two issues surfaced
while reviewing the devm conversion (many thanks to the Sashiko AI
review of v1):

- the devm release alone would trip
  WARN_ON(regulator->enable_count) in _regulator_put() on unbind,
  because ufs_mtk_init() powers the M-PHY (and thus va09) on and
  nothing powers it off again on the way out;

- the M-PHY power-off path can leave host->mphy_powered_on set when
  regulator_disable() fails, so the next power-on bails out early
  and never restores the PHY (pre-existing).

Patch 1 keeps the devm conversion and adds an .exit callback which
balances the enable count before the devm release, in the same spirit
as the .exit callbacks of ufs-exynos and ufs-qcom.  Patch 2 fixes
the pre-existing state desync.

Changes in v2:
- 1/2: additionally add an .exit callback powering the M-PHY off so
  the va09 enable count is balanced before devm releases the
  regulator.  Without it, _regulator_put() would warn on every
  driver unbind (Sashiko AI review, [Medium]).
- 2/2: new patch fixing the mphy state desync when va09 disable
  fails (Sashiko AI review, [High], pre-existing).

Link: https://lore.kernel.org/r/20261118014234.424-1-laixiangwu@cmss.chinamobile.com

Xiangwu Lai (2):
  scsi: ufs-mediatek: use devm_regulator_get() for the va09 regulator
  scsi: ufs-mediatek: keep mphy state in sync when va09 disable fails

 drivers/ufs/host/ufs-mediatek.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

-- 
2.50.1.windows.1




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

end of thread, other threads:[~2026-11-18  3:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-18  3:20 [PATCH v2 0/2] scsi: ufs-mediatek: fix va09 regulator lifecycle Xiangwu Lai
2026-11-18  3:20 ` [PATCH v2 1/2] scsi: ufs-mediatek: use devm_regulator_get() for the va09 regulator Xiangwu Lai
2026-11-18  3:20 ` [PATCH v2 2/2] scsi: ufs-mediatek: keep mphy state in sync when va09 disable fails Xiangwu Lai
2026-11-18  3:37   ` sashiko-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.