From b700529dba7673381e1084a71a3bf3e9b9078a04 Mon Sep 17 00:00:00 2001 From: Raghavendra Kakarla Date: Thu, 18 Jan 2024 09:04:29 +0530 Subject: [PATCH] Revert "cpuidle: governors: qcom-lpm: Do not disable CPUidle during suspend" This reverts commit 7dcee2dc40f4ed5131f9f4738b221c7e193da027. Delayed core wakeup mess up the cluster genpd sd counter post late suspend phase. Disallow cpuidle during suspend. Change-Id: I8f1a06214ee7a05d38c2941550877ae70abcf15c Signed-off-by: Raghavendra Kakarla --- drivers/cpuidle/governors/qcom-lpm.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/cpuidle/governors/qcom-lpm.c b/drivers/cpuidle/governors/qcom-lpm.c index 8862b103cd86..f0c46e16372b 100644 --- a/drivers/cpuidle/governors/qcom-lpm.c +++ b/drivers/cpuidle/governors/qcom-lpm.c @@ -3,7 +3,7 @@ * Copyright (C) 2006-2007 Adam Belay * Copyright (C) 2009 Intel Corporation * Copyright (c) 2012-2021, The Linux Foundation. All rights reserved. - * Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2024, Qualcomm Innovation Center, Inc. All rights reserved. */ #include @@ -67,6 +67,9 @@ static bool lpm_disallowed(s64 sleep_ns, int cpu) uint64_t bias_time = 0; #endif + if (suspend_in_progress) + return true; + if (!check_cpu_isactive(cpu)) return false; @@ -801,14 +804,22 @@ static void lpm_disable_device(struct cpuidle_driver *drv, static void qcom_lpm_suspend_trace(void *unused, const char *action, int event, bool start) { + int cpu; + if (start && !strcmp("dpm_suspend_late", action)) { suspend_in_progress = true; + for_each_online_cpu(cpu) + wake_up_if_idle(cpu); return; } - if (!start && !strcmp("dpm_resume_early", action)) + if (!start && !strcmp("dpm_resume_early", action)) { suspend_in_progress = false; + + for_each_online_cpu(cpu) + wake_up_if_idle(cpu); + } } static struct cpuidle_governor lpm_governor = {