Skip to content

Commit c81b30c

Browse files
committed
Merge branch 'pm-cpufreq'
* pm-cpufreq: (24 commits) cpufreq: intel_pstate: Fix EPP setting via sysfs in active mode cpufreq: intel_pstate: Rearrange the storing of new EPP values cpufreq: intel_pstate: Avoid enabling HWP if EPP is not supported cpufreq: intel_pstate: Clean up aperf_mperf_shift description cpufreq: powernv: Make some symbols static cpufreq: amd_freq_sensitivity: Mark sometimes used ID structs as __maybe_unused cpufreq: intel_pstate: Supply struct attribute description for get_aperf_mperf_shift() cpufreq: pcc-cpufreq: Mark sometimes used ID structs as __maybe_unused cpufreq: powernow-k8: Mark 'hi' and 'lo' dummy variables as __always_unused cpufreq: acpi-cpufreq: Mark sometimes used ID structs as __maybe_unused cpufreq: acpi-cpufreq: Mark 'dummy' variable as __always_unused cpufreq: powernv-cpufreq: Fix a bunch of kerneldoc related issues cpufreq: pasemi: Include header file for {check,restore}_astate prototypes cpufreq: cpufreq_governor: Demote store_sampling_rate() header to standard comment block cpufreq: cpufreq: Demote lots of function headers unworthy of kerneldoc status cpufreq: freq_table: Demote obvious misuse of kerneldoc to standard comment blocks cpufreq: Replace HTTP links with HTTPS ones cpufreq: intel_pstate: Fix static checker warning for epp variable cpufreq: Remove the weakly defined cpufreq_default_governor() cpufreq: Specify default governor on command line ...
2 parents 2d5c80b + de002c5 commit c81b30c

23 files changed

+297
-237
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,11 @@
703703
cpufreq.off=1 [CPU_FREQ]
704704
disable the cpufreq sub-system
705705

706+
cpufreq.default_governor=
707+
[CPU_FREQ] Name of the default cpufreq governor or
708+
policy to use. This governor must be registered in the
709+
kernel before the cpufreq driver probes.
710+
706711
cpu_init_udelay=N
707712
[X86] Delay for N microsec between assert and de-assert
708713
of APIC INIT to start processors. This delay occurs

Documentation/admin-guide/pm/cpufreq.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,9 @@ CPUs in it.
147147

148148
The next major initialization step for a new policy object is to attach a
149149
scaling governor to it (to begin with, that is the default scaling governor
150-
determined by the kernel configuration, but it may be changed later
151-
via ``sysfs``). First, a pointer to the new policy object is passed to the
152-
governor's ``->init()`` callback which is expected to initialize all of the
150+
determined by the kernel command line or configuration, but it may be changed
151+
later via ``sysfs``). First, a pointer to the new policy object is passed to
152+
the governor's ``->init()`` callback which is expected to initialize all of the
153153
data structures necessary to handle the given policy and, possibly, to add
154154
a governor ``sysfs`` interface to it. Next, the governor is started by
155155
invoking its ``->start()`` callback.

Documentation/admin-guide/pm/intel_pstate.rst

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,17 @@ argument is passed to the kernel in the command line.
431431
supported in the current configuration, writes to this attribute will
432432
fail with an appropriate error.
433433

434+
``energy_efficiency``
435+
This attribute is only present on platforms, which have CPUs matching
436+
Kaby Lake or Coffee Lake desktop CPU model. By default
437+
energy efficiency optimizations are disabled on these CPU models in HWP
438+
mode by this driver. Enabling energy efficiency may limit maximum
439+
operating frequency in both HWP and non HWP mode. In non HWP mode,
440+
optimizations are done only in the turbo frequency range. In HWP mode,
441+
optimizations are done in the entire frequency range. Setting this
442+
attribute to "1" enables energy efficiency optimizations and setting
443+
to "0" disables energy efficiency optimizations.
444+
434445
Interpretation of Policy Attributes
435446
-----------------------------------
436447

@@ -554,7 +565,11 @@ somewhere between the two extremes:
554565
Strings written to the ``energy_performance_preference`` attribute are
555566
internally translated to integer values written to the processor's
556567
Energy-Performance Preference (EPP) knob (if supported) or its
557-
Energy-Performance Bias (EPB) knob.
568+
Energy-Performance Bias (EPB) knob. It is also possible to write a positive
569+
integer value between 0 to 255, if the EPP feature is present. If the EPP
570+
feature is not present, writing integer value to this attribute is not
571+
supported. In this case, user can use
572+
"/sys/devices/system/cpu/cpu*/power/energy_perf_bias" interface.
558573

