MALI: bifrost: Change clock source to normal pll when suspend

When call pm_runtime_get_sync(), the runtime callback will change clock
source to normal pll, but now pm_runtime_get_sync() is called in a delay
work and the wakelock seems to be invalid on linux system,
so when suspend the pm_runtime_get_sync() may not be called.

Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: I0a951b455c10158ca63d747e35e9001cdbdde91c
This commit is contained in:
Finley Xiao
2022-03-28 21:22:16 +08:00
committed by Tao Huang
parent a78431756f
commit cb62fa6675
2 changed files with 13 additions and 0 deletions

View File

@@ -5391,6 +5391,11 @@ static int kbase_device_suspend(struct device *dev)
flush_workqueue(kbdev->devfreq_queue.workq);
}
#endif
if (kbdev->is_runtime_resumed) {
if (kbdev->pm.backend.callback_power_runtime_off)
kbdev->pm.backend.callback_power_runtime_off(kbdev);
}
return 0;
}
@@ -5410,6 +5415,11 @@ static int kbase_device_resume(struct device *dev)
if (!kbdev)
return -ENODEV;
if (kbdev->is_runtime_resumed) {
if (kbdev->pm.backend.callback_power_runtime_on)
kbdev->pm.backend.callback_power_runtime_on(kbdev);
}
kbase_pm_resume(kbdev);
#ifdef CONFIG_MALI_BIFROST_DVFS
@@ -5469,6 +5479,7 @@ static int kbase_device_runtime_suspend(struct device *dev)
if (kbdev->pm.backend.callback_power_runtime_off) {
kbdev->pm.backend.callback_power_runtime_off(kbdev);
kbdev->is_runtime_resumed = false;
dev_dbg(dev, "runtime suspend\n");
}
return ret;
@@ -5498,6 +5509,7 @@ static int kbase_device_runtime_resume(struct device *dev)
// KBASE_KTRACE_ADD(kbdev, PM_RUNTIME_RESUME_CALLBACK, NULL, 0);
if (kbdev->pm.backend.callback_power_runtime_on) {
ret = kbdev->pm.backend.callback_power_runtime_on(kbdev);
kbdev->is_runtime_resumed = true;
dev_dbg(dev, "runtime resume\n");
}

View File

@@ -1073,6 +1073,7 @@ struct kbase_device {
struct mutex kctx_list_lock;
struct rockchip_opp_info opp_info;
bool is_runtime_resumed;
#ifdef CONFIG_MALI_BIFROST_DEVFREQ
struct devfreq_dev_profile devfreq_profile;
struct devfreq *devfreq;