You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branch 'pm-cpufreq'
* pm-cpufreq: (30 commits)
intel_pstate: Set core to min P state during core offline
cpufreq: Add stop CPU callback to cpufreq_driver interface
cpufreq: Remove unnecessary braces
cpufreq: Fix checkpatch errors and warnings
cpufreq: powerpc: add cpufreq transition latency for FSL e500mc SoCs
cpufreq: remove unused notifier: CPUFREQ_{SUSPENDCHANGE|RESUMECHANGE}
cpufreq: Do not allow ->setpolicy drivers to provide ->target
cpufreq: arm_big_little: set 'physical_cluster' for each CPU
cpufreq: arm_big_little: make vexpress driver depend on bL core driver
cpufreq: SPEAr: Instantiate as platform_driver
cpufreq: Remove unnecessary variable/parameter 'frozen'
cpufreq: Remove cpufreq_generic_exit()
cpufreq: add 'freq_table' in struct cpufreq_policy
cpufreq: Reformat printk() statements
cpufreq: Tegra: Use cpufreq_generic_suspend()
cpufreq: s5pv210: Use cpufreq_generic_suspend()
cpufreq: exynos: Use cpufreq_generic_suspend()
cpufreq: Implement cpufreq_generic_suspend()
cpufreq: suspend governors on system suspend/hibernate
cpufreq: move call to __find_governor() to cpufreq_init_policy()
...
This commit is contained in:
@@ -92,7 +92,3 @@ values:
|
||||
cpu - number of the affected CPU
|
||||
old - old frequency
|
||||
new - new frequency
|
||||
|
||||
If the cpufreq core detects the frequency has changed while the system
|
||||
was suspended, these notifiers are called with CPUFREQ_RESUMECHANGE as
|
||||
second argument.
|
||||
|
||||
@@ -61,7 +61,13 @@ target_index - See below on the differences.
|
||||
|
||||
And optionally
|
||||
|
||||
cpufreq_driver.exit - A pointer to a per-CPU cleanup function.
|
||||
cpufreq_driver.exit - A pointer to a per-CPU cleanup
|
||||
function called during CPU_POST_DEAD
|
||||
phase of cpu hotplug process.
|
||||
|
||||
cpufreq_driver.stop_cpu - A pointer to a per-CPU stop function
|
||||
called during CPU_DOWN_PREPARE phase of
|
||||
cpu hotplug process.
|
||||
|
||||
cpufreq_driver.resume - A pointer to a per-CPU resume function
|
||||
which is called with interrupts disabled
|
||||
|
||||
@@ -674,8 +674,7 @@ static int cpufreq_callback(struct notifier_block *nb,
|
||||
}
|
||||
|
||||
if ((val == CPUFREQ_PRECHANGE && freq->old < freq->new) ||
|
||||
(val == CPUFREQ_POSTCHANGE && freq->old > freq->new) ||
|
||||
(val == CPUFREQ_RESUMECHANGE || val == CPUFREQ_SUSPENDCHANGE)) {
|
||||
(val == CPUFREQ_POSTCHANGE && freq->old > freq->new)) {
|
||||
loops_per_jiffy = cpufreq_scale(global_l_p_j_ref,
|
||||
global_l_p_j_ref_freq,
|
||||
freq->new);
|
||||
|
||||
@@ -166,7 +166,7 @@ static int twd_cpufreq_transition(struct notifier_block *nb,
|
||||
* frequency. The timer is local to a cpu, so cross-call to the
|
||||
* changing cpu.
|
||||
*/
|
||||
if (state == CPUFREQ_POSTCHANGE || state == CPUFREQ_RESUMECHANGE)
|
||||
if (state == CPUFREQ_POSTCHANGE)
|
||||
smp_call_function_single(freqs->cpu, twd_update_frequency,
|
||||
NULL, 1);
|
||||
|
||||
|
||||
@@ -885,9 +885,6 @@ static int viper_cpufreq_notifier(struct notifier_block *nb,
|
||||
viper_set_core_cpu_voltage(freq->new, 0);
|
||||
}
|
||||
break;
|
||||
case CPUFREQ_RESUMECHANGE:
|
||||
viper_set_core_cpu_voltage(freq->new, 0);
|
||||
break;
|
||||
default:
|
||||
/* ignore */
|
||||
break;
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
static void __init spear1310_dt_init(void)
|
||||
{
|
||||
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
|
||||
platform_device_register_simple("spear-cpufreq", -1, NULL, 0);
|
||||
}
|
||||
|
||||
static const char * const spear1310_dt_board_compat[] = {
|
||||
|
||||
@@ -143,6 +143,7 @@ static void __init spear1340_dt_init(void)
|
||||
{
|
||||
of_platform_populate(NULL, of_default_bus_match_table,
|
||||
spear1340_auxdata_lookup, NULL);
|
||||
platform_device_register_simple("spear-cpufreq", -1, NULL, 0);
|
||||
}
|
||||
|
||||
static const char * const spear1340_dt_board_compat[] = {
|
||||
|
||||
@@ -303,6 +303,14 @@ source "drivers/cpuidle/Kconfig"
|
||||
|
||||
endmenu
|
||||
|
||||
menu "Power management options"
|
||||
|
||||
source "kernel/power/Kconfig"
|
||||
|
||||
source "drivers/cpufreq/Kconfig"
|
||||
|
||||
endmenu
|
||||
|
||||
source "net/Kconfig"
|
||||
|
||||
source "drivers/Kconfig"
|
||||
|
||||
@@ -1121,8 +1121,7 @@ oprof_cpufreq_notify(struct notifier_block *nb, unsigned long val, void *data)
|
||||
int ret = 0;
|
||||
struct cpufreq_freqs *frq = data;
|
||||
if ((val == CPUFREQ_PRECHANGE && frq->old < frq->new) ||
|
||||
(val == CPUFREQ_POSTCHANGE && frq->old > frq->new) ||
|
||||
(val == CPUFREQ_RESUMECHANGE || val == CPUFREQ_SUSPENDCHANGE))
|
||||
(val == CPUFREQ_POSTCHANGE && frq->old > frq->new))
|
||||
set_spu_profiling_frequency(frq->new, spu_cycle_reset);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -659,8 +659,7 @@ static int sparc64_cpufreq_notifier(struct notifier_block *nb, unsigned long val
|
||||
ft->clock_tick_ref = cpu_data(cpu).clock_tick;
|
||||
}
|
||||
if ((val == CPUFREQ_PRECHANGE && freq->old < freq->new) ||
|
||||
(val == CPUFREQ_POSTCHANGE && freq->old > freq->new) ||
|
||||
(val == CPUFREQ_RESUMECHANGE)) {
|
||||
(val == CPUFREQ_POSTCHANGE && freq->old > freq->new)) {
|
||||
cpu_data(cpu).clock_tick =
|
||||
cpufreq_scale(ft->clock_tick_ref,
|
||||
ft->ref_freq,
|
||||
|
||||
@@ -914,8 +914,7 @@ static int time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
|
||||
tsc_khz_ref = tsc_khz;
|
||||
}
|
||||
if ((val == CPUFREQ_PRECHANGE && freq->old < freq->new) ||
|
||||
(val == CPUFREQ_POSTCHANGE && freq->old > freq->new) ||
|
||||
(val == CPUFREQ_RESUMECHANGE)) {
|
||||
(val == CPUFREQ_POSTCHANGE && freq->old > freq->new)) {
|
||||
*lpj = cpufreq_scale(loops_per_jiffy_ref, ref_freq, freq->new);
|
||||
|
||||
tsc_khz = cpufreq_scale(tsc_khz_ref, ref_freq, freq->new);
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <linux/async.h>
|
||||
#include <linux/suspend.h>
|
||||
#include <trace/events/power.h>
|
||||
#include <linux/cpufreq.h>
|
||||
#include <linux/cpuidle.h>
|
||||
#include <linux/timer.h>
|
||||
|
||||
@@ -866,6 +867,8 @@ void dpm_resume(pm_message_t state)
|
||||
mutex_unlock(&dpm_list_mtx);
|
||||
async_synchronize_full();
|
||||
dpm_show_time(starttime, state, NULL);
|
||||
|
||||
cpufreq_resume();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1434,6 +1437,8 @@ int dpm_suspend(pm_message_t state)
|
||||
|
||||
might_sleep();
|
||||
|
||||
cpufreq_suspend();
|
||||
|
||||
mutex_lock(&dpm_list_mtx);
|
||||
pm_transition = state;
|
||||
async_error = 0;
|
||||
|
||||
@@ -200,7 +200,7 @@ source "drivers/cpufreq/Kconfig.x86"
|
||||
endmenu
|
||||
|
||||
menu "ARM CPU frequency scaling drivers"
|
||||
depends on ARM
|
||||
depends on ARM || ARM64
|
||||
source "drivers/cpufreq/Kconfig.arm"
|
||||
endmenu
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
# ARM CPU Frequency scaling drivers
|
||||
#
|
||||
|
||||
# big LITTLE core layer and glue drivers
|
||||
config ARM_BIG_LITTLE_CPUFREQ
|
||||
tristate "Generic ARM big LITTLE CPUfreq driver"
|
||||
depends on ARM && BIG_LITTLE && ARM_CPU_TOPOLOGY && HAVE_CLK
|
||||
@@ -16,6 +17,14 @@ config ARM_DT_BL_CPUFREQ
|
||||
This enables probing via DT for Generic CPUfreq driver for ARM
|
||||
big.LITTLE platform. This gets frequency tables from DT.
|
||||
|
||||
config ARM_VEXPRESS_SPC_CPUFREQ
|
||||
tristate "Versatile Express SPC based CPUfreq driver"
|
||||
depends on ARM_BIG_LITTLE_CPUFREQ && ARCH_VEXPRESS_SPC
|
||||
help
|
||||
This add the CPUfreq driver support for Versatile Express
|
||||
big.LITTLE platforms using SPC for power management.
|
||||
|
||||
|
||||
config ARM_EXYNOS_CPUFREQ
|
||||
bool
|
||||
|
||||
@@ -241,11 +250,3 @@ config ARM_TEGRA_CPUFREQ
|
||||
default y
|
||||
help
|
||||
This adds the CPUFreq driver support for TEGRA SOCs.
|
||||
|
||||
config ARM_VEXPRESS_SPC_CPUFREQ
|
||||
tristate "Versatile Express SPC based CPUfreq driver"
|
||||
select ARM_BIG_LITTLE_CPUFREQ
|
||||
depends on ARCH_VEXPRESS_SPC
|
||||
help
|
||||
This add the CPUfreq driver support for Versatile Express
|
||||
big.LITTLE platforms using SPC for power management.
|
||||
|
||||
@@ -855,7 +855,6 @@ static int acpi_cpufreq_cpu_exit(struct cpufreq_policy *policy)
|
||||
pr_debug("acpi_cpufreq_cpu_exit\n");
|
||||
|
||||
if (data) {
|
||||
cpufreq_frequency_table_put_attr(policy->cpu);
|
||||
per_cpu(acfreq_data, policy->cpu) = NULL;
|
||||
acpi_processor_unregister_performance(data->acpi_data,
|
||||
policy->cpu);
|
||||
|
||||
@@ -446,9 +446,12 @@ static int bL_cpufreq_init(struct cpufreq_policy *policy)
|
||||
}
|
||||
|
||||
if (cur_cluster < MAX_CLUSTERS) {
|
||||
int cpu;
|
||||
|
||||
cpumask_copy(policy->cpus, topology_core_cpumask(policy->cpu));
|
||||
|
||||
per_cpu(physical_cluster, policy->cpu) = cur_cluster;
|
||||
for_each_cpu(cpu, policy->cpus)
|
||||
per_cpu(physical_cluster, cpu) = cur_cluster;
|
||||
} else {
|
||||
/* Assumption: during init, we are always running on A15 */
|
||||
per_cpu(physical_cluster, policy->cpu) = A15_CLUSTER;
|
||||
@@ -478,7 +481,6 @@ static int bL_cpufreq_exit(struct cpufreq_policy *policy)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
cpufreq_frequency_table_put_attr(policy->cpu);
|
||||
put_cluster_clk_and_freq_table(cpu_dev);
|
||||
dev_dbg(cpu_dev, "%s: Exited, cpu: %d\n", __func__, policy->cpu);
|
||||
|
||||
|
||||
@@ -195,7 +195,6 @@ static struct cpufreq_driver bfin_driver = {
|
||||
.target_index = bfin_target,
|
||||
.get = bfin_getfreq_khz,
|
||||
.init = __bfin_cpu_init,
|
||||
.exit = cpufreq_generic_exit,
|
||||
.name = "bfin cpufreq",
|
||||
.attr = cpufreq_generic_attr,
|
||||
};
|
||||
|
||||
@@ -109,7 +109,6 @@ static struct cpufreq_driver cpu0_cpufreq_driver = {
|
||||
.target_index = cpu0_set_target,
|
||||
.get = cpufreq_generic_get,
|
||||
.init = cpu0_cpufreq_init,
|
||||
.exit = cpufreq_generic_exit,
|
||||
.name = "generic_cpu0",
|
||||
.attr = cpufreq_generic_attr,
|
||||
};
|
||||
|
||||
+233
-225
File diff suppressed because it is too large
Load Diff
@@ -180,27 +180,25 @@ static void cpufreq_stats_free_table(unsigned int cpu)
|
||||
cpufreq_cpu_put(policy);
|
||||
}
|
||||
|
||||
static int __cpufreq_stats_create_table(struct cpufreq_policy *policy,
|
||||
struct cpufreq_frequency_table *table)
|
||||
static int __cpufreq_stats_create_table(struct cpufreq_policy *policy)
|
||||
{
|
||||
unsigned int i, j, count = 0, ret = 0;
|
||||
struct cpufreq_stats *stat;
|
||||
struct cpufreq_policy *current_policy;
|
||||
unsigned int alloc_size;
|
||||
unsigned int cpu = policy->cpu;
|
||||
struct cpufreq_frequency_table *table;
|
||||
|
||||
table = cpufreq_frequency_get_table(cpu);
|
||||
if (unlikely(!table))
|
||||
return 0;
|
||||
|
||||
if (per_cpu(cpufreq_stats_table, cpu))
|
||||
return -EBUSY;
|
||||
stat = kzalloc(sizeof(*stat), GFP_KERNEL);
|
||||
if ((stat) == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
current_policy = cpufreq_cpu_get(cpu);
|
||||
if (current_policy == NULL) {
|
||||
ret = -EINVAL;
|
||||
goto error_get_fail;
|
||||
}
|
||||
|
||||
ret = sysfs_create_group(¤t_policy->kobj, &stats_attr_group);
|
||||
ret = sysfs_create_group(&policy->kobj, &stats_attr_group);
|
||||
if (ret)
|
||||
goto error_out;
|
||||
|
||||
@@ -223,7 +221,7 @@ static int __cpufreq_stats_create_table(struct cpufreq_policy *policy,
|
||||
stat->time_in_state = kzalloc(alloc_size, GFP_KERNEL);
|
||||
if (!stat->time_in_state) {
|
||||
ret = -ENOMEM;
|
||||
goto error_out;
|
||||
goto error_alloc;
|
||||
}
|
||||
stat->freq_table = (unsigned int *)(stat->time_in_state + count);
|
||||
|
||||
@@ -243,11 +241,10 @@ static int __cpufreq_stats_create_table(struct cpufreq_policy *policy,
|
||||
stat->last_time = get_jiffies_64();
|
||||
stat->last_index = freq_table_get_index(stat, policy->cur);
|
||||
spin_unlock(&cpufreq_stats_lock);
|
||||
cpufreq_cpu_put(current_policy);
|
||||
return 0;
|
||||
error_alloc:
|
||||
sysfs_remove_group(&policy->kobj, &stats_attr_group);
|
||||
error_out:
|
||||
cpufreq_cpu_put(current_policy);
|
||||
error_get_fail:
|
||||
kfree(stat);
|
||||
per_cpu(cpufreq_stats_table, cpu) = NULL;
|
||||
return ret;
|
||||
@@ -256,7 +253,6 @@ error_get_fail:
|
||||
static void cpufreq_stats_create_table(unsigned int cpu)
|
||||
{
|
||||
struct cpufreq_policy *policy;
|
||||
struct cpufreq_frequency_table *table;
|
||||
|
||||
/*
|
||||
* "likely(!policy)" because normally cpufreq_stats will be registered
|
||||
@@ -266,9 +262,7 @@ static void cpufreq_stats_create_table(unsigned int cpu)
|
||||
if (likely(!policy))
|
||||
return;
|
||||
|
||||
table = cpufreq_frequency_get_table(policy->cpu);
|
||||
if (likely(table))
|
||||
__cpufreq_stats_create_table(policy, table);
|
||||
__cpufreq_stats_create_table(policy);
|
||||
|
||||
cpufreq_cpu_put(policy);
|
||||
}
|
||||
@@ -291,20 +285,14 @@ static int cpufreq_stat_notifier_policy(struct notifier_block *nb,
|
||||
{
|
||||
int ret = 0;
|
||||
struct cpufreq_policy *policy = data;
|
||||
struct cpufreq_frequency_table *table;
|
||||
unsigned int cpu = policy->cpu;
|
||||
|
||||
if (val == CPUFREQ_UPDATE_POLICY_CPU) {
|
||||
cpufreq_stats_update_policy_cpu(policy);
|
||||
return 0;
|
||||
}
|
||||
|
||||
table = cpufreq_frequency_get_table(cpu);
|
||||
if (!table)
|
||||
return 0;
|
||||
|
||||
if (val == CPUFREQ_CREATE_POLICY)
|
||||
ret = __cpufreq_stats_create_table(policy, table);
|
||||
ret = __cpufreq_stats_create_table(policy);
|
||||
else if (val == CPUFREQ_REMOVE_POLICY)
|
||||
__cpufreq_stats_free_table(policy);
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user