From 963b168fc23cec9e1e148907a9c85f2a7e406399 Mon Sep 17 00:00:00 2001 From: Lina Iyer Date: Wed, 6 May 2020 15:49:51 -0600 Subject: [PATCH] cpuidle: lpm-levels: no hotplug for single core Register for hotplug and dev_pm_qos notification only for SMP so covering under CONFIG_SMP flag. Change-Id: Ic3da9648a4dd5c762cd97dbb9f1915f79bd2481e Signed-off-by: Lina Iyer Signed-off-by: Tushar Nimkar --- drivers/cpuidle/lpm-levels.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/cpuidle/lpm-levels.c b/drivers/cpuidle/lpm-levels.c index 5a98fc93596d..64a96f6f9ed2 100644 --- a/drivers/cpuidle/lpm-levels.c +++ b/drivers/cpuidle/lpm-levels.c @@ -121,12 +121,14 @@ static void cluster_prepare(struct lpm_cluster *cluster, static bool sleep_disabled; module_param_named(sleep_disabled, sleep_disabled, bool, 0664); +#ifdef CONFIG_SMP static int lpm_cpu_qos_notify(struct notifier_block *nb, unsigned long val, void *ptr); static struct notifier_block dev_pm_qos_nb[MAX_LPM_CPUS] = { [0 ... (MAX_LPM_CPUS - 1)] = { .notifier_call = lpm_cpu_qos_notify }, }; +#endif #ifdef CONFIG_SCHED_WALT static bool check_cpu_isolated(int cpu) @@ -140,6 +142,7 @@ static bool check_cpu_isolated(int cpu) } #endif +#ifdef CONFIG_SMP static int lpm_cpu_qos_notify(struct notifier_block *nb, unsigned long val, void *ptr) { @@ -171,6 +174,7 @@ static int lpm_online_cpu(unsigned int cpu) DEV_PM_QOS_RESUME_LATENCY); return 0; } +#endif /** * msm_cpuidle_get_deep_idle_latency - Get deep idle latency value @@ -219,6 +223,7 @@ static void update_debug_pc_event(enum debug_event event, uint32_t arg1, spin_unlock(&debug_lock); } +#ifdef CONFIG_SMP static int lpm_dying_cpu(unsigned int cpu) { struct lpm_cluster *cluster = per_cpu(cpu_lpm, cpu)->parent; @@ -241,7 +246,7 @@ static int lpm_starting_cpu(unsigned int cpu) 0, true); return 0; } - +#endif static void histtimer_cancel(void) { unsigned int cpu = raw_smp_processor_id(); @@ -1695,7 +1700,7 @@ static int lpm_probe(struct platform_device *pdev) pr_err("Failed to register with cpuidle framework\n"); goto failed; } - +#ifdef CONFIG_SMP ret = cpuhp_setup_state(CPUHP_AP_QCOM_TIMER_STARTING, "AP_QCOM_SLEEP_STARTING", lpm_starting_cpu, lpm_dying_cpu); @@ -1707,7 +1712,7 @@ static int lpm_probe(struct platform_device *pdev) lpm_online_cpu, lpm_offline_cpu); if (ret) goto failed; - +#endif module_kobj = kset_find_obj(module_kset, KBUILD_MODNAME); if (!module_kobj) { pr_err("Cannot find kobject for module %s\n", KBUILD_MODNAME);