linux/drivers/pmdomain
AngeloGioacchino Del Regno a4876f11aa pmdomain: mediatek: Fix possible nullptr KP in HWV cleanup/on-check
Should probe fail for HW_VOTER type power domains, this driver was
unconditionally trying to perform cleanup for DIRECT_CTL domains,
but only after checking if the target domain is powered on... with
the DIRECT_CTL scpsys_domain_is_on() code again.

And there's more: the scpsys_domain_is_on() function is also being
unconditionally used in the probe path, for any power domain that
has flag MTK_SCPD_KEEP_DEFAULT_OFF!

This bug was never experienced by anyone because the HWV domains
never failed probe, and because none of those is declared with the
aforementioned flag - but it's still something critical.

In order to fix this, add a check for MTCMOS Type and, based on
that, call the correct functions for an "is on" check, and also
do the same for the cleanup path, calling the correct functions
for the "power off" action.

For the latter, since there's a call to pm_genpd_remove() right
before calling power_off, be cautious and add a variation of the
power off functions (with a _internal suffix) for those to get a
pointer to scpsys_domain instead of one to generic_pm_domain as,
even if that's still working, this is way too much fragile and
would break at some point.

Fixes: 88914db077 ("pmdomain: mediatek: Add support for Hardware Voter power domains")
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson <ulfh@kernel.org>
2026-07-13 12:42:17 +02:00
..
actions Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
amlogic pmdomain: amlogic: Add support for S6 S7 S7D power domains controller 2025-09-04 12:25:36 +02:00
apple pmdomain: apple: Add "apple,t8103-pmgr-pwrstate" 2025-09-18 21:30:56 +02:00
arm pmdomain: arm_scmi: add support for domain hierarchies 2026-05-11 12:54:03 +02:00
bcm pmdomain: bcm: bcm2835-power: Replace open-coded polling with readl_poll_timeout_atomic() 2026-04-01 13:12:11 +02:00
imx pmdomain: imx: Fix i.MX8MP VC8000E power up sequence 2026-07-08 17:11:50 +02:00
marvell Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
mediatek pmdomain: mediatek: Fix possible nullptr KP in HWV cleanup/on-check 2026-07-13 12:42:17 +02:00
qcom pmdomain: qcom: rpmpd: Add Shikra RPM Power Domains 2026-06-03 11:59:12 +02:00
renesas Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
rockchip pmdomain: rockchip: quiet regulator error on -EPROBE_DEFER 2026-04-01 13:12:11 +02:00
samsung pmdomain: samsung: Rework legacy splash-screen handover workaround 2025-11-04 17:16:05 +01:00
st Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
starfive pmdomain: starfive: Update prefixes for AON power domain 2023-10-04 23:41:57 +02:00
sunxi pmdomain: sunxi: support power domain flags for pck600 2026-06-03 11:30:38 +02:00
tegra Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
thead pmdomain: thead: Fix error pointer vs NULL bug in th1520_pd_reboot_init() 2025-09-26 14:50:20 +02:00
ti pmdomain: ti_sci: add wakeup constraint to parent devices of wakeup source 2026-06-03 11:47:20 +02:00
xilinx firmware/pmdomain: xilinx: Move ->sync_state() support to firmware driver 2025-07-09 13:29:25 +02:00
core.c pmdomain: core: fix unused variable warning with !PM_GENERIC_DOMAINS_OF 2026-06-15 21:12:35 +02:00
governor.c pmdomain core: 2025-12-04 13:50:39 -08:00
Kconfig pmdomain: marvell: Add PXA1908 power domains 2025-09-17 16:13:19 +02:00
Makefile pmdomain: marvell: Add PXA1908 power domains 2025-09-17 16:13:19 +02:00