| 0f575766 | 08-May-2025 |
Dan Carpenter <[email protected]> |
pmdomain: core: Fix error checking in genpd_dev_pm_attach_by_id()
The error checking for of_count_phandle_with_args() does not handle negative error codes correctly. The problem is that "index" is
pmdomain: core: Fix error checking in genpd_dev_pm_attach_by_id()
The error checking for of_count_phandle_with_args() does not handle negative error codes correctly. The problem is that "index" is a u32 so in the condition "if (index >= num_domains)" negative error codes stored in "num_domains" are type promoted to very high positive values and "index" is always going to be valid.
Test for negative error codes first and then test if "index" is valid.
Fixes: 3ccf3f0cd197 ("PM / Domains: Enable genpd_dev_pm_attach_by_id|name() for single PM domain") Signed-off-by: Dan Carpenter <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
show more ...
|
| 6cf5db71 | 14-Mar-2025 |
Sudeep Holla <[email protected]> |
pmdomain: arm: scmi_pm_domain: Remove redundant state verification
Currently, scmi_pd_power() explicitly verifies whether the requested power state was applied by calling state_get(). While this che
pmdomain: arm: scmi_pm_domain: Remove redundant state verification
Currently, scmi_pd_power() explicitly verifies whether the requested power state was applied by calling state_get(). While this check could detect failures where the state was not properly updated, ensuring correctness is the responsibility of the SCMI firmware.
Removing this redundant state_get() call eliminates an unnecessary round-trip to the firmware, improving efficiency. Any mismatches between the requested and actual states should be handled by the SCMI firmware, which must return a failure if state_set() is unsuccessful.
Additionally, in some cases, checking the state after powering off a domain may be unreliable or unsafe, depending on the firmware implementation.
This patch removes the redundant verification, simplifying the function without compromising correctness.
Reported-and-tested-by: Ranjani Vaidyanathan <[email protected]> Signed-off-by: Sudeep Holla <[email protected]> Reviewed-by: Peng Fan <[email protected]> Reviewed-by: Cristian Marussi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
show more ...
|
| 6ec7c4a2 | 14-Mar-2025 |
Arnd Bergmann <[email protected]> |
pmdomain: thead: fix TH1520_AON_PROTOCOL dependency
Kconfig treats the dependency as optional, but the header file only provides normal declarations and no empty API stubs:
ld: fs/btrfs/extent_io.o
pmdomain: thead: fix TH1520_AON_PROTOCOL dependency
Kconfig treats the dependency as optional, but the header file only provides normal declarations and no empty API stubs:
ld: fs/btrfs/extent_io.o: in function `writepage_delalloc': extent_io.c:(.text+0x2b42): undefined reference to `__udivdi3' ld: drivers/pmdomain/thead/th1520-pm-domains.o: in function `th1520_pd_power_off': th1520-pm-domains.c:(.text+0x57): undefined reference to `th1520_aon_power_update' ld: drivers/pmdomain/thead/th1520-pm-domains.o: in function `th1520_pd_power_on': th1520-pm-domains.c:(.text+0x8a): undefined reference to `th1520_aon_power_update' ld: drivers/pmdomain/thead/th1520-pm-domains.o: in function `th1520_pd_probe': th1520-pm-domains.c:(.text+0xb8): undefined reference to `th1520_aon_init' ld: th1520-pm-domains.c:(.text+0x1c6): undefined reference to `th1520_aon_power_update'
Since the firmware code can easily be enabled for compile testing, there is no need to add stubs either, so just make it a hard dependency.
Fixes: dc9a897dbb03 ("pmdomain: thead: Add power-domain driver for TH1520") Signed-off-by: Arnd Bergmann <[email protected]> Reviewed-by: Michal Wilczynski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
show more ...
|
| dc9a897d | 11-Mar-2025 |
Michal Wilczynski <[email protected]> |
pmdomain: thead: Add power-domain driver for TH1520
The T-Head TH1520 SoC contains multiple power islands that can be programmatically turned on and off using the AON (Always-On) protocol and a hard
pmdomain: thead: Add power-domain driver for TH1520
The T-Head TH1520 SoC contains multiple power islands that can be programmatically turned on and off using the AON (Always-On) protocol and a hardware mailbox [1]. The relevant mailbox driver has already been merged into the mainline kernel in commit 5d4d263e1c6b ("mailbox: Introduce support for T-head TH1520 Mailbox driver");
Introduce a power-domain driver for the TH1520 SoC, which is using AON firmware protocol to communicate with E902 core through the hardware mailbox. This way it can send power on/off commands to the E902 core.
The interaction with AUDIO power island e.g trying to turn it OFF proved to crash the firmware running on the E902 core. Introduce the workaround to disable interacting with the power island.
[1] Link: https://openbeagle.org/beaglev-ahead/beaglev-ahead/-/blob/main/docs/TH1520%20System%20User%20Manual.pdf
Signed-off-by: Michal Wilczynski <[email protected]> Acked-by: Drew Fustini <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
show more ...
|
| a4cb9066 | 04-Mar-2025 |
Arnd Bergmann <[email protected]> |
pmdomain: rockchip: add regulator dependency
When CONFIG_REGULATOR is disabled, this pmdomain driver fails to build:
drivers/pmdomain/rockchip/pm-domains.c:653:30: error: implicit declaration of fu
pmdomain: rockchip: add regulator dependency
When CONFIG_REGULATOR is disabled, this pmdomain driver fails to build:
drivers/pmdomain/rockchip/pm-domains.c:653:30: error: implicit declaration of function 'devm_of_regulator_get'; did you mean 'devm_regulator_get'? [-Wimplicit-function-declaration] 653 | pd->supply = devm_of_regulator_get(pmu->dev, pd->node, "domain"); | ^~~~~~~~~~~~~~~~~~~~~ | devm_regulator_get drivers/pmdomain/rockchip/pm-domains.c:653:28: error: assignment to 'struct regulator *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 653 | pd->supply = devm_of_regulator_get(pmu->dev, pd->node, "domain"); | ^
Add a Kconfig dependency.
Fixes: db6df2e3fc16 ("pmdomain: rockchip: add regulator support") Signed-off-by: Arnd Bergmann <[email protected]> Reviewed-by: Sebastian Reichel <[email protected]> Reviewed-by: Dragan Simic <[email protected]> Reviewed-by: Heiko Stuebner <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
show more ...
|
| db6df2e3 | 20-Feb-2025 |
Sebastian Reichel <[email protected]> |
pmdomain: rockchip: add regulator support
Some power domains require extra voltages to be applied. For example trying to enable the GPU power domain on RK3588 fails when the SoC does not have VDD GP
pmdomain: rockchip: add regulator support
Some power domains require extra voltages to be applied. For example trying to enable the GPU power domain on RK3588 fails when the SoC does not have VDD GPU enabled. The same is expected to happen for the NPU, which also has a dedicated supply line.
We get the regulator using devm_of_regulator_get(), so a missing dependency in the devicetree is handled gracefully by printing a warning and creating a dummy regulator. This is necessary, since existing DTs do not have the regulator described. They might still work if the regulator is marked as always-on. It is also working if the regulator is enabled at boot time and the GPU driver is probed before the kernel disables unused regulators.
The regulator itself is not acquired at driver probe time, since that creates an unsolvable circular dependency. The power domain driver must be probed early, since SoC peripherals need it. Regulators on the other hand depend on SoC peripherals like SPI, I2C or GPIO. MediaTek does not run into this, since they have two power domain drivers.
Tested-by: Heiko Stuebner <[email protected]> Reviewed-by: Heiko Stuebner <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]> Link: https://lore.kernel.org/r/20250220-rk3588-gpu-pwr-domain-regulator-v6-7-a4f9c24e5b81@kernel.org [Ulf: Fixed conflict when applying] Signed-off-by: Ulf Hansson <[email protected]>
show more ...
|
| 6b2690df | 20-Feb-2025 |
Peter Geis <[email protected]> |
pmdomain: rockchip: fix rockchip_pd_power error handling
The calls rockchip_pd_power makes to rockchip_pmu_set_idle_request lack any return error handling, causing device drivers to incorrectly beli
pmdomain: rockchip: fix rockchip_pd_power error handling
The calls rockchip_pd_power makes to rockchip_pmu_set_idle_request lack any return error handling, causing device drivers to incorrectly believe the hardware idle requests succeed when they may have failed. This leads to software possibly accessing hardware that is powered off and the subsequent SError panic that follows.
Add error checking and return errors to the calling function to prevent such crashes.
gst-launch-1.0 videotestsrc num-buffers=2000 ! v4l2jpegenc ! fakesink Setting pipeline to PAUSED ...er-x64 Pipeline is PREROLLING ... Redistribute latency... rockchip-pm-domain ff100000.syscon:power-controller: failed to get ack on domain 'hevc', val=0x98260 SError Interrupt on CPU2, code 0x00000000bf000002 -- SError
Signed-off-by: Peter Geis <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sebastian Reichel <[email protected]> Link: https://lore.kernel.org/r/20250220-rk3588-gpu-pwr-domain-regulator-v6-5-a4f9c24e5b81@kernel.org Signed-off-by: Ulf Hansson <[email protected]>
show more ...
|
| edcef667 | 20-Feb-2025 |
Sebastian Reichel <[email protected]> |
pmdomain: rockchip: reduce indentation in rockchip_pd_power
Rework the logic, so that the function exits early when the power domain state is already correct to reduce code indentation.
No function
pmdomain: rockchip: reduce indentation in rockchip_pd_power
Rework the logic, so that the function exits early when the power domain state is already correct to reduce code indentation.
No functional change intended.
Reviewed-by: Heiko Stuebner <[email protected]> Tested-by: Heiko Stuebner <[email protected]> Tested-by: Adrian Larumbe <[email protected]> # On Rock 5B Signed-off-by: Sebastian Reichel <[email protected]> Link: https://lore.kernel.org/r/20250220-rk3588-gpu-pwr-domain-regulator-v6-4-a4f9c24e5b81@kernel.org Signed-off-by: Ulf Hansson <[email protected]>
show more ...
|
| 7ab6c930 | 20-Feb-2025 |
Sebastian Reichel <[email protected]> |
pmdomain: rockchip: forward rockchip_do_pmu_set_power_domain errors
Currently rockchip_do_pmu_set_power_domain prints a warning if there have been errors turning on the power domain, but it does not
pmdomain: rockchip: forward rockchip_do_pmu_set_power_domain errors
Currently rockchip_do_pmu_set_power_domain prints a warning if there have been errors turning on the power domain, but it does not return any errors and rockchip_pd_power() tries to continue setting up the QOS registers. This usually results in accessing unpowered registers, which triggers an SError and a full system hang.
This improves the error handling by forwarding the error to avoid kernel panics.
Reviewed-by: Heiko Stuebner <[email protected]> Tested-by: Heiko Stuebner <[email protected]> Tested-by: Adrian Larumbe <[email protected]> # On Rock 5B Signed-off-by: Sebastian Reichel <[email protected]> Link: https://lore.kernel.org/r/20250220-rk3588-gpu-pwr-domain-regulator-v6-3-a4f9c24e5b81@kernel.org [Ulf: Fixed conflict when applying] Signed-off-by: Ulf Hansson <[email protected]>
show more ...
|
| bc4bc2a1 | 24-Feb-2025 |
Ulf Hansson <[email protected]> |
pmdomain: rockchip: Fix build error
To resolve the build error with undefined reference to `arm_smccc_1_1_get_conduit', let's add a build dependency to HAVE_ARM_SMCCC_DISCOVERY.
Reported-by: Stephe
pmdomain: rockchip: Fix build error
To resolve the build error with undefined reference to `arm_smccc_1_1_get_conduit', let's add a build dependency to HAVE_ARM_SMCCC_DISCOVERY.
Reported-by: Stephen Rothwell <[email protected]> Fixes: 61eeb9678789 ("pmdomain: rockchip: Check if SMC could be handled by TA") Signed-off-by: Ulf Hansson <[email protected]>
show more ...
|
| 6568cb40 | 18-Feb-2025 |
Ahmad Fatoum <[email protected]> |
pmdomain: imx: gpcv2: use proper helper for property detection
Starting with commit c141ecc3cecd7 ("of: Warn when of_property_read_bool() is used on non-boolean properties"), probing the gpcv2 devic
pmdomain: imx: gpcv2: use proper helper for property detection
Starting with commit c141ecc3cecd7 ("of: Warn when of_property_read_bool() is used on non-boolean properties"), probing the gpcv2 device on i.MX8M SoCs leads to warnings when LOCKDEP is enabled.
Fix this by checking property presence with of_property_present as intended.
Signed-off-by: Ahmad Fatoum <[email protected]> Link: https://lore.kernel.org/r/20250218-gpcv2-of-property-present-v1-1-3bb1a9789654@pengutronix.de Signed-off-by: Ulf Hansson <[email protected]>
show more ...
|
| 61eeb967 | 19-Feb-2025 |
Shawn Lin <[email protected]> |
pmdomain: rockchip: Check if SMC could be handled by TA
Non-existent trusted-firmware could lead to SMC calls into some unset location, that breaks the system. Let's check that it's supported before
pmdomain: rockchip: Check if SMC could be handled by TA
Non-existent trusted-firmware could lead to SMC calls into some unset location, that breaks the system. Let's check that it's supported before executing the SMC.
Reported-by: Steven Price <[email protected]> Suggested-by: Heiko Stuebner <[email protected]> Fixes: 58ebba35ddab ("pmdomain: rockchip: Add smc call to inform firmware") Signed-off-by: Shawn Lin <[email protected]> Reviewed-by: Heiko Stuebner <[email protected]> Tested-by: Steven Price <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
show more ...
|
| c2851be5 | 05-Feb-2025 |
Geert Uytterhoeven <[email protected]> |
pmdomain: renesas: rcar-sysc: Drop fwnode_dev_initialized() call
As of commit bab2d712eeaf9d60 ("PM: domains: Mark fwnodes when their powerdomain is added/removed") in v5.12, the pmdomain core takes
pmdomain: renesas: rcar-sysc: Drop fwnode_dev_initialized() call
As of commit bab2d712eeaf9d60 ("PM: domains: Mark fwnodes when their powerdomain is added/removed") in v5.12, the pmdomain core takes care of marking the fwnode initialized, so there is no need to repeat it.
Signed-off-by: Geert Uytterhoeven <[email protected]> Acked-by: Saravana Kannan <[email protected]> Link: https://lore.kernel.org/r/05c2ef630694a28b560426d8c426881cc14e8f7c.1738748678.git.geert+renesas@glider.be Signed-off-by: Ulf Hansson <[email protected]>
show more ...
|
| c41bac72 | 05-Feb-2025 |
Andras Szemzo <[email protected]> |
pmdomain: sunxi: add V853 ppu support
V853 has a similar ppu like Allwinner D1, add compatible and the available pd names.
Signed-off-by: Andras Szemzo <[email protected]> Link: https://lore.
pmdomain: sunxi: add V853 ppu support
V853 has a similar ppu like Allwinner D1, add compatible and the available pd names.
Signed-off-by: Andras Szemzo <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
show more ...
|
| 43b73a5a | 01-Feb-2025 |
Stefan Wahren <[email protected]> |
pmdomain: bcm2835-power: set flag GENPD_FLAG_ACTIVE_WAKEUP
Set flag GENPD_FLAG_ACTIVE_WAKEUP to bcm2835_power genpd, then when a device is set as wakeup source using device_set_wakeup_enable, the po
pmdomain: bcm2835-power: set flag GENPD_FLAG_ACTIVE_WAKEUP
Set flag GENPD_FLAG_ACTIVE_WAKEUP to bcm2835_power genpd, then when a device is set as wakeup source using device_set_wakeup_enable, the power domain could be kept on to make sure the device could wakeup the system.
Signed-off-by: Stefan Wahren <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
show more ...
|
| 885f5669 | 20-Jan-2025 |
Christian Marangi <[email protected]> |
pmdomain: airoha: Fix compilation error with Clang-20 and Thumb2 mode
The use of R7 in the SMCCC conflicts with the compiler's use of R7 as a frame pointer in Thumb2 mode, which is forcibly enabled
pmdomain: airoha: Fix compilation error with Clang-20 and Thumb2 mode
The use of R7 in the SMCCC conflicts with the compiler's use of R7 as a frame pointer in Thumb2 mode, which is forcibly enabled by Clang when profiling hooks are inserted via the -pg switch.
This is a known issue and similar driver workaround this with a Makefile ifdef. Exact workaround are applied in drivers/firmware/arm_scmi/transports/Makefile and other similar driver.
Suggested-by: Sudeep Holla <[email protected]> Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Fixes: 82e703dd438b ("pmdomain: airoha: Add Airoha CPU PM Domain support") Signed-off-by: Christian Marangi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
show more ...
|
| c2d7aa30 | 15-Jan-2025 |
Sudeep Holla <[email protected]> |
pmdomain: arm: scmi_pm_domain: Send an explicit request to set the current state
On a system with multiple active SCMI agents, one agent(other than OSPM/ Linux or bootloader) would request to turn o
pmdomain: arm: scmi_pm_domain: Send an explicit request to set the current state
On a system with multiple active SCMI agents, one agent(other than OSPM/ Linux or bootloader) would request to turn on a shared power domain before the Linux boots/initialise the genpds. So when the Linux boots and gets the power state as already ON, it just registers the genpd with a default ON state.
However, when the driver that needs this shared power domain is probed genpd sees that the power domain status is ON and never makes any SCMI call to power it up which is correct. But, since Linux didn't make an explicit request to turn on the shared power domain, the SCMI platform firmware will not know if the OSPM agent is actively using it.
Suppose the other agent that requested the shared power domain to be powered ON requests to power it OFF as it no longer needs it, the SCMI platform firmware needs to turn it off if there are no active users of it which in the above scenaro is the case.
As a result of SCMI platform firmware turning off the resource, OSPM/ Linux will crash the moment as it expects the shared power domain to be powered ON.
Send an explicit request to set the current state when setting up the genpd power domains so that OSPM registers its vote in the power domain state with the SCMI platform firmware.
The other option is to not read the state and set the genpds as default OFF, but it can't handle the scenario on certain platforms where SCMI platform keeps all the power domains turned ON by default for faster boot (or any other such variations) and expect the OSPM to turn off the unused domains if power saving is required.
Link: https://lore.kernel.org/all/Z4aBkezSWOPCXcUh@bogus Reported-by: Ranjani Vaidyanathan <[email protected]> Reported-by: Peng Fan <[email protected]> Signed-off-by: Sudeep Holla <[email protected]> Reviewed-by: Cristian Marussi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
show more ...
|
| 726efa92 | 15-Jan-2025 |
Xiaolei Wang <[email protected]> |
pmdomain: imx8mp-blk-ctrl: add missing loop break condition
Currently imx8mp_blk_ctrl_remove() will continue the for loop until an out-of-bounds exception occurs.
pstate: 60000005 (nZCv daif -PAN -
pmdomain: imx8mp-blk-ctrl: add missing loop break condition
Currently imx8mp_blk_ctrl_remove() will continue the for loop until an out-of-bounds exception occurs.
pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : dev_pm_domain_detach+0x8/0x48 lr : imx8mp_blk_ctrl_shutdown+0x58/0x90 sp : ffffffc084f8bbf0 x29: ffffffc084f8bbf0 x28: ffffff80daf32ac0 x27: 0000000000000000 x26: ffffffc081658d78 x25: 0000000000000001 x24: ffffffc08201b028 x23: ffffff80d0db9490 x22: ffffffc082340a78 x21: 00000000000005b0 x20: ffffff80d19bc180 x19: 000000000000000a x18: ffffffffffffffff x17: ffffffc080a39e08 x16: ffffffc080a39c98 x15: 4f435f464f006c72 x14: 0000000000000004 x13: ffffff80d0172110 x12: 0000000000000000 x11: ffffff80d0537740 x10: ffffff80d05376c0 x9 : ffffffc0808ed2d8 x8 : ffffffc084f8bab0 x7 : 0000000000000000 x6 : 0000000000000000 x5 : ffffff80d19b9420 x4 : fffffffe03466e60 x3 : 0000000080800077 x2 : 0000000000000000 x1 : 0000000000000001 x0 : 0000000000000000 Call trace: dev_pm_domain_detach+0x8/0x48 platform_shutdown+0x2c/0x48 device_shutdown+0x158/0x268 kernel_restart_prepare+0x40/0x58 kernel_kexec+0x58/0xe8 __do_sys_reboot+0x198/0x258 __arm64_sys_reboot+0x2c/0x40 invoke_syscall+0x5c/0x138 el0_svc_common.constprop.0+0x48/0xf0 do_el0_svc+0x24/0x38 el0_svc+0x38/0xc8 el0t_64_sync_handler+0x120/0x130 el0t_64_sync+0x190/0x198 Code: 8128c2d0 ffffffc0 aa1e03e9 d503201f
Fixes: 556f5cf9568a ("soc: imx: add i.MX8MP HSIO blk-ctrl") Cc: [email protected] Signed-off-by: Xiaolei Wang <[email protected]> Reviewed-by: Lucas Stach <[email protected]> Reviewed-by: Fabio Estevam <[email protected]> Reviewed-by: Frank Li <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
show more ...
|