Commit Graph

377 Commits

Author SHA1 Message Date
Wentao Liang
ec1fcddb31 pmdomain: mediatek: fix use-after-free in scpsys_get_bus_protection_legacy()
In scpsys_get_bus_protection_legacy(), of_find_node_with_property()
returns a device node with its reference count incremented. The function
then calls of_node_put(node) before checking whether
syscon_regmap_lookup_by_phandle() returns an error. If an error occurs,
dev_err_probe() dereferences the node pointer to print diagnostic
information, but the node memory may have already been freed due to the
earlier of_node_put(), leading to a use-after-free vulnerability.

Fix this by moving the of_node_put() call after the error check, ensuring
the node is still valid when accessed in the error path.

Fixes: c29345fa5f ("pmdomain: mediatek: Refactor bus protection regmaps retrieval")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-04-27 14:53:30 +02:00
Ulf Hansson
26735dfdd8 pmdomain: core: Fix detach procedure for virtual devices in genpd
If a device is attached to a PM domain through genpd_dev_pm_attach_by_id(),
genpd calls pm_runtime_enable() for the corresponding virtual device that
it registers. While this avoids boilerplate code in drivers, there is no
corresponding call to pm_runtime_disable() in genpd_dev_pm_detach().

This means these virtual devices are typically detached from its genpd,
while runtime PM remains enabled for them, which is not how things are
designed to work. In worst cases it may lead to critical errors, like a
NULL pointer dereference bug in genpd_runtime_suspend(), which was recently
reported. For another case, we may end up keeping an unnecessary vote for a
performance state for the device.

To fix these problems, let's add this missing call to pm_runtime_disable()
in genpd_dev_pm_detach().

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Closes: https://lore.kernel.org/all/CAMuHMdWapT40hV3c+CSBqFOW05aWcV1a6v_NiJYgoYi0i9_PDQ@mail.gmail.com/
Fixes: 3c095f32a9 ("PM / Domains: Add support for multi PM domains per device to genpd")
Cc: stable@vger.kernel.org
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-04-27 14:36:17 +02:00
Fenglin Wu
596ca99cf0 pmdomain: qcom: rpmhpd: Add power domains for Hawi SoC
Add the RPMh power domains required for the Hawi SoC. This includes
new definitions for domains supplying specific hardware components:
- DCX: supplies VDD_DISP
- GBX: supplies VDD_GFX_BX

Reviewed-by: Taniya Das <taniya.das@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Fenglin Wu <fenglin.wu@oss.qualcomm.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-04-08 12:01:37 +02:00
Rosen Penev
a6112de8f4 pmdomain: qcom: cpr: add COMPILE_TEST support
Allows the buildbots to build the driver on other platforms. There's
nothing special arch specific thing going on here.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-04-08 11:50:04 +02:00
Ulf Hansson
9d862ccfda pmdomain: Merge branch fixes into next
Merge the pmdomain fixes for v7.0-rc[n] into the next branch, to allow
them to get tested together with the pmdomain changes that are targeted
for the next release.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-04-01 13:34:40 +02:00
Rosen Penev
66ab322c61 pmdomain: qcom: cpr: simplify main allocation
Remove kcalloc by using a flexible array member to combine allocations.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-04-01 13:12:11 +02:00
Maíra Canal
d797ecf3ff pmdomain: bcm: bcm2835-power: Replace open-coded polling with readl_poll_timeout_atomic()
Replace hand-rolled ktime_get_ns()/cpu_relax() polling loops with
readl_poll_timeout_atomic() for the power-on (POWOK), and memory
repair (MRDONE) waits.

No functional change intended.

Signed-off-by: Maíra Canal <mcanal@igalia.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-04-01 13:12:11 +02:00
Yuanshen Cao
a46e905cd1 pmdomain: sunxi: Add support for A733 to Allwinner PCK600 driver
The Allwinner A733 PCK600, similar to A523 PCK600, is likely a
customized version of ARM PCK-600 power controller. It shares the same
BSP driver with A523. According to the BSP provided by Radxa, unlike
A523, it doesn't require reset, as well as a different pair of delay
values.

Make reset optional in the sunxi pck600 driver and add support
for A733.

Signed-off-by: Yuanshen Cao <alex.caoys@gmail.com>
Reviewed-by: Chen-Yu Tsai <wens@kernel.org> # matched against BSP driver
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-04-01 13:12:11 +02:00
Abel Vesa
f387ecdd49 pmdomain: qcom: rpmhpd: Add Eliza RPMh Power Domains
Add RPMh Power Domains support for the Eliza platform. The list of power
domains is taken from downstream. Even though the cmd-db does list MMCX
and MXC, they are not used, so they should not be describe.

Reviewed-by: Taniya Das <taniya.das@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-04-01 13:12:11 +02:00
Ulf Hansson
6c70e42fc4 pmdomain: arm: Add print after a successful probe for SCMI power domains
It can be discussed how useful a print is after a successful probe. In the
SCMI power domain case it's seems valuable, as it let us inform about the
number of initialized power domains too, which is fetched from firmware.

Therefore, let's add a print about this, which also aligns with the
behaviour of the SCMI perf domain driver.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Acked-by: Sudeep Holla <sudeep.holla@kernel.org>
2026-04-01 13:12:11 +02:00
Chris Morgan
8d2cacb20e pmdomain: rockchip: quiet regulator error on -EPROBE_DEFER
Change the dev_err() to dev_err_probe() under rockchip_pd_power_on()
to prevent errors early in the boot process when the requested
regulator is not yet available. This converts errors like the following
to debug messages:

