Skip to content

Commit 2e69142

Browse files
computersforpeacechanwoochoi
authored andcommitted
PM / devfreq: rk3399_dmc: Block PMU during transitions
See the previous patch ("soc: rockchip: power-domain: Manage resource conflicts with firmware") for a thorough explanation of the conflicts. While ARM Trusted Firmware may be modifying memory controller and power-domain states, we need to block the kernel's power-domain driver. If the power-domain driver is disabled, there is no resource conflict and this becomes a no-op. Signed-off-by: Brian Norris <briannorris@chromium.org> Reviewed-by: Douglas Anderson <dianders@chromium.org> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
1 parent defec17 commit 2e69142

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

drivers/devfreq/rk3399_dmc.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <linux/rwsem.h>
2222
#include <linux/suspend.h>
2323

24+
#include <soc/rockchip/pm_domains.h>
2425
#include <soc/rockchip/rk3399_grf.h>
2526
#include <soc/rockchip/rockchip_sip.h>
2627

@@ -93,6 +94,16 @@ static int rk3399_dmcfreq_target(struct device *dev, unsigned long *freq,
9394

9495
mutex_lock(&dmcfreq->lock);
9596

97+
/*
98+
* Ensure power-domain transitions don't interfere with ARM Trusted
99+
* Firmware power-domain idling.
100+
*/
101+
err = rockchip_pmu_block();
102+
if (err) {
103+
dev_err(dev, "Failed to block PMU: %d\n", err);
104+
goto out_unlock;
105+
}
106+
96107
/*
97108
* Some idle parameters may be based on the DDR controller clock, which
98109
* is half of the DDR frequency.
@@ -198,6 +209,8 @@ static int rk3399_dmcfreq_target(struct device *dev, unsigned long *freq,
198209
dmcfreq->volt = target_volt;
199210

200211
out:
212+
rockchip_pmu_unblock();
213+
out_unlock:
201214
mutex_unlock(&dmcfreq->lock);
202215
return err;
203216
}

0 commit comments

Comments
 (0)