Loading Documentation/devicetree/bindings/arm/msm/msm_core.txt +0 −4 Original line number Diff line number Diff line Loading @@ -28,10 +28,6 @@ Optional properties: is no change in threshold. If this property is not present, the power is recalculated only on temperature threshold notifications. -qcom,throttling-temp: Temperature threshold for cpu frequency mitigation. The value should be set same as the threshold temperature in thermal module - 5 C, such that there is a bandwidth to control the cores before frequency mitigation happens. [Second level nodes] Required properties to define per core characteristics: Loading drivers/power/qcom/msm-core.c +16 −10 Original line number Diff line number Diff line Loading @@ -98,6 +98,7 @@ struct cpu_static_info { static DEFINE_MUTEX(policy_update_mutex); static DEFINE_MUTEX(kthread_update_mutex); static DEFINE_SPINLOCK(update_lock); static struct delayed_work sampling_work; static struct completion sampling_completion; static struct task_struct *sampling_task; Loading @@ -118,9 +119,6 @@ module_param_named(disabled, disabled, int, S_IRUGO | S_IWUSR | S_IWGRP); static bool in_suspend; static bool activate_power_table; static int max_throttling_temp = 80; /* in C */ module_param_named(throttling_temp, max_throttling_temp, int, S_IRUGO | S_IWUSR | S_IWGRP); /* * Cannot be called from an interrupt context Loading Loading @@ -198,8 +196,6 @@ static void repopulate_stats(int cpu) temp_point = (cpu_node->temp - TEMP_BASE_POINT) / 5; cpu_stats[cpu].temp = cpu_node->temp; cpu_stats[cpu].throttling = cpu_node->temp >= max_throttling_temp ? true : false; for (i = 0; i < cpu_node->sp->num_of_freqs; i++) pt[i].power = cpu_node->sp->power[temp_point][i]; Loading @@ -211,7 +207,6 @@ void trigger_cpu_pwr_stats_calc(void) { int cpu; static long prev_temp[NR_CPUS]; static DEFINE_SPINLOCK(update_lock); struct cpu_activity_info *cpu_node; if (disabled) Loading @@ -235,6 +230,20 @@ void trigger_cpu_pwr_stats_calc(void) } EXPORT_SYMBOL(trigger_cpu_pwr_stats_calc); void set_cpu_throttled(cpumask_t *mask, bool throttling) { int cpu; if (!mask) return; spin_lock(&update_lock); for_each_cpu(cpu, mask) cpu_stats[cpu].throttling = throttling; spin_unlock(&update_lock); } EXPORT_SYMBOL(set_cpu_throttled); static void update_related_freq_table(struct cpufreq_policy *policy) { int cpu, num_of_freqs; Loading Loading @@ -511,8 +520,7 @@ static int msm_core_stats_init(struct device *dev, int cpu) cpu_node = &activity[cpu]; cpu_stats[cpu].cpu = cpu; cpu_stats[cpu].temp = cpu_node->temp; cpu_stats[cpu].throttling = cpu_node->temp >= max_throttling_temp ? true : false; cpu_stats[cpu].throttling = false; cpu_stats[cpu].len = cpu_node->sp->num_of_freqs; pstate = devm_kzalloc(dev, Loading Loading @@ -983,8 +991,6 @@ static int msm_core_dev_probe(struct platform_device *pdev) if (ret) pr_info("msm-core initialized without polling period\n"); key = "qcom,throttling-temp"; ret = of_property_read_u32(node, key, &max_throttling_temp); ret = uio_init(pdev); if (ret) Loading include/soc/qcom/msm-core.h 0 → 100644 +22 −0 Original line number Diff line number Diff line /* * Copyright (c) 2014, 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 __ARCH_ARM_MACH_MSM_CORE_H #define __ARCH_ARM_MACH_MSM_CORE_H #ifdef CONFIG_APSS_CORE_EA void set_cpu_throttled(struct cpumask *mask, bool throttling); #else static inline void set_cpu_throttled(struct cpumask *mask, bool throttling) {} #endif #endif Loading
Documentation/devicetree/bindings/arm/msm/msm_core.txt +0 −4 Original line number Diff line number Diff line Loading @@ -28,10 +28,6 @@ Optional properties: is no change in threshold. If this property is not present, the power is recalculated only on temperature threshold notifications. -qcom,throttling-temp: Temperature threshold for cpu frequency mitigation. The value should be set same as the threshold temperature in thermal module - 5 C, such that there is a bandwidth to control the cores before frequency mitigation happens. [Second level nodes] Required properties to define per core characteristics: Loading
drivers/power/qcom/msm-core.c +16 −10 Original line number Diff line number Diff line Loading @@ -98,6 +98,7 @@ struct cpu_static_info { static DEFINE_MUTEX(policy_update_mutex); static DEFINE_MUTEX(kthread_update_mutex); static DEFINE_SPINLOCK(update_lock); static struct delayed_work sampling_work; static struct completion sampling_completion; static struct task_struct *sampling_task; Loading @@ -118,9 +119,6 @@ module_param_named(disabled, disabled, int, S_IRUGO | S_IWUSR | S_IWGRP); static bool in_suspend; static bool activate_power_table; static int max_throttling_temp = 80; /* in C */ module_param_named(throttling_temp, max_throttling_temp, int, S_IRUGO | S_IWUSR | S_IWGRP); /* * Cannot be called from an interrupt context Loading Loading @@ -198,8 +196,6 @@ static void repopulate_stats(int cpu) temp_point = (cpu_node->temp - TEMP_BASE_POINT) / 5; cpu_stats[cpu].temp = cpu_node->temp; cpu_stats[cpu].throttling = cpu_node->temp >= max_throttling_temp ? true : false; for (i = 0; i < cpu_node->sp->num_of_freqs; i++) pt[i].power = cpu_node->sp->power[temp_point][i]; Loading @@ -211,7 +207,6 @@ void trigger_cpu_pwr_stats_calc(void) { int cpu; static long prev_temp[NR_CPUS]; static DEFINE_SPINLOCK(update_lock); struct cpu_activity_info *cpu_node; if (disabled) Loading @@ -235,6 +230,20 @@ void trigger_cpu_pwr_stats_calc(void) } EXPORT_SYMBOL(trigger_cpu_pwr_stats_calc); void set_cpu_throttled(cpumask_t *mask, bool throttling) { int cpu; if (!mask) return; spin_lock(&update_lock); for_each_cpu(cpu, mask) cpu_stats[cpu].throttling = throttling; spin_unlock(&update_lock); } EXPORT_SYMBOL(set_cpu_throttled); static void update_related_freq_table(struct cpufreq_policy *policy) { int cpu, num_of_freqs; Loading Loading @@ -511,8 +520,7 @@ static int msm_core_stats_init(struct device *dev, int cpu) cpu_node = &activity[cpu]; cpu_stats[cpu].cpu = cpu; cpu_stats[cpu].temp = cpu_node->temp; cpu_stats[cpu].throttling = cpu_node->temp >= max_throttling_temp ? true : false; cpu_stats[cpu].throttling = false; cpu_stats[cpu].len = cpu_node->sp->num_of_freqs; pstate = devm_kzalloc(dev, Loading Loading @@ -983,8 +991,6 @@ static int msm_core_dev_probe(struct platform_device *pdev) if (ret) pr_info("msm-core initialized without polling period\n"); key = "qcom,throttling-temp"; ret = of_property_read_u32(node, key, &max_throttling_temp); ret = uio_init(pdev); if (ret) Loading
include/soc/qcom/msm-core.h 0 → 100644 +22 −0 Original line number Diff line number Diff line /* * Copyright (c) 2014, 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 __ARCH_ARM_MACH_MSM_CORE_H #define __ARCH_ARM_MACH_MSM_CORE_H #ifdef CONFIG_APSS_CORE_EA void set_cpu_throttled(struct cpumask *mask, bool throttling); #else static inline void set_cpu_throttled(struct cpumask *mask, bool throttling) {} #endif #endif