rockchip-pm-domain fd8d8000.power-management:power-controller: Failed to enable supply: -517

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Tested-by: Diederik de Haas <diederik@cknow-tech.com>
Reviewed-by: Anand Moon <linux.amoon@gmail.com>
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-04-01 13:12:11 +02:00
Irving-CH Lin
6734a5e86b pmdomain: mediatek: Add power domain driver for MT8189 SoC
Introduce a new power domain (pmd) driver for the MediaTek mt8189 SoC.
This driver ports and refines the power domain framework, dividing
hardware blocks (CPU, GPU, peripherals, etc.) into independent power
domains for precise and energy-efficient power management.

Signed-off-by: Irving-CH Lin <irving-ch.lin@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-04-01 13:07:31 +02:00
Irving-CH Lin
35e09ed76b pmdomain: mediatek: Add bus protect control flow for MT8189
In MT8189 mminfra power domain, the bus protect policy separates
into two parts, one is set before subsys clocks enabled, and another
need to enable after subsys clocks enable.

Signed-off-by: Irving-CH Lin <irving-ch.lin@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-04-01 13:07:31 +02:00
Ulf Hansson
f67866701d pmdomain: core: Extend statistics for domain idle states with s2idle data
To allow user space to monitor the selection of the domain idle state
during s2idle for a CPU PM domain, let's extend the debugfs support in
genpd with this information.

Suggested-by: Dhruva Gole <d-gole@ti.com>
Reviewed-by: Dhruva Gole <d-gole@ti.com>
Reviewed-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-04-01 13:07:31 +02:00
Ulf Hansson
68831a9ef9 pmdomain: core: Show latency/residency for domain idle states in debugfs
Similar to how cpuidle provides the values for latency and residency for
CPU's idle states through sysfs, let's make the corresponding data for PM
domain's idle states available for user space, via genpd's debugfs support.

Suggested-by: Dhruva Gole <d-gole@ti.com>
Reviewed-by: Dhruva Gole <d-gole@ti.com>
Reviewed-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-04-01 13:07:31 +02:00
Ulf Hansson
32d731611a pmdomain: core: Restructure domain idle states data for genpd in debugfs
To prepare for additional information to be added for the domain idle
states in genpd's debugfs, let's make the existing information denser. To
allow that, let's move the static information of the domain idle states
into a separate debugfs file.

Reviewed-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-04-01 13:07:31 +02:00
Gabor Juhos
a8a1c77a50 pmdomain: qcom: rpmpd: drop stray semicolon
Drop the unnecessary semicolon after the rpmpd_send_corner()
function's declaration.

Signed-off-by: Gabor Juhos <j4g8y7@gmail.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-04-01 13:07:31 +02:00
Felix Gu
c8e9b6a557 pmdomain: imx: scu-pd: Fix device_node reference leak during ->probe()
When calling of_parse_phandle_with_args(), the caller is responsible
to call of_node_put() to release the reference of device node.
In imx_sc_pd_get_console_rsrc(), it does not release the reference.

Fixes: 893cfb9973 ("firmware: imx: scu-pd: do not power off console domain")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-04-01 13:07:31 +02:00
Felix Gu
44c28e1c52 pmdomain: ti: omap_prm: Fix a reference leak on device node
When calling of_parse_phandle_with_args(), the caller is responsible
to call of_node_put() to release the reference of device node.
In omap_prm_domain_attach_dev, it does not release the reference.

Fixes: 58cbff023b ("soc: ti: omap-prm: Add basic power domain support")
Signed-off-by: Felix Gu <gu_0233@qq.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-04-01 13:07:31 +02:00
AngeloGioacchino Del Regno
6d1fdcfeb0 pmdomain: mediatek: scpsys: Add MT7622 Audio power domain to legacy driver
Add the Audio power domain of the MT7622 SoC to the legacy
mtk-scpsys driver (as this legacy SoC is supported only there).

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-04-01 13:07:31 +02:00
Krzysztof Kozlowski
ecd2f0eaff pmdomain: mediatek: Simplify with scoped for each OF child loop
Use scoped for-each loop when iterating over device nodes to make code a
bit simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-04-01 13:07:31 +02:00
Kendall Willis
adff6abbdc pmdomain: ti_sci: handle wakeup constraint for out-of-band wakeup
For devices capable of out-of-band system wakeups via I/O daisy chaining,
prevent sending wakeup constraints to the PM co-processor. This allows
the system to enter deeper low power modes, as the device is not marked
as requiring power.

