From 9af2c23239abec9d846c4a24125ab910dcb34ec5 Mon Sep 17 00:00:00 2001 From: Maria Yu Date: Tue, 13 Aug 2019 17:25:28 +0800 Subject: [PATCH] cpufreq: schedutil: Queue sugov irq work on policy online cpu Got never update frequency if scheduled the irq work on an offlined cpu and it will always pending. Queue sugov irq work on any online cpu if current cpu is offline. Change-Id: I33fc691917b5866488b6aeb11ed902a2753130b2 Signed-off-by: Maria Yu [clingutla@codeaurora.org: Moved 'walt_irq_work_queue' to 'sched.h' for multiple callers] Signed-off-by: Lingutla Chandrasekhar --- kernel/sched/cpufreq_schedutil.c | 2 +- kernel/sched/sched.h | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c index 70de34338384..10c490521a54 100644 --- a/kernel/sched/cpufreq_schedutil.c +++ b/kernel/sched/cpufreq_schedutil.c @@ -263,7 +263,7 @@ static void sugov_deferred_update(struct sugov_policy *sg_policy, u64 time, if (use_pelt()) sg_policy->work_in_progress = true; - irq_work_queue(&sg_policy->irq_work); + walt_irq_work_queue(&sg_policy->irq_work); } #define TARGET_LOAD 80 diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index d7df89dbff31..165369e4acf9 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -3368,3 +3368,18 @@ extern void walt_init_sched_boost(struct task_group *tg); #else static inline void walt_init_sched_boost(struct task_group *tg) {} #endif + +#ifdef CONFIG_SCHED_WALT +static inline void walt_irq_work_queue(struct irq_work *work) +{ + if (likely(cpu_online(raw_smp_processor_id()))) + irq_work_queue(work); + else + irq_work_queue_on(work, cpumask_any(cpu_online_mask)); +} +#else +static inline void walt_irq_work_queue(struct irq_work *work) +{ + irq_work_queue(work); +} +#endif