<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/cpufreq/intel_pstate.c, branch linux-6.10.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.10.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.10.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2024-10-10T10:01:08Z</updated>
<entry>
<title>cpufreq: intel_pstate: Make hwp_notify_lock a raw spinlock</title>
<updated>2024-10-10T10:01:08Z</updated>
<author>
<name>Uwe Kleine-König</name>
</author>
<published>2024-10-06T20:51:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c0bdc6c6a97cdda5627ab9f7e0596720e70d30d5'/>
<id>urn:sha1:c0bdc6c6a97cdda5627ab9f7e0596720e70d30d5</id>
<content type='text'>
commit 8b4865cd904650cbed7f2407e653934c621b8127 upstream.

notify_hwp_interrupt() is called via sysvec_thermal() -&gt;
smp_thermal_vector() -&gt; intel_thermal_interrupt() in hard irq context.
For this reason it must not use a simple spin_lock that sleeps with
PREEMPT_RT enabled. So convert it to a raw spinlock.

Reported-by: xiao sheng wen &lt;atzlinux@sina.com&gt;
Link: https://bugs.debian.org/1076483
Signed-off-by: Uwe Kleine-König &lt;ukleinek@debian.org&gt;
Acked-by: Srinivas Pandruvada &lt;srinivas.pandruvada@linux.intel.com&gt;
Acked-by: Sebastian Andrzej Siewior &lt;bigeasy@linutronix.de&gt;
Tested-by: xiao sheng wen &lt;atzlinux@sina.com&gt;
Link: https://patch.msgid.link/20240919081121.10784-2-ukleinek@debian.org
Cc: All applicable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
[ukleinek: Backport to v6.10.y]
Signed-off-by: Uwe Kleine-König &lt;ukleinek@debian.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>cpufreq: intel_pstate: Use HWP to initialize ITMT if CPPC is missing</title>
<updated>2024-06-24T18:55:11Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2024-06-20T16:14:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a1ff59784b277795a613beaa5d3dd9c5595c69a7'/>
<id>urn:sha1:a1ff59784b277795a613beaa5d3dd9c5595c69a7</id>
<content type='text'>
It is reported that single-thread performance on some hybrid systems
dropped significantly after commit 7feec7430edd ("ACPI: CPPC: Only probe
for _CPC if CPPC v2 is acked") which prevented _CPC from being used if
the support for it had not been confirmed by the platform firmware.

The problem is that if the platform firmware does not confirm CPPC v2
support, cppc_get_perf_caps() returns an error which prevents the
intel_pstate driver from enabling ITMT.  Consequently, the scheduler
does not get any hints on CPU performance differences, so in a hybrid
system some tasks may run on CPUs with lower capacity even though they
should be running on high-capacity CPUs.

To address this, modify intel_pstate to use the information from
MSR_HWP_CAPABILITIES to enable ITMT if CPPC is not available (which is
done already if the highest performance number coming from CPPC is not
realistic).

Fixes: 7feec7430edd ("ACPI: CPPC: Only probe for _CPC if CPPC v2 is acked")
Closes: https://lore.kernel.org/linux-acpi/d01b0a1f-bd33-47fe-ab41-43843d8a374f@kfocus.org
Link: https://lore.kernel.org/linux-acpi/ZnD22b3Br1ng7alf@kf-XE
Reported-by: Aaron Rainbolt &lt;arainbolt@kfocus.org&gt;
Tested-by: Aaron Rainbolt &lt;arainbolt@kfocus.org&gt;
Cc: 5.19+ &lt;stable@vger.kernel.org&gt; # 5.19+
Link: https://patch.msgid.link/12460110.O9o76ZdvQC@rjwysocki.net
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Reviewed-by: Mario Limonciello &lt;mario.limonciello@amd.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: intel_pstate: Check turbo_is_disabled() in store_no_turbo()</title>
<updated>2024-06-12T12:11:50Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2024-06-11T14:53:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=350cbb5d2f676bff22c49e5e81764c3b8da342a9'/>
<id>urn:sha1:350cbb5d2f676bff22c49e5e81764c3b8da342a9</id>
<content type='text'>
After recent changes in intel_pstate, global.turbo_disabled is only set
at the initialization time and never changed.  However, it turns out
that on some systems the "turbo disabled" bit in MSR_IA32_MISC_ENABLE,
the initial state of which is reflected by global.turbo_disabled, can be
flipped later and there should be a way to take that into account (other
than checking that MSR every time the driver runs which is costly and
useless overhead on the vast majority of systems).

For this purpose, notice that before the changes in question,
store_no_turbo() contained a turbo_is_disabled() check that was used
for updating global.turbo_disabled if the "turbo disabled" bit in
MSR_IA32_MISC_ENABLE had been flipped and that functionality can be
restored.  Then, users will be able to reset global.turbo_disabled
by writing 0 to no_turbo which used to work before on systems with
flipping "turbo disabled" bit.

This guarantees the driver state to remain in sync, but READ_ONCE()
annotations need to be added in two places where global.turbo_disabled
is accessed locklessly, so modify the driver to make that happen.

Fixes: 0940f1a8011f ("cpufreq: intel_pstate: Do not update global.turbo_disabled after initialization")
Closes: https://lore.kernel.org/linux-pm/bf3ebf1571a4788e97daf861eb493c12d42639a3.camel@xry111.site
Suggested-by: Srinivas Pandruvada &lt;srinivas.pandruvada@linux.intel.com&gt;
Reported-by: Xi Ruoyao &lt;xry111@xry111.site&gt;
Tested-by: Xi Ruoyao &lt;xry111@xry111.site&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: intel_pstate: Fix unchecked HWP MSR access</title>
<updated>2024-06-03T16:00:23Z</updated>
<author>
<name>Srinivas Pandruvada</name>
</author>
<published>2024-05-31T23:00:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1e24c31351787e24b7eebe84866bd55fd62a0aef'/>
<id>urn:sha1:1e24c31351787e24b7eebe84866bd55fd62a0aef</id>
<content type='text'>
Fix unchecked MSR access error for processors with no HWP support. On
such processors, maximum frequency can be changed by the system firmware
using ACPI event ACPI_PROCESSOR_NOTIFY_HIGEST_PERF_CHANGED. This results
in accessing HWP MSR 0x771.

Call Trace:
	&lt;TASK&gt;
	generic_exec_single+0x58/0x120
	smp_call_function_single+0xbf/0x110
	rdmsrl_on_cpu+0x46/0x60
	intel_pstate_get_hwp_cap+0x1b/0x70
	intel_pstate_update_limits+0x2a/0x60
	acpi_processor_notify+0xb7/0x140
	acpi_ev_notify_dispatch+0x3b/0x60

HWP MSR 0x771 can be only read on a CPU which supports HWP and enabled.
Hence intel_pstate_get_hwp_cap() can only be called when hwp_active is
true.

Reported-by: Sebastian Andrzej Siewior &lt;bigeasy@linutronix.de&gt;
Closes: https://lore.kernel.org/linux-pm/20240529155740.Hq2Hw7be@linutronix.de/
Fixes: e8217b4bece3 ("cpufreq: intel_pstate: Update the maximum CPU frequency consistently")
Tested-by: Sebastian Andrzej Siewior &lt;bigeasy@linutronix.de&gt;
Signed-off-by: Srinivas Pandruvada &lt;srinivas.pandruvada@linux.intel.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: intel_pstate: fix struct cpudata::epp_cached kernel-doc</title>
<updated>2024-05-07T13:02:43Z</updated>
<author>
<name>Jeff Johnson</name>
</author>
<published>2024-05-05T19:07:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0a206fe35d360a9ec1c8b1609ca394c2759a8962'/>
<id>urn:sha1:0a206fe35d360a9ec1c8b1609ca394c2759a8962</id>
<content type='text'>
make C=1 currently gives the following warning:

drivers/cpufreq/intel_pstate.c:262: warning: Function parameter or struct member 'epp_cached' not described in 'cpudata'

Add the missing ":" to fix the trivial kernel-doc syntax error.

Signed-off-by: Jeff Johnson &lt;quic_jjohnson@quicinc.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: intel_pstate: hide unused intel_pstate_cpu_oob_ids[]</title>
<updated>2024-04-03T14:41:59Z</updated>
<author>
<name>Arnd Bergmann</name>
</author>
<published>2024-04-03T08:06:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8c556541a53848d6611ff8b5f9bf52e96c56f48e'/>
<id>urn:sha1:8c556541a53848d6611ff8b5f9bf52e96c56f48e</id>
<content type='text'>
The reference to this variable is hidden in an #ifdef:

drivers/cpufreq/intel_pstate.c:2440:32: error: 'intel_pstate_cpu_oob_ids' defined but not used [-Werror=unused-const-variable=]

Use the same check around the definition.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: intel_pstate: Update the maximum CPU frequency consistently</title>
<updated>2024-04-02T10:57:22Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2024-03-28T18:52:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e8217b4bece379e66d43ab5070431712f07bf625'/>
<id>urn:sha1:e8217b4bece379e66d43ab5070431712f07bf625</id>
<content type='text'>
There are 3 places at which the maximum CPU frequency may change,
store_no_turbo(), intel_pstate_update_limits() (when called by the
cpufreq core) and intel_pstate_notify_work() (when handling a HWP
change notification).  Currently, cpuinfo.max_freq is only updated by
store_no_turbo() and intel_pstate_notify_work(), although it principle
it may be necessary to update it in intel_pstate_update_limits() either.

Make all of them mutually consistent.

Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Acked-by: Srinivas Pandruvada &lt;srinivas.pandruvada@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: intel_pstate: Replace three global.turbo_disabled checks</title>
<updated>2024-04-02T10:57:17Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2024-03-25T17:05:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f32587dcbe5f40e160d8de262add6abab79356a7'/>
<id>urn:sha1:f32587dcbe5f40e160d8de262add6abab79356a7</id>
<content type='text'>
Replace the global.turbo_disabled in __intel_pstate_update_max_freq() with
a global.no_turbo one to make store_no_turbo() actually update the maximum
CPU frequency on the trubo preference changes, which needs to be consistent
with arch_set_max_freq_ratio() called from there.

For more consistency, replace the global.turbo_disabled checks in
__intel_pstate_cpu_init() and intel_cpufreq_adjust_perf() with
global.no_turbo checks either.

Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Acked-by: Srinivas Pandruvada &lt;srinivas.pandruvada@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: intel_pstate: Read global.no_turbo under READ_ONCE()</title>
<updated>2024-04-02T10:57:10Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2024-03-25T17:04:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9558fae8ce97b3b320b387dd7c88309df2c36d4d'/>
<id>urn:sha1:9558fae8ce97b3b320b387dd7c88309df2c36d4d</id>
<content type='text'>
Because global.no_turbo is generally not read under intel_pstate_driver_lock
make store_no_turbo() use WRITE_ONCE() for updating it (this is the only
place at which it is updated except for the initialization) and make the
majority of places reading it use READ_ONCE().

Also remove redundant global.turbo_disabled checks from places that
depend on the 'true' value of global.no_turbo because it can only be
'true' if global.turbo_disabled is also 'true'.

Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Acked-by: Srinivas Pandruvada &lt;srinivas.pandruvada@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: intel_pstate: Rearrange show_no_turbo() and store_no_turbo()</title>
<updated>2024-04-02T10:57:04Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2024-03-25T17:03:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c626a438452079824139f97137f17af47b1a8989'/>
<id>urn:sha1:c626a438452079824139f97137f17af47b1a8989</id>
<content type='text'>
Now that global.turbo_disabled can only change at the cpufreq driver
registration time, initialize global.no_turbo at that time too so they
are in sync to start with (if the former is set, the latter cannot be
updated later anyway).

That allows show_no_turbo() to be simlified because it does not need
to check global.turbo_disabled and store_no_turbo() can be rearranged
to avoid doing anything if the new value of global.no_turbo is equal
to the current one and only return an error on attempts to clear
global.no_turbo when global.turbo_disabled.

While at it, eliminate the redundant ret variable from store_no_turbo().

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Acked-by: Srinivas Pandruvada &lt;srinivas.pandruvada@linux.intel.com&gt;
</content>
</entry>
</feed>