559574
[Note that tasks may by migrated from one CPU to another by the scheduler's
560575
load-balancing algorithm and if different energy vs performance hints are

arch/powerpc/platforms/cell/cpufreq_spudemand.c

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -126,30 +126,8 @@ static struct cpufreq_governor spu_governor = {
126126
.stop = spu_gov_stop,
127127
.owner = THIS_MODULE,
128128
};
129-
130-
/*
131-
* module init and destoy
132-
*/
133-
134-
static int __init spu_gov_init(void)
135-
{
136-
int ret;
137-
138-
ret = cpufreq_register_governor(&spu_governor);
139-
if (ret)
140-
printk(KERN_ERR "registration of governor failed\n");
141-
return ret;
142-
}
143-
144-
static void __exit spu_gov_exit(void)
145-
{
146-
cpufreq_unregister_governor(&spu_governor);
147-
}
148-
149-
150-
module_init(spu_gov_init);
151-
module_exit(spu_gov_exit);
129+
cpufreq_governor_init(spu_governor);
130+
cpufreq_governor_exit(spu_governor);
152131

153132
MODULE_LICENSE("GPL");
154133
MODULE_AUTHOR("Christian Krafft <[email protected]>");
155-

arch/x86/include/asm/msr-index.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@
149149

150150
#define MSR_LBR_SELECT 0x000001c8
151151
#define MSR_LBR_TOS 0x000001c9
152+
153+
#define MSR_IA32_POWER_CTL 0x000001fc
154+
#define MSR_IA32_POWER_CTL_BIT_EE 19
155+
152156
#define MSR_LBR_NHM_FROM 0x00000680
153157
#define MSR_LBR_NHM_TO 0x000006c0
154158
#define MSR_LBR_CORE_FROM 0x00000040
@@ -253,8 +257,6 @@
253257

254258
#define MSR_PEBS_FRONTEND 0x000003f7
255259

256-
#define MSR_IA32_POWER_CTL 0x000001fc
257-
258260
#define MSR_IA32_MC0_CTL 0x00000400
259261
#define MSR_IA32_MC0_STATUS 0x00000401
260262
#define MSR_IA32_MC0_ADDR 0x00000402

drivers/cpufreq/acpi-cpufreq.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ static unsigned extract_freq(struct cpufreq_policy *policy, u32 val)
244244

245245
static u32 cpu_freq_read_intel(struct acpi_pct_register *not_used)
246246
{
247-
u32 val, dummy;
247+
u32 val, dummy __always_unused;
248248

249249
rdmsr(MSR_IA32_PERF_CTL, val, dummy);
250250
return val;
@@ -261,7 +261,7 @@ static void cpu_freq_write_intel(struct acpi_pct_register *not_used, u32 val)
261261

262262
static u32 cpu_freq_read_amd(struct acpi_pct_register *not_used)
263263
{
264-
u32 val, dummy;
264+
u32 val, dummy __always_unused;
265265

266266
rdmsr(MSR_AMD_PERF_CTL, val, dummy);
267267
return val;
@@ -612,7 +612,7 @@ static const struct dmi_system_id sw_any_bug_dmi_table[] = {
612612
static int acpi_cpufreq_blacklist(struct cpuinfo_x86 *c)
613613
{
614614
/* Intel Xeon Processor 7100 Series Specification Update
615-
* http://www.intel.com/Assets/PDF/specupdate/314554.pdf
615+
* https://www.intel.com/Assets/PDF/specupdate/314554.pdf
616616
* AL30: A Machine Check Exception (MCE) Occurring during an
617617
* Enhanced Intel SpeedStep Technology Ratio Change May Cause
618618
* Both Processor Cores to Lock Up. */
@@ -993,14 +993,14 @@ MODULE_PARM_DESC(acpi_pstate_strict,
993993
late_initcall(acpi_cpufreq_init);
994994
module_exit(acpi_cpufreq_exit);
995995

996-
static const struct x86_cpu_id acpi_cpufreq_ids[] = {
996+
static const struct x86_cpu_id __maybe_unused acpi_cpufreq_ids[] = {
997997
X86_MATCH_FEATURE(X86_FEATURE_ACPI, NULL),
998998
X86_MATCH_FEATURE(X86_FEATURE_HW_PSTATE, NULL),
999999
{}
10001000
};
10011001
MODULE_DEVICE_TABLE(x86cpu, acpi_cpufreq_ids);
10021002

1003-
static const struct acpi_device_id processor_device_ids[] = {
1003+
static const struct acpi_device_id __maybe_unused processor_device_ids[] = {
10041004
{ACPI_PROCESSOR_OBJECT_HID, },
10051005
{ACPI_PROCESSOR_DEVICE_HID, },
10061006
{},

drivers/cpufreq/amd_freq_sensitivity.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ static void __exit amd_freq_sensitivity_exit(void)
144144
}
145145
module_exit(amd_freq_sensitivity_exit);
146146

147-
static const struct x86_cpu_id amd_freq_sensitivity_ids[] = {
147+
static const struct x86_cpu_id __maybe_unused amd_freq_sensitivity_ids[] = {
148148
X86_MATCH_FEATURE(X86_FEATURE_PROC_FEEDBACK, NULL),
149149
{}
150150
};

0 commit comments

Comments
 (0)