Replaces the logic from commit b06bc47279 ("pmdomain: ti_sci: handle
wake IRQs for IO daisy chain wakeups") since checking out-of-band wakeup
will cover the same functionality.

Detect out-of-band wakeup in the suspend path, and if it exists, skip
sending the constraint.

Signed-off-by: Kendall Willis <k-willis@ti.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-04-01 13:07:31 +02:00
Nicolas Frattaroli
aeb6d7c676 pmdomain: mediatek: mtk-mfg: Expose shader_present as nvmem cell
Implement nvmem-provider functionality in mtk-mfg-pmdomain, such that it
can expose its GF_REG_SHADER_PRESENT value in the shared memory as an
nvmem cell for panthor.

Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-04-01 13:07:31 +02:00
Karel Balej
007028ed90 pmdomain: add audio power island for Marvell PXA1908 SoC
Define power domain which needs to be enabled in order for audio to work
on the PXA1908-based samsung,coreprimevelte smartphone. In the
downstream code, this power-on method is marked as specific to the ULCx
series which is allegedly a codename of sorts with ULC1 corresponding to
the PXA1908.

No other audio components needed for sound to work on this phone are
currently available mainline but some successful testing was performed
with the vendor variants of the respective drivers and with the domain
forced always-on.

Signed-off-by: Karel Balej <balejk@matfyz.cz>
Reviewed-by: Duje Mihanović <duje@dujemihanovic.xyz>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-04-01 13:07:31 +02:00
Marco Felsch
6cc5a23329 pmdomain: imx93-blk-ctrl: add support for optional subnodes
This particular block can have DT subnodes describing the LVDS LDB, MIPI
DSI and parallel DPI bridge.

Scan for possible sub-devices within the driver, instead of misusing the
simple-bus to perform the scan.

Reviewed-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-04-01 13:07:31 +02:00
Marco Felsch
52becc1422 pmdomain: imx93-blk-ctrl: convert to devm_* only
Convert the driver to devm_ APIs only by making use of
devm_add_action_or_reset() and devm_pm_runtime_enable() to simplify the
probe error path and to drop the .remove() callback. This also ensures
that the device release order equals the device probe error path order.

Furthermore drop the dev_set_drvdata() usage since the only user was the
.remove() callback which is removed by this commit.

Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-04-01 13:07:31 +02:00
Marco Felsch
279eb2dd55 pmdomain: imx93-blk-ctrl: cleanup error path
Call dev_err_probe() directly during return to make the code more
compact.

Reviewed-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-04-01 13:07:31 +02:00
Jacky Bai
e91d5f94ac pmdomain: imx8mp-blk-ctrl: Keep the NOC_HDCP clock enabled
Keep the NOC_HDCP clock always enabled to fix the potential hang
caused by the NoC ADB400 port power down handshake.

Fixes: 77b0ddb42a ("soc: imx: add i.MX8MP HDMI blk ctrl HDCP/HRV_MWR")
Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-04-01 13:03:07 +02:00
Linus Torvalds
c715f13bb3 pmdomain providers:
- bcm: Increase ASB control timeout for bcm2835
  - mediatek: Fix power domain count
 -----BEGIN PGP SIGNATURE-----
 
 iQJLBAABCgA1FiEEugLDXPmKSktSkQsV/iaEJXNYjCkFAmm9KSkXHHVsZi5oYW5z
 c29uQGxpbmFyby5vcmcACgkQ/iaEJXNYjCmNvQ//YrJVq4giZeGSGQJ9LjPWN4gp
 YFkwTSWBpav751hx5xp9d7ua7pPZ+Z+FoKVYIHQvgsHqQv4eQqYa3kpeHLiUYBIW
 oLbRXIj2kyEOXAMUqhtHLN0E3dCM14sB6lsRi7yGJEXo8CD1hML1G6g2zxzwKpCC
 2zBTKbU4T30/eL+3/X45+uN46oREpx32oeiHpKF6UBLWScjmDuSXllt64cTPCTMr
 LX2X67DEL72tlGeVNYZLxMpV4M0BY0v1AMO64cbTpiJDo/AmmTnWROOqHLb0m8I1
 HqnHq8fWu7qXPwDM7zsxi9GY4kdBk4hCZouVA69SL+/9AVFI9Xx4TK99jqsZq7tM
 IePRE+5aCHgtcGiP290yxFfpSqzuCBil8xFm97FDdrMfMczO9B2Djf4jYNm+0vuy
 ZKuLw7TX6EsNrEwMILlb704T9xOUPfj2vVht7SnCWLigRL5ovZAMYgJUAfyyN3Q6
 G3ilm6QwNgxV/epoA9XzBUhdV5AMxCbtCbM14zaaoq4bxFZeRO2G8L+7RVQZDpLW
 i5TdUDRO9U169BvosKB48UE22XBH3R+0ktbXB6y2+BjDLtTt9bpGcWVC9YTMrDHs
 uX62v0jLjmzCECV1KjJ61xQeL2uiTtrTVasSlfazJmYGoFoEjJh2heIizaXfuXqX
 gAsC+WMyQYKE8jR2JKQ=
 =JfPZ
 -----END PGP SIGNATURE-----

Merge tag 'pmdomain-v7.0-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm

Pull pmdomain fixes from Ulf Hansson:

 - bcm: increase ASB control timeout for bcm2835

 - mediatek: fix power domain count

* tag 'pmdomain-v7.0-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm:
  pmdomain: bcm: bcm2835-power: Increase ASB control timeout
  pmdomain: mediatek: Fix power domain count
2026-03-20 09:46:15 -07:00
Maíra Canal
b826d2c0b0 pmdomain: bcm: bcm2835-power: Increase ASB control timeout
The bcm2835_asb_control() function uses a tight polling loop to wait
for the ASB bridge to acknowledge a request. During intensive workloads,
this handshake intermittently fails for V3D's master ASB on BCM2711,
resulting in "Failed to disable ASB master for v3d" errors during
runtime PM suspend. As a consequence, the failed power-off leaves V3D in
a broken state, leading to bus faults or system hangs on later accesses.

As the timeout is insufficient in some scenarios, increase the polling
timeout from 1us to 5us, which is still negligible in the context of a
power domain transition. Also, replace the open-coded ktime_get_ns()/
cpu_relax() polling loop with readl_poll_timeout_atomic().

Cc: stable@vger.kernel.org
Fixes: 670c672608 ("soc: bcm: bcm2835-pm: Add support for power domains under a new binding.")
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Stefan Wahren <wahrenst@gmx.net>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-03-18 19:15:34 +01:00
Adam Ford
b22c526569 pmdomain: mediatek: Fix power domain count
The wrong value of the number of domains is wrong which leads to
failures when trying to enumerate nested power domains.

 PM: genpd_xlate_onecell: invalid domain index 0
 PM: genpd_xlate_onecell: invalid domain index 1
 PM: genpd_xlate_onecell: invalid domain index 3
 PM: genpd_xlate_onecell: invalid domain index 4
 PM: genpd_xlate_onecell: invalid domain index 5
 PM: genpd_xlate_onecell: invalid domain index 13
 PM: genpd_xlate_onecell: invalid domain index 14

Attempts to use these power domains fail, so fix this by
using the correct value of calculated power domains.

Signed-off-by: Adam Ford <aford173@gmail.com>
Fixes: 88914db077 ("pmdomain: mediatek: Add support for Hardware Voter power domains")
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-03-12 14:51:52 +01:00
Linus Torvalds
345dfaaf9f pmdomain providers:
- rockchip: Fix PD_VCODEC for RK3588
  - bcm: Fix broken reset status read for bcm2835
 -----BEGIN PGP SIGNATURE-----
 
 iQJLBAABCgA1FiEEugLDXPmKSktSkQsV/iaEJXNYjCkFAmmqrwsXHHVsZi5oYW5z
 c29uQGxpbmFyby5vcmcACgkQ/iaEJXNYjCnsQBAAoXJi1Tp+uPbYh7DCC+tndEng
 gy/P4G98eKJNH+XVIQRbFJlEnrXF6Wwn3MlqJU+AeHIWONvC8VshFYHDn/m73QRk
 MxADvNZkseLllr09vx9l7NS9MDMEbBFUMOjDv1KCGwDoqtc7pvgg7GCGkL8rAgWi
 ATFv18L46OE/7tDmLm46wcdrF+85QXS1IGb+q42lhSAJ26Svm2vV3/SYvRp/4Q61
 dcEu6aRSyLdqa1Uaz2h06LNJJUDsaUSc/rI3Y+ruidEOkjvsbKmM4wmKXu/e2E+A
 F882V8nMAxuBGO5r191DSS04663zi4LrlR+UGMrDcIjuSP/R0wXJ6REvF3Xivrp4
 WsMs67QK7Qjy6Sg7w2EqFVaaX+n1rHYG9ereExTKmbG12tzLn52lmBJRSzFpJcyv
 mufbB2CLQvKSps7KEv7H4NoljEtYRhOLC64U7/czujewevyMR1ex+5snZChTv26g
 ln4MhHf/s8TZZAfUl+EcZy06rLPnrNcwdHgZwcUDpnrUBlFoFWyX8rfwXfmaKrKB
 KWZhRqDgQXfI2bcYIMRubREKc/TG2tV3FOte8cdkvY9CixwjNl7qmCOgTRH+7O/H
 PQac+/hWxiuviEPppWvsa7k2hmuTWM1XN7jbXe0zUIPu7t6IlVrByqycXzJ3cjOM
 BxJ65USqq1eBmXqksR0=
 =fNrn
 -----END PGP SIGNATURE-----

Merge tag 'pmdomain-v7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm

Pull pmdomain fixes from Ulf Hansson:

 - rockchip: Fix PD_VCODEC for RK3588

 - bcm: Fix broken reset status read for bcm2835

* tag 'pmdomain-v7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm:
  pmdomain: rockchip: Fix PD_VCODEC for RK3588
  pmdomain: bcm: bcm2835-power: Fix broken reset status read
2026-03-06 09:16:39 -08:00
Shawn Lin
0fb59eaca1 pmdomain: rockchip: Fix PD_VCODEC for RK3588
>From the RK3588 TRM Table 7-1 RK3588 Voltage Domain and Power Domain Summary,
PD_RKVDEC0/1 and PD_VENC0/1 rely on VD_VCODEC which require extra voltages to
be applied, otherwise it breaks RK3588-evb1-v10 board after vdec support landed[1].
The panic looks like below:

  rockchip-pm-domain fd8d8000.power-management:power-controller: failed to set domain 'rkvdec0' on, val=0
  rockchip-pm-domain fd8d8000.power-management:power-controller: failed to set domain 'rkvdec1' on, val=0
  ...
  Hardware name: Rockchip RK3588S EVB1 V10 Board (DT)
  Workqueue: pm genpd_power_off_work_fn
  Call trace:
  show_stack+0x18/0x24 (C)
  dump_stack_lvl+0x40/0x84
  dump_stack+0x18/0x24
  vpanic+0x1ec/0x4fc
  vpanic+0x0/0x4fc
  check_panic_on_warn+0x0/0x94
  arm64_serror_panic+0x6c/0x78
  do_serror+0xc4/0xcc
  el1h_64_error_handler+0x3c/0x5c
  el1h_64_error+0x6c/0x70
  regmap_mmio_read32le+0x18/0x24 (P)
  regmap_bus_reg_read+0xfc/0x130
  regmap_read+0x188/0x1ac
  regmap_read+0x54/0x78
  rockchip_pd_power+0xcc/0x5f0
  rockchip_pd_power_off+0x1c/0x4c
  genpd_power_off+0x84/0x120
  genpd_power_off+0x1b4/0x260
  genpd_power_off_work_fn+0x38/0x58
  process_scheduled_works+0x194/0x2c4
  worker_thread+0x2ac/0x3d8
  kthread+0x104/0x124
  ret_from_fork+0x10/0x20
  SMP: stopping secondary CPUs
  Kernel Offset: disabled
  CPU features: 0x3000000,000e0005,40230521,0400720b
  Memory Limit: none
  ---[ end Kernel panic - not syncing: Asynchronous SError Interrupt ]---

Chaoyi pointed out the PD_VCODEC is the parent of PD_RKVDEC0/1 and PD_VENC0/1, so checking
the PD_VCODEC is enough.

[1] https://lore.kernel.org/linux-rockchip/20251020212009.8852-2-detlev.casanova@collabora.com/

Fixes: db6df2e3fc ("pmdomain: rockchip: add regulator support")
Cc: stable@vger.kernel.org
Suggested-by: Chaoyi Chen <chaoyi.chen@rock-chips.com>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Reviewed-by: Chaoyi Chen <chaoyi.chen@rock-chips.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-03-04 11:22:36 +01:00
Maíra Canal
550bae2c09 pmdomain: bcm: bcm2835-power: Fix broken reset status read
bcm2835_reset_status() has a misplaced parenthesis on every PM_READ()
call. Since PM_READ(reg) expands to readl(power->base + (reg)), the
expression:

    PM_READ(PM_GRAFX & PM_V3DRSTN)

computes the bitwise AND of the register offset PM_GRAFX with the
bitmask PM_V3DRSTN before using the result as a register offset, reading
from the wrong MMIO address instead of the intended PM_GRAFX register.
The same issue affects the PM_IMAGE cases.

Fix by moving the closing parenthesis so PM_READ() receives only the
register offset, and the bitmask is applied to the value returned by
the read.

Fixes: 670c672608 ("soc: bcm: bcm2835-pm: Add support for power domains under a new binding.")
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Reviewed-by: Stefan Wahren <wahrenst@gmx.net>
Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-27 18:02:35 +01:00
Rafael J. Wysocki
7a73801fda pmdomain: imx: gpcv2: Discard pm_runtime_put() return value
Passing pm_runtime_put() return value to the callers is not particularly
useful.

Returning an error code from pm_runtime_put() merely means that it has
not queued up a work item to check whether or not the device can be
suspended and there are many perfectly valid situations in which that
can happen, like after writing "on" to the devices' runtime PM "control"
attribute in sysfs for one example.

Accordingly, update imx_pgc_domain_suspend() to simply discard the
return value of pm_runtime_put() and always return success to the
caller.

This will facilitate a planned change of the pm_runtime_put() return
type to void in the future.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Link: https://patch.msgid.link/15658107.tv2OnDr8pf@rafael.j.wysocki
2026-02-23 14:05:38 +01:00
Linus Torvalds
bf4afc53b7 Convert 'alloc_obj' family to use the new default GFP_KERNEL argument
This was done entirely with mindless brute force, using

    git grep -l '\<k[vmz]*alloc_objs*(.*, GFP_KERNEL)' |
        xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/'

to convert the new alloc_obj() users that had a simple GFP_KERNEL
argument to just drop that argument.

Note that due to the extreme simplicity of the scripting, any slightly
more complex cases spread over multiple lines would not be triggered:
they definitely exist, but this covers the vast bulk of the cases, and
the resulting diff is also then easier to check automatically.

For the same reason the 'flex' versions will be done as a separate
conversion.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2026-02-21 17:09:51 -08:00
Kees Cook
69050f8d6d treewide: Replace kmalloc with kmalloc_obj for non-scalar types
This is the result of running the Coccinelle script from
scripts/coccinelle/api/kmalloc_objs.cocci. The script is designed to
avoid scalar types (which need careful case-by-case checking), and
instead replace kmalloc-family calls that allocate struct or union
object instances:

Single allocations:	kmalloc(sizeof(TYPE), ...)
are replaced with:	kmalloc_obj(TYPE, ...)

Array allocations:	kmalloc_array(COUNT, sizeof(TYPE), ...)
are replaced with:	kmalloc_objs(TYPE, COUNT, ...)

Flex array allocations:	kmalloc(struct_size(PTR, FAM, COUNT), ...)
are replaced with:	kmalloc_flex(*PTR, FAM, COUNT, ...)

(where TYPE may also be *VAR)

The resulting allocations no longer return "void *", instead returning
"TYPE *".

Signed-off-by: Kees Cook <kees@kernel.org>
2026-02-21 01:02:28 -08:00
Linus Torvalds
0dbc357710 pmdomain providers:
- imx: Fix system wakeup support for imx8mp power domains
  - imx: Fix potential out-of-range access for imx8m power domains
  - imx: Fix the imx8mm gpu hang
  - qcom: Fix off-by-one error for highest state in rpmpd
 -----BEGIN PGP SIGNATURE-----
 
 iQJLBAABCgA1FiEEugLDXPmKSktSkQsV/iaEJXNYjCkFAmmFymcXHHVsZi5oYW5z
 c29uQGxpbmFyby5vcmcACgkQ/iaEJXNYjCkvDw/9EzYteDEg4D0/WhU+/R41ttTu
 c/7J3Ooi6k3zXaBgZjV0iGLw1xMf6QTQ+s5/L68ADjgzqtKBDQlg3eItsKewTWqO
 bjSFc2VD/FxEdVnb8c/BlC6k+1KcBddk4ncNsProMvxv2j33FXAkd+RjI3DDFJaQ
 qXG8Eh01UV94ltirStDG8mf0zIHRMm5TxuF6eK2gD3dYSVosw9s+rLhwNweGwITJ
 AVWOEBZK2fs8cc0Ej2urw8oBNz8wpdP5YivE3jzD3XQ4/8d4lkKjSur4sZ+8XKTE
 qGb6op46IPz2yMlcmbGH8ZJLx5s33I5nzXceb90mQzpQECO6uM6bxt2IXhA4iTmd
 RO3fnDc6BuGGsRMx7RSeaFo5sLClkKpRye8gmxP7EWkFxOo2hp6UriVB4Zo5ThqN
 Oc3aGNSFTfJXn5R0GIRk1vp+VTfeu8qgPaggJAjYd+7CYs94x6YYI2FH3lJcazc9
 PcaACM8JkfNooc4VzMPMPz1cribS/p/qdhG1lcAZgphGYi1Nw1euH0KVJ8X4Npbn
 UivimblqyOkubXO9p1ckUNU65/0+jwRqdts/WOriuCKj/pyd3d03lcqbGuwvUoJw
 85v7cVpCi7yu+deNoH8hTyKkrp3e8HSx013OzhHHu7Z1FPGy6saKgxRwjQLnUqJi
 TXIPFbVO6nVF0ZcJFU0=
 =IJY6
 -----END PGP SIGNATURE-----

Merge tag 'pmdomain-v6.19-rc3-3' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm

Pull pmdomain fixes from Ulf Hansson:

 - imx:
     - Fix system wakeup support for imx8mp power domains
     - Fix potential out-of-range access for imx8m power domains
     - Fix the imx8mm gpu hang

 - qcom: Fix off-by-one error for highest state in rpmpd

* tag 'pmdomain-v6.19-rc3-3' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm:
  pmdomain: imx8mp-blk-ctrl: Keep usb phy power domain on for system wakeup
  pmdomain: imx8mp-blk-ctrl: Keep gpc power domain on for system wakeup
  pmdomain: imx8m-blk-ctrl: fix out-of-range access of bc->domains
  pmdomain: imx: gpcv2: Fix the imx8mm gpu hang due to wrong adb400 reset
  pmdomain: qcom: rpmpd: fix off-by-one error in clamping to the highest state
2026-02-06 10:10:39 -08:00
Xu Yang
e2c4c5b2bb pmdomain: imx8mp-blk-ctrl: Keep usb phy power domain on for system wakeup
USB system wakeup need its PHY on, so add the GENPD_FLAG_ACTIVE_WAKEUP
flags to USB PHY genpd configuration.

Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
Fixes: 556f5cf956 ("soc: imx: add i.MX8MP HSIO blk-ctrl")
Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-05 11:33:30 +01:00
Xu Yang
e9ab2b8389 pmdomain: imx8mp-blk-ctrl: Keep gpc power domain on for system wakeup
Current design will power off all dependent GPC power domains in
imx8mp_blk_ctrl_suspend(), even though the user device has enabled
wakeup capability. The result is that wakeup function never works
for such device.

An example will be USB wakeup on i.MX8MP. PHY device '382f0040.usb-phy'
is attached to power domain 'hsioblk-usb-phy2' which is spawned by hsio
block control. A virtual power domain device 'genpd:3:32f10000.blk-ctrl'
is created to build connection with 'hsioblk-usb-phy2' and it depends on
GPC power domain 'usb-otg2'. If device '382f0040.usb-phy' enable wakeup,
only power domain 'hsioblk-usb-phy2' keeps on during system suspend,
power domain 'usb-otg2' is off all the time. So the wakeup event can't
happen.

In order to further establish a connection between the power domains
related to GPC and block control during system suspend, register a genpd
power on/off notifier for the power_dev. This allows us to prevent the GPC
power domain from being powered off, in case the block control power
domain is kept on to serve system wakeup.

Suggested-by: Ulf Hansson <ulf.hansson@linaro.org>
Fixes: 556f5cf956 ("soc: imx: add i.MX8MP HSIO blk-ctrl")
Cc: stable@vger.kernel.org
Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-05 11:31:43 +01:00
Xu Yang
6bd8b4a92a pmdomain: imx8m-blk-ctrl: fix out-of-range access of bc->domains
Fix out-of-range access of bc->domains in imx8m_blk_ctrl_remove().

Fixes: 2684ac05a8 ("soc: imx: add i.MX8M blk-ctrl driver")
Cc: stable@kernel.org
Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-01-30 12:16:42 +01:00
Jacky Bai
ae0a24c5a8 pmdomain: imx: gpcv2: Fix the imx8mm gpu hang due to wrong adb400 reset
On i.MX8MM, the GPUMIX, GPU2D, and GPU3D blocks share a common reset
domain. Due to this hardware limitation, powering off/on GPU2D or GPU3D
also triggers a reset of the GPUMIX domain, including its ADB400 port.
However, the ADB400 interface must always be placed into power‑down mode
before being reset.

Currently the GPUMIX and GPU2D/3D power domains rely on runtime PM to
handle dependency ordering. In some corner cases, the GPUMIX power off
sequence is skipped, leaving the ADB400 port active when GPU2D/3D reset.
This causes the GPUMIX ADB400 port to be reset while still active,
leading to unpredictable bus behavior and GPU hangs.

To avoid this, refine the power‑domain control logic so that the GPUMIX
ADB400 port is explicitly powered down and powered up as part of the GPU
power domain on/off sequence. This ensures proper ordering and prevents
incorrect ADB400 reset.

Suggested-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Tested-by: Philipp Zabel <p.zabel@pengutronix.de>
Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-01-27 15:19:02 +01:00
Gabor Juhos
8aa6f7697f pmdomain: qcom: rpmpd: fix off-by-one error in clamping to the highest state
As it is indicated by the comment, the rpmpd_aggregate_corner() function
tries to clamp the state to the highest corner/level supported by the
given power domain, however the calculation of the highest state contains
an off-by-one error.

The 'max_state' member of the 'rpmpd' structure indicates the highest
corner/level, and as such it does not needs to be decremented.

Change the code to use the 'max_state' value directly to avoid the error.

Fixes: 98c8b3efac ("soc: qcom: rpmpd: Add sync_state")
Signed-off-by: Gabor Juhos <j4g8y7@gmail.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-01-27 15:13:24 +01:00
Linus Torvalds
9731fa48be pmdomain providers:
- imx: Remove incorrect reset/clock mask for 8mq vpu
  - rockchip: Fix initial state of PM domain
 -----BEGIN PGP SIGNATURE-----
 
 iQJLBAABCgA1FiEEugLDXPmKSktSkQsV/iaEJXNYjCkFAmlzZXoXHHVsZi5oYW5z
 c29uQGxpbmFyby5vcmcACgkQ/iaEJXNYjCl2MQ/9ENVi3Us1n2Uk6hBI9FC8l1I8
 JHtk7Oy8K+QYcenHU9Fevcgb/7HtR2XsugBu3Xuvn8jHGmdQM0ldCBoLDGamTvJX
 oUVjXNAW5Gh+M5OA5dnjt+kh0Nut7WjdAupdVlQwydD0mykakdp845Sc6PquqcrE
 SVFlElvmyfdKwbB+Quj4q49gJtEqqq9EKhZ2IxHTLC/uL/NdZV8vZSTsHe5V0s4q
 ofSPHtnNI8CfGPFCGWw5/DoFukPCboSbr/0T0qieDpRTyFee0HecdIFyyLSyLmAt
 +Z1LIaD+GLkMStLU25Klh7c08MPMD2vUYU2u2or1V5KTw7xU/mChzClTKYGBobce
 QC/HrniQKqJ5hJlPsMXJk0CurEkDt3/VoBj9DXkCqVGJSHVkg1zUB30Z/9IyKE9l
 GhYpVDBWS4lG9ABHo8uLXdH9T7/+dMioDUTs4QkoAc4NSygK4gLRpaMV6yk1dPdh
 gMEzzkFdhV+BpMHl83HGkTujhHpL9lHDcHYKFDqPNmMcuTzR9htQfSFlmrQjF6Nd
 t9sZ8PiK8JN8QLPNGK7o4amoAZ6o0FpEw7PU5oYDX+2mAHHwanNhJV/vQVDZb3pw
 CfurtSwV3blgfSt2ytlRwUZtDIIyFiu1bOdU03oup+Y2b+/yGw4IuK7REcUVHl7k
 ZRhWyLRYlxQ3omHcVvo=
 =yDKM
 -----END PGP SIGNATURE-----

Merge tag 'pmdomain-v6.19-rc3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm

Pull pmdomain fixes from Ulf Hansson:

 - imx: Remove incorrect reset/clock mask for 8mq vpu

 - rockchip: Fix initial state of PM domain

* tag 'pmdomain-v6.19-rc3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm:
  pmdomain:rockchip: Fix init genpd as GENPD_STATE_ON before regulator ready
  pmdomain: imx8m-blk-ctrl: Remove separate rst and clk mask for 8mq vpu
2026-01-23 13:12:49 -08:00
Arnd Bergmann
0638dc292e Qualcomm Arm64 DeviceTree fixes for v6.19
Add missing power-domains to the SC8280XP RPM power-domain and ensure
 these are voted for from the remoteproc instances while powering them
 up.
 
 Clear a couple of DeviceTree validation warnings in SM8550 and SM8650
 USB controller nodes.
 
 Specify the correct display panel on the OnePlus 6.
 
 Correct the UFS clock mapping on Talos, to ensure UFS is properly
 clocked.
 
 Add Abel's old emails address to .mailmap.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEBd4DzF816k8JZtUlCx85Pw2ZrcUFAmluVH0ACgkQCx85Pw2Z
 rcWJIxAAywFqiEYYvtFVm8Kn9yM7gZH1xhcQKKOpGtK+I/fSLurgsYgaFIB6pnEk
 Zfo8mUtJUUxyjq25sI3b2fjcx9L92HpH91UZNWXHxvJaMNtOdLxy5uJOKVGD0D3q
 IiVmhuk/zzeLuTvWL2KxyodQWagmu6YcMBeQCQpW9Wt6IRcbVs4f3Lpv8GkSG8Ex
 EXgozt2mMDCzBZAL+Nui9UvTZaSO/0NCAbYxq/VRah6uAaUJhYcTY1cp54ylTHcG
 N1k7luZwEcBZgY2oVpsQYhwJYtlL9ccjy14CxR3F2XhsPhMj1xHMt2TYqlUbONZx
 Yr77wDJ8uX2xhUqRbUnYN/lOm8G8GX/lj0Vqf/QdorLGhv0UIbmHByCLnQm2ea0o
 ufyGBbeA+On5F9MRAvbvAomGmEktuuwnyOtT/asMdR21/Rf/JVfIPlPc13dXO7+c
 v01/g8aaHAijxfAr6hEKyQEb4M02t0LExbNoJt22l/dwChrH0nHagQ2vUaSzNswn
 gQRoN9CZYDAlJUhRRVzUkiXyenIthlnbehBXxxbPyJk6ITYh0bfkS74vEce17aFw
 CGacW2e7bkwSP9V1pjZprPp1MiOS+KLLQt70LXT1FXBqnwjrxGnL/Q8Hnq466nFU
 AcRmP7Clnev9+7IG/6RNe6Qg/r7LvTODp8/1+RRWu4pp/O5dSH8=
 =ztcO
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmlwk8QACgkQmmx57+YA
 GNm57RAAwsvs5kINIUFFMC2B9usx+sd3cq1/psAXl3AhkpI7rrqIKA8lieReLGeW
 we2kAepIFu4X1NaFU3iguvekszHuALDl+c99SDXIdn3nsEMew8tkz/SmFfMU0qPV
 FEg3zeqCl5tI4cnJQ21D33QweZd7MPZYfMCENGGT7Tjap4U8rTT9r7BECdooWUXH
 O+u+XWxqD1vqUBWNyuBE1gAQJ94DdcFodfCWMC8qSgYKtAd4aVAdWktlyQelYGi9
 1m38JXQ82cJ4+srEi4bWluLKrChwh3UWthwCvA70fDvPr/urAkb35KAtxWIYl6tQ
 /XESAmsz+7eO8WyCIIFo8QdHnrfHH1bnwv6et0NKh5bsQxVSSMyYvFkYITeLpfn2
 bB7oMIbci73sEmkGwTivR8cHcB3gV156SZleoVgw2DGuIdpjGR5GXxkvTFNpP9wM
 sKQcwArqrQHk2MdVBFp6TnHYOapTHX79HTKonxiYTuGiN1/mu9yslXIQr1Fkv+MI
 xappY499fCeHEJc6Y2v5MhfZmy8xLQ6hfaGWajsK2TH7hduO85F0P1ApbASyzyY4
 CmgNWjA9W/sfh5UeGYPgxeltxOdVxg88ByAD2Ed7+bNVJmhD5sEYo/nzA+yrJF5J
 q0FWmnzam/NjNGID6mlCLGRh0MdTm3Doo4Dx3rwtN4GNwiQSCIM=
 =Tt/r
 -----END PGP SIGNATURE-----

Merge tag 'qcom-arm64-fixes-for-6.19' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/fixes

Qualcomm Arm64 DeviceTree fixes for v6.19

Add missing power-domains to the SC8280XP RPM power-domain and ensure
these are voted for from the remoteproc instances while powering them
up.

Clear a couple of DeviceTree validation warnings in SM8550 and SM8650
USB controller nodes.

Specify the correct display panel on the OnePlus 6.

Correct the UFS clock mapping on Talos, to ensure UFS is properly
clocked.

Add Abel's old emails address to .mailmap.

* tag 'qcom-arm64-fixes-for-6.19' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux:
  arm64: dts: qcom: sm8650: Fix compile warnings in USB controller node
  arm64: dts: qcom: sm8550: Fix compile warnings in USB controller node
  arm64: dts: qcom: sc8280xp: Add missing VDD_MXC links
  pmdomain: qcom: rpmhpd: Add MXC to SC8280XP
  dt-bindings: power: qcom,rpmpd: Add SC8280XP_MXC_AO
  arm64: dts qcom: sdm845-oneplus-enchilada: Specify panel name within the compatible
  mailmap: Update email address for Abel Vesa
  arm64: dts: qcom: talos: Correct UFS clocks ordering

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2026-01-21 09:52:19 +01:00
Frank Zhang
861d21c43c pmdomain:rockchip: Fix init genpd as GENPD_STATE_ON before regulator ready
RK3588_PD_NPU initialize as GENPD_STATE_ON before regulator ready.
rknn_iommu initlized success and suspend RK3588_PD_NPU. When rocket
driver register, it will resume rknn_iommu.

If regulator is still not ready at this point, rknn_iommu resume fail,
pm runtime status will be error: -EPROBE_DEFER.

This patch set pmdomain to off if it need regulator during probe,
consumer device can power on pmdomain after regulator ready.

Signed-off-by: Frank Zhang <rmxpzlb@gmail.com>
Tested-by: Chaoyi Chen <chaoyi.chen@rock-chips.com>
Tested-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Fixes: db6df2e3fc ("pmdomain: rockchip: add regulator support")
Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-01-15 13:39:16 +01:00
Ming Qian
3de4996649 pmdomain: imx8m-blk-ctrl: Remove separate rst and clk mask for 8mq vpu
For i.MX8MQ platform, the ADB in the VPUMIX domain has no separate reset
and clock enable bits, but is ungated and reset together with the VPUs.
So we can't reset G1 or G2 separately, it may led to the system hang.
Remove rst_mask and clk_mask of imx8mq_vpu_blk_ctl_domain_data.
Let imx8mq_vpu_power_notifier() do really vpu reset.

Fixes: 608d7c325e ("soc: imx: imx8m-blk-ctrl: add i.MX8MQ VPU blk-ctrl")
Signed-off-by: Ming Qian <ming.qian@oss.nxp.com>
Reviewed-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-01-03 10:45:35 +01:00
Wentao Liang
73cb5f6eaf pmdomain: imx: Fix reference count leak in imx_gpc_probe()
of_get_child_by_name() returns a node pointer with refcount incremented.
Use the __free() attribute to manage the pgc_node reference, ensuring
automatic of_node_put() cleanup when pgc_node goes out of scope.

This eliminates the need for explicit error handling paths and avoids
reference count leaks.

Fixes: 721cabf6c6 ("soc: imx: move PGC handling to a new GPC driver")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2025-12-29 11:41:09 +01:00
Macpaul Lin
305f254727 pmdomain: mtk-pm-domains: Fix spinlock recursion fix in probe
Remove scpsys_get_legacy_regmap(), replacing its usage with
of_find_node_with_property(). Explicitly call of_node_get(np) before each
of_find_node_with_property() to maintain correct node reference counting.

The of_find_node_with_property() function "consumes" its input by calling
of_node_put() internally, whether or not it finds a match.  Currently,
dev->of_node (np) is passed multiple times in sequence without incrementing
its reference count, causing it to be decremented multiple times and
risking early memory release.

Adding of_node_get(np) before each call balances the reference count,
preventing premature node release.

Fixes: c1bac49fe9 ("pmdomains: mtk-pm-domains: Fix spinlock recursion in probe")
Cc: stable@vger.kernel.org
Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
Tested-by: Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2025-12-29 11:41:09 +01:00
Konrad Dybcio
5bc3e720e7 pmdomain: qcom: rpmhpd: Add MXC to SC8280XP
This was apparently accounted for in dt-bindings, but never made its
way into the driver.

Fix it for SC8280XP and its VDD_GFX-less cousin, SA8540P.

Fixes: f68f1cb343 ("soc: qcom: rpmhpd: add sc8280xp & sa8540p rpmh power-domains")
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Link: https://lore.kernel.org/r/20251202-topic-8280_mxc-v2-2-46cdf47a829e@oss.qualcomm.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
2025-12-16 15:24:09 -08:00