diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2016-10-22 01:19:19 -0600 |
|---|---|---|
| committer | Linux Build Service Account <lnxbuild@localhost> | 2016-10-22 01:19:20 -0600 |
| commit | 3bc48e6ff186a1cda9b62b16ef60c7ca0568ca68 (patch) | |
| tree | 34283bbaa7d08866e06b7d18d353e644f933be11 /kernel | |
| parent | 8872faa0ca8698d138361a1d09237e0ca81b4a62 (diff) | |
| parent | 876d57315fbf6751b6f2ddc10cbc67d49455bd60 (diff) | |
Promotion of kernel.lnx.4.4-161022.
CRs Change ID Subject
--------------------------------------------------------------------------------------------------------------
1069108 Iffc380898eac33f6c30c3808eb38d7bb499f5769 driver: thermal: msm_lmh_dcvs: Match the hardware freque
1077693 I59d4472b49b67f481992867a34e6779a4589d035 fg-util: fix a possible buffer overflow
1079245 Iee80fd2bf4b549665a12791009f0cf5ecc7653b9 msm: gsi: add command stats
1080510 I2ddb8b3b96063be3c6a6cb6bc333998e007f9de7 sched/core_ctl: Move header file to global location
1072739 I1405a8561b1ecb2e3da87ed8b26fb087433a1c11 ARM: dts: msm: Change pinctrl settings for BLSP1 UART3 f
1069108 If042fdae3102390dca6d5b1e257b38504b14320f defconfig: Enable generic cpu cooling device for msmcoba
1069108 I23762895d04dd6f1da8bb496f2a4cf22c1b34216 driver: thermal: msm_lmh_dcvs: Register LMH DCVS cooling
1080510 Iad0a9fc45f1ce87433995e8e549bfca80e8b9cb2 core_ctl: Add refcounting to boost api
1069108 I47960b002bf1bce1cd588de2892de46793a95562 drivers: thermal: cpu_cooling: allow platform freq mitig
1079061 Ia90832f9280f69c367c5d9f404b0d27c656e5c28 input: misc: pat9125: add sysfs for suspend-resume test
Change-Id: Ib2dcbeb2d85e602236c2196f3f306ab405b26f9f
CRs-Fixed: 1079061, 1072739, 1069108, 1079245, 1080510, 1077693
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/sched/core.c | 2 | ||||
| -rw-r--r-- | kernel/sched/core_ctl.c | 33 | ||||
| -rw-r--r-- | kernel/sched/core_ctl.h | 24 | ||||
| -rw-r--r-- | kernel/sched/hmp.c | 2 |
4 files changed, 30 insertions, 31 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 7e7e19ed53c6..53f7b50b7541 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -75,6 +75,7 @@ #include <linux/context_tracking.h> #include <linux/compiler.h> #include <linux/irq.h> +#include <linux/sched/core_ctl.h> #include <asm/switch_to.h> #include <asm/tlb.h> @@ -85,7 +86,6 @@ #endif #include "sched.h" -#include "core_ctl.h" #include "../workqueue_internal.h" #include "../smpboot.h" diff --git a/kernel/sched/core_ctl.c b/kernel/sched/core_ctl.c index d81886da7ca2..0db85a4fa9c8 100644 --- a/kernel/sched/core_ctl.c +++ b/kernel/sched/core_ctl.c @@ -45,7 +45,7 @@ struct cluster_data { bool nrrun_changed; struct task_struct *core_ctl_thread; unsigned int first_cpu; - bool boost; + unsigned int boost; struct kobject kobj; }; @@ -652,17 +652,40 @@ static bool do_check(u64 wallclock) return do_check; } -void core_ctl_set_boost(bool boost) +int core_ctl_set_boost(bool boost) { unsigned int index = 0; struct cluster_data *cluster; + unsigned long flags; + int ret = 0; + bool boost_state_changed = false; + spin_lock_irqsave(&state_lock, flags); for_each_cluster(cluster, index) { - if (cluster->is_big_cluster && cluster->boost != boost) { - cluster->boost = boost; - apply_need(cluster); + if (cluster->is_big_cluster) { + if (boost) { + boost_state_changed = !cluster->boost; + ++cluster->boost; + } else { + if (!cluster->boost) { + pr_err("Error turning off boost. Boost already turned off\n"); + ret = -EINVAL; + } else { + --cluster->boost; + boost_state_changed = !cluster->boost; + } + } + break; } } + spin_unlock_irqrestore(&state_lock, flags); + + if (boost_state_changed) + apply_need(cluster); + + trace_core_ctl_set_boost(cluster->boost, ret); + + return ret; } void core_ctl_check(u64 wallclock) diff --git a/kernel/sched/core_ctl.h b/kernel/sched/core_ctl.h deleted file mode 100644 index 3b0c12acb9c0..000000000000 --- a/kernel/sched/core_ctl.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2016, The Linux Foundation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 and - * only version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#ifndef __CORE_CTL_H -#define __CORE_CTL_H - -#ifdef CONFIG_SCHED_CORE_CTL -void core_ctl_check(u64 wallclock); -void core_ctl_set_boost(bool boost); -#else -static inline void core_ctl_check(u64 wallclock) {} -static inline void core_ctl_set_boost(bool boost) {} -#endif -#endif diff --git a/kernel/sched/hmp.c b/kernel/sched/hmp.c index 7039eb8f1e63..d220482f4dbc 100644 --- a/kernel/sched/hmp.c +++ b/kernel/sched/hmp.c @@ -18,9 +18,9 @@ #include <linux/list_sort.h> #include <linux/syscore_ops.h> #include <linux/of.h> +#include <linux/sched/core_ctl.h> #include "sched.h" -#include "core_ctl.h" #include <trace/events/sched.h> |
