linux-stable/drivers/cpufreq
Srinivas Pandruvada 57577c996d cpufreq: intel_pstate: Process HWP Guaranteed change notification
It is possible that HWP guaranteed ratio is changed in response to
change in power and thermal limits. For example when Intel Speed Select
performance profile is changed or there is change in TDP, hardware can
send notifications. It is possible that the guaranteed ratio is
increased. This creates an issue when turbo is disabled, as the old
limits set in MSR_HWP_REQUEST are still lower and hardware will clip
to older limits.

This change enables HWP interrupt and process HWP interrupts. When
guaranteed is changed, calls cpufreq_update_policy() so that driver
callbacks are called to update to new HWP limits. This callback
is called from a delayed workqueue of 10ms to avoid frequent updates.

Although the scope of IA32_HWP_INTERRUPT is per logical cpu, on some
plaforms interrupt is generated on all CPUs. This is particularly a
problem during initialization, when the driver didn't allocated
data for other CPUs. So this change uses a cpumask of enabled CPUs and
process interrupts on those CPUs only.

When the cpufreq offline() or suspend() callback is called, HWP interrupt
is disabled on those CPUs and also cancels any pending work item.

Spin lock is used to protect data and processing shared with interrupt
handler. Here READ_ONCE(), WRITE_ONCE() macros are used to designate
shared data, even though spin lock act as an optimization barrier here.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Tested-by: pablomh@gmail.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2021-10-05 15:30:44 +02:00
..
acpi-cpufreq.c cpufreq: acpi: Remove acpi_cpufreq_cpu_ready() 2021-09-02 18:04:17 +02:00
amd_freq_sensitivity.c cpufreq: amd_freq_sensitivity: Mark sometimes used ID structs as __maybe_unused 2020-07-15 15:17:06 +02:00
armada-8k-cpufreq.c cpufreq: ap806: Add missing MODULE_DEVICE_TABLE 2020-12-07 13:02:37 +05:30
armada-37xx-cpufreq.c cpufreq: armada-37xx: forbid cpufreq for 1.2 GHz variant 2021-08-09 09:31:22 +05:30
bmips-cpufreq.c
brcmstb-avs-cpufreq.c cpufreq: brcmstb-avs-cpufreq: Fix resource leaks in ->remove() 2021-01-18 12:23:43 +05:30
cppc_cpufreq.c cpufreq: CPPC: Add support for frequency invariance 2021-07-01 07:32:14 +05:30
cpufreq-dt-platdev.c cpufreq: blocklist more Qualcomm platforms in cpufreq-dt-platdev 2021-08-30 10:43:35 +05:30
cpufreq-dt.c cpufreq: dt: Use .register_em() to register with energy model 2021-08-12 09:54:07 +05:30
cpufreq-dt.h
cpufreq-nforce2.c
cpufreq.c cpufreq: Remove ready() callback 2021-09-02 18:04:17 +02:00
cpufreq_conservative.c cpufreq: Register governors at core_initcall 2020-07-02 13:03:30 +02:00
cpufreq_governor.c cpufreq: cpufreq_governor: Demote store_sampling_rate() header to standard comment block 2020-07-15 15:17:06 +02:00
cpufreq_governor.h cpufreq: Introduce governor flags 2020-11-10 18:31:17 +01:00
cpufreq_governor_attr_set.c cpufreq: schedutil: Destroy mutex before kobject_put() frees the memory 2021-09-14 19:01:36 +02:00
cpufreq_ondemand.c cpufreq: Replace deprecated CPU-hotplug functions 2021-08-04 20:16:32 +02:00
cpufreq_ondemand.h
cpufreq_performance.c cpufreq: Introduce CPUFREQ_GOV_STRICT_TARGET 2020-11-10 18:31:17 +01:00
cpufreq_powersave.c cpufreq: Introduce CPUFREQ_GOV_STRICT_TARGET 2020-11-10 18:31:17 +01:00
cpufreq_stats.c cpufreq: stats: Clean up local variable in cpufreq_stats_create_table() 2021-06-07 13:47:57 +02:00
cpufreq_userspace.c cpufreq: Register governors at core_initcall 2020-07-02 13:03:30 +02:00
davinci-cpufreq.c cpufreq: Remove CPUFREQ_STICKY flag 2021-02-04 19:23:20 +01:00
e_powersaver.c cpufreq: e_powersaver: remove unreachable break 2020-10-27 18:42:54 +01:00
elanfreq.c cpufreq: Convert to new X86 CPU match macros 2020-03-24 21:31:27 +01:00
freq_table.c cpufreq: Fix scaling_{available,boost}_frequencies_show() comments 2021-03-26 17:43:48 +01:00
gx-suspmod.c
highbank-cpufreq.c cpufreq: highbank: Add missing MODULE_DEVICE_TABLE 2020-12-07 13:02:37 +05:30
ia64-acpi-cpufreq.c ia64: fix format string for ia64-acpi-cpu-freq 2021-03-19 17:26:20 +01:00
imx-cpufreq-dt.c cpufreq: imx-cpufreq-dt: support i.MX7ULP 2020-04-28 14:26:20 +05:30
imx6q-cpufreq.c cpufreq: imx6q: Use .register_em() to register with energy model 2021-08-12 09:54:07 +05:30
intel_pstate.c cpufreq: intel_pstate: Process HWP Guaranteed change notification 2021-10-05 15:30:44 +02:00
Kconfig cpufreq: Kconfig: fix documentation links 2021-04-21 19:00:42 +02:00
Kconfig.arm cpufreq: mediatek-hw: Add support for CPUFREQ HW 2021-09-06 15:15:19 +05:30
Kconfig.powerpc
Kconfig.x86 cpufreq: sfi-cpufreq: Remove driver for deprecated firmware 2021-02-15 20:04:46 +01:00
kirkwood-cpufreq.c
longhaul.c cpufreq: Fix fall-through warning for Clang 2021-07-13 11:53:07 -05:00
longhaul.h
longrun.c cpufreq: Convert to new X86 CPU match macros 2020-03-24 21:31:27 +01:00
loongson1-cpufreq.c cpufreq: Remove CPUFREQ_STICKY flag 2021-02-04 19:23:20 +01:00
loongson2_cpufreq.c cpufreq: loongson2: Remove unused linux/sched.h headers 2021-06-07 17:43:52 +02:00
Makefile cpufreq: mediatek-hw: Add support for CPUFREQ HW 2021-09-06 15:15:19 +05:30
maple-cpufreq.c
mediatek-cpufreq-hw.c cpufreq: mediatek-hw: Add support for CPUFREQ HW 2021-09-06 15:15:19 +05:30
mediatek-cpufreq.c cpufreq: mediatek: Use .register_em() to register with energy model 2021-08-12 09:54:07 +05:30
mvebu-cpufreq.c
omap-cpufreq.c cpufreq: omap: Use .register_em() to register with energy model 2021-08-12 09:54:07 +05:30
p4-clockmod.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
pasemi-cpufreq.c cpufreq: pasemi: Include header file for {check,restore}_astate prototypes 2020-07-15 15:17:06 +02:00
pcc-cpufreq.c cpufreq: pcc-cpufreq: Mark sometimes used ID structs as __maybe_unused 2020-07-15 15:17:06 +02:00
pmac32-cpufreq.c cpufreq: Remove unused flag CPUFREQ_PM_NO_WARN 2021-02-04 19:25:47 +01:00
pmac64-cpufreq.c
powernow-k6.c cpufreq: Convert to new X86 CPU match macros 2020-03-24 21:31:27 +01:00
powernow-k7.c cpufreq: Convert to new X86 CPU match macros 2020-03-24 21:31:27 +01:00
powernow-k7.h
powernow-k8.c cpufreq: Replace deprecated CPU-hotplug functions 2021-08-04 20:16:32 +02:00
powernow-k8.h
powernv-cpufreq.c powerpc updates for 5.15 2021-09-03 11:22:50 -07:00
ppc_cbe_cpufreq.c
ppc_cbe_cpufreq.h
ppc_cbe_cpufreq_pervasive.c
ppc_cbe_cpufreq_pmi.c
pxa2xx-cpufreq.c
pxa3xx-cpufreq.c
qcom-cpufreq-hw.c cpufreq: qcom-hw: Set dvfs_possible_from_any_cpu cpufreq driver flag 2021-08-30 10:43:35 +05:30
qcom-cpufreq-nvmem.c Merge branch 'pm-cpufreq' 2020-12-15 15:24:52 +01:00
qoriq-cpufreq.c cpufreq: qoriq: convert to a platform driver 2020-05-07 10:47:27 +05:30
raspberrypi-cpufreq.c
s3c24xx-cpufreq-debugfs.c ARM: s3c: remove cpufreq header dependencies 2020-08-20 17:52:05 +02:00
s3c24xx-cpufreq.c cpufreq: Remove CPUFREQ_STICKY flag 2021-02-04 19:23:20 +01:00
s3c64xx-cpufreq.c
s3c2410-cpufreq.c cpufreq: s3c24xx: move low-level clk reg access into platform code 2020-08-20 17:53:22 +02:00
s3c2412-cpufreq.c cpufreq: s3c24xx: move low-level clk reg access into platform code 2020-08-20 17:53:22 +02:00
s3c2416-cpufreq.c
s3c2440-cpufreq.c cpufreq: s3c24xx: move low-level clk reg access into platform code 2020-08-20 17:53:22 +02:00
s5pv210-cpufreq.c cpufreq: Rudimentary typos fix in the file s5pv210-cpufreq.c 2021-03-22 08:55:41 +05:30
sa1100-cpufreq.c cpufreq: Remove CPUFREQ_STICKY flag 2021-02-04 19:23:20 +01:00
sa1110-cpufreq.c cpufreq: Remove CPUFREQ_STICKY flag 2021-02-04 19:23:20 +01:00
sc520_freq.c cpufreq: sc520_freq: add 'fallthrough' to one case 2021-05-21 18:52:13 +02:00
scmi-cpufreq.c cpufreq: scmi: Use .register_em() to register with energy model 2021-08-30 10:43:00 +05:30
scpi-cpufreq.c cpufreq: scpi: Use .register_em() to register with energy model 2021-08-30 10:42:45 +05:30
sh-cpufreq.c cpufreq: sh: Remove sh_cpufreq_cpu_ready() 2021-09-02 18:04:17 +02:00
sparc-us2e-cpufreq.c
sparc-us3-cpufreq.c
spear-cpufreq.c cpufreq: Remove CPUFREQ_STICKY flag 2021-02-04 19:23:20 +01:00
speedstep-centrino.c cpufreq: Convert to new X86 CPU match macros 2020-03-24 21:31:27 +01:00
speedstep-ich.c cpufreq: Convert to new X86 CPU match macros 2020-03-24 21:31:27 +01:00
speedstep-lib.c cpufreq: speedstep: remove unneeded semicolon 2020-10-28 18:04:07 +01:00
speedstep-lib.h
speedstep-smi.c cpufreq: Convert to new X86 CPU match macros 2020-03-24 21:31:27 +01:00
sti-cpufreq.c cpufreq: st: Add missing MODULE_DEVICE_TABLE 2020-12-07 13:02:37 +05:30
sun50i-cpufreq-nvmem.c cpufreq: sun50i: Add missing MODULE_DEVICE_TABLE 2020-12-07 13:02:37 +05:30
tegra20-cpufreq.c cpufreq: tegra20: Use resource-managed API 2021-01-18 12:02:53 +05:30
tegra124-cpufreq.c
tegra186-cpufreq.c cpufreq: Remove CPUFREQ_STICKY flag 2021-02-04 19:23:20 +01:00
tegra194-cpufreq.c cpufreq: Remove CPUFREQ_STICKY flag 2021-02-04 19:23:20 +01:00
ti-cpufreq.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
vexpress-spc-cpufreq.c cpufreq: vexpress: Drop unused variable 2021-09-16 11:29:27 -07:00