<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/acpi/processor_idle.c, branch v5.15.209</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v5.15.209</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v5.15.209'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-10-19T14:21:29+00:00</updated>
<entry>
<title>ACPI: processor: idle: Fix memory leak when register cpuidle device failed</title>
<updated>2025-10-19T14:21:29+00:00</updated>
<author>
<name>Huisong Li</name>
<email>lihuisong@huawei.com</email>
</author>
<published>2025-07-28T07:06:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1955c776a60779ebe291ef6651004cd3322df3d6'/>
<id>urn:sha1:1955c776a60779ebe291ef6651004cd3322df3d6</id>
<content type='text'>
[ Upstream commit 11b3de1c03fa9f3b5d17e6d48050bc98b3704420 ]

The cpuidle device's memory is leaked when cpuidle device registration
fails in acpi_processor_power_init().  Free it as appropriate.

Fixes: 3d339dcbb56d ("cpuidle / ACPI : move cpuidle_device field out of the acpi_processor_power structure")
Signed-off-by: Huisong Li &lt;lihuisong@huawei.com&gt;
Link: https://patch.msgid.link/20250728070612.1260859-2-lihuisong@huawei.com
[ rjw: Changed the order of the new statements, added empty line after if () ]
[ rjw: Changelog edits ]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ACPI: processor: idle: Check acpi_fetch_acpi_dev() return value</title>
<updated>2025-08-28T14:24:33+00:00</updated>
<author>
<name>Li Zhong</name>
<email>floridsleeves@gmail.com</email>
</author>
<published>2022-09-02T07:37:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ad1190744da9d812da55b76f2afce750afb0a3bd'/>
<id>urn:sha1:ad1190744da9d812da55b76f2afce750afb0a3bd</id>
<content type='text'>
commit 2437513a814b3e93bd02879740a8a06e52e2cf7d upstream.

The return value of acpi_fetch_acpi_dev() could be NULL, which would
cause a NULL pointer dereference to occur in acpi_device_hid().

Signed-off-by: Li Zhong &lt;floridsleeves@gmail.com&gt;
[ rjw: Subject and changelog edits, added empty line after if () ]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Teddy Astie &lt;teddy.astie@vates.tech&gt;
Signed-off-by: Yann Sionneau &lt;yann.sionneau@vates.tech&gt;
Reported-by: Dillon C &lt;dchan@dchan.tech&gt;
Tested-by: Dillon C &lt;dchan@dchan.tech&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>ACPI: processor: idle: Return an error if both P_LVL{2,3} idle states are invalid</title>
<updated>2025-04-10T12:32:02+00:00</updated>
<author>
<name>Giovanni Gherdovich</name>
<email>ggherdovich@suse.cz</email>
</author>
<published>2025-03-28T14:30:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=190d766abe6f461d42a85513017aadc09624d7d5'/>
<id>urn:sha1:190d766abe6f461d42a85513017aadc09624d7d5</id>
<content type='text'>
[ Upstream commit 9e9b893404d43894d69a18dd2fc8fcf1c36abb7e ]

Prior to commit 496121c02127 ("ACPI: processor: idle: Allow probing on
platforms with one ACPI C-state"), the acpi_idle driver wouldn't load on
systems without a valid C-State at least as deep as C2.

The behavior was desirable for guests on hypervisors such as VMWare
ESXi, which by default don't have the _CST ACPI method, and set the C2
and C3 latencies to 101 and 1001 microseconds respectively via the FADT,
to signify they're unsupported.

Since the above change though, these virtualized deployments end up
loading acpi_idle, and thus entering the default C1 C-State set by
acpi_processor_get_power_info_default(); this is undesirable for a
system that's communicating to the OS it doesn't want C-States (missing
_CST, and invalid C2/C3 in FADT).

Make acpi_processor_get_power_info_fadt() return -ENODEV in that case,
so that acpi_processor_get_cstate_info() exits early and doesn't set
pr-&gt;flags.power = 1.

Fixes: 496121c02127 ("ACPI: processor: idle: Allow probing on platforms with one ACPI C-state")
Signed-off-by: Giovanni Gherdovich &lt;ggherdovich@suse.cz&gt;
Reviewed-by: Zhang Rui &lt;rui.zhang@intel.com&gt;
Link: https://patch.msgid.link/20250328143040.9348-1-ggherdovich@suse.cz
[ rjw: Changelog edits ]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ACPI: processor_idle: Fix invalid comparison with insertion sort for latency</title>
<updated>2024-07-27T08:46:06+00:00</updated>
<author>
<name>Kuan-Wei Chiu</name>
<email>visitorckw@gmail.com</email>
</author>
<published>2024-07-01T20:56:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=48ec3929916f62af0993b87eaf981c5e8ef7d5ea'/>
<id>urn:sha1:48ec3929916f62af0993b87eaf981c5e8ef7d5ea</id>
<content type='text'>
commit 233323f9b9f828cd7cd5145ad811c1990b692542 upstream.

The acpi_cst_latency_cmp() comparison function currently used for
sorting C-state latencies does not satisfy transitivity, causing
incorrect sorting results.

Specifically, if there are two valid acpi_processor_cx elements A and B
and one invalid element C, it may occur that A &lt; B, A = C, and B = C.
Sorting algorithms assume that if A &lt; B and A = C, then C &lt; B, leading
to incorrect ordering.

Given the small size of the array (&lt;=8), we replace the library sort
function with a simple insertion sort that properly ignores invalid
elements and sorts valid ones based on latency. This change ensures
correct ordering of the C-state latencies.

Fixes: 65ea8f2c6e23 ("ACPI: processor idle: Fix up C-state latency if not ordered")
Reported-by: Julian Sikorski &lt;belegdol@gmail.com&gt;
Closes: https://lore.kernel.org/lkml/70674dc7-5586-4183-8953-8095567e73df@gmail.com
Signed-off-by: Kuan-Wei Chiu &lt;visitorckw@gmail.com&gt;
Tested-by: Julian Sikorski &lt;belegdol@gmail.com&gt;
Cc: All applicable &lt;stable@vger.kernel.org&gt;
Link: https://patch.msgid.link/20240701205639.117194-1-visitorckw@gmail.com
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Kuan-Wei Chiu &lt;visitorckw@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>ACPI: processor_idle: Fix memory leak in acpi_processor_power_exit()</title>
<updated>2024-03-26T22:21:19+00:00</updated>
<author>
<name>Armin Wolf</name>
<email>W_Armin@gmx.de</email>
</author>
<published>2024-02-13T00:41:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1cbaf4c793b0808532f4e7b40bc4be7cec2c78f2'/>
<id>urn:sha1:1cbaf4c793b0808532f4e7b40bc4be7cec2c78f2</id>
<content type='text'>
[ Upstream commit e18afcb7b2a12b635ac10081f943fcf84ddacc51 ]

After unregistering the CPU idle device, the memory associated with
it is not freed, leading to a memory leak:

unreferenced object 0xffff896282f6c000 (size 1024):
  comm "swapper/0", pid 1, jiffies 4294893170
  hex dump (first 32 bytes):
    00 00 00 00 0b 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace (crc 8836a742):
    [&lt;ffffffff993495ed&gt;] kmalloc_trace+0x29d/0x340
    [&lt;ffffffff9972f3b3&gt;] acpi_processor_power_init+0xf3/0x1c0
    [&lt;ffffffff9972d263&gt;] __acpi_processor_start+0xd3/0xf0
    [&lt;ffffffff9972d2bc&gt;] acpi_processor_start+0x2c/0x50
    [&lt;ffffffff99805872&gt;] really_probe+0xe2/0x480
    [&lt;ffffffff99805c98&gt;] __driver_probe_device+0x78/0x160
    [&lt;ffffffff99805daf&gt;] driver_probe_device+0x1f/0x90
    [&lt;ffffffff9980601e&gt;] __driver_attach+0xce/0x1c0
    [&lt;ffffffff99803170&gt;] bus_for_each_dev+0x70/0xc0
    [&lt;ffffffff99804822&gt;] bus_add_driver+0x112/0x210
    [&lt;ffffffff99807245&gt;] driver_register+0x55/0x100
    [&lt;ffffffff9aee4acb&gt;] acpi_processor_driver_init+0x3b/0xc0
    [&lt;ffffffff990012d1&gt;] do_one_initcall+0x41/0x300
    [&lt;ffffffff9ae7c4b0&gt;] kernel_init_freeable+0x320/0x470
    [&lt;ffffffff99b231f6&gt;] kernel_init+0x16/0x1b0
    [&lt;ffffffff99042e6d&gt;] ret_from_fork+0x2d/0x50

Fix this by freeing the CPU idle device after unregistering it.

Fixes: 3d339dcbb56d ("cpuidle / ACPI : move cpuidle_device field out of the acpi_processor_power structure")
Signed-off-by: Armin Wolf &lt;W_Armin@gmx.de&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ACPI: processor idle: Practically limit "Dummy wait" workaround to old Intel systems</title>
<updated>2023-02-06T06:59:01+00:00</updated>
<author>
<name>Dave Hansen</name>
<email>dave.hansen@intel.com</email>
</author>
<published>2022-09-22T18:47:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=02e61196c578390caf19b340825ea58f874f948c'/>
<id>urn:sha1:02e61196c578390caf19b340825ea58f874f948c</id>
<content type='text'>
commit e400ad8b7e6a1b9102123c6240289a811501f7d9 upstream.

Old, circa 2002 chipsets have a bug: they don't go idle when they are
supposed to.  So, a workaround was added to slow the CPU down and
ensure that the CPU waits a bit for the chipset to actually go idle.
This workaround is ancient and has been in place in some form since
the original kernel ACPI implementation.

But, this workaround is very painful on modern systems.  The "inl()"
can take thousands of cycles (see Link: for some more detailed
numbers and some fun kernel archaeology).

First and foremost, modern systems should not be using this code.
Typical Intel systems have not used it in over a decade because it is
horribly inferior to MWAIT-based idle.

Despite this, people do seem to be tripping over this workaround on
AMD system today.

Limit the "dummy wait" workaround to Intel systems.  Keep Modern AMD
systems from tripping over the workaround.  Remotely modern Intel
systems use intel_idle instead of this code and will, in practice,
remain unaffected by the dummy wait.

Reported-by: K Prateek Nayak &lt;kprateek.nayak@amd.com&gt;
Suggested-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;
Reviewed-by: Mario Limonciello &lt;mario.limonciello@amd.com&gt;
Tested-by: K Prateek Nayak &lt;kprateek.nayak@amd.com&gt;
Link: https://lore.kernel.org/all/20220921063638.2489-1-kprateek.nayak@amd.com/
Link: https://lkml.kernel.org/r/20220922184745.3252932-1-dave.hansen@intel.com
Signed-off-by: Guilherme G. Piccoli &lt;gpiccoli@igalia.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>ACPI: processor/idle: Annotate more functions to live in cpuidle section</title>
<updated>2022-08-17T12:23:06+00:00</updated>
<author>
<name>Guilherme G. Piccoli</name>
<email>gpiccoli@igalia.com</email>
</author>
<published>2022-06-07T22:24:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4bd8bc5c77a017e531a78f3dc43c7be136e065b1'/>
<id>urn:sha1:4bd8bc5c77a017e531a78f3dc43c7be136e065b1</id>
<content type='text'>
[ Upstream commit 409dfdcaffb266acfc1f33529a26b1443c9332d4 ]

Commit 6727ad9e206c ("nmi_backtrace: generate one-line reports for idle cpus")
introduced a new text section called cpuidle; with that, we have a mechanism
to add idling functions in such section and skip them from nmi_backtrace
output, since they're useless and potentially flooding for such report.

Happens that inlining might cause some real idle functions to end-up
outside of such section; this is currently the case of ACPI processor_idle
driver; the functions acpi_idle_enter_* do inline acpi_idle_do_entry(),
hence they stay out of the cpuidle section.
Fix that by marking such functions to also live in the cpuidle section.

Fixes: 6727ad9e206c ("nmi_backtrace: generate one-line reports for idle cpus")
Signed-off-by: Guilherme G. Piccoli &lt;gpiccoli@igalia.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ACPI: processor: idle: Avoid falling back to C3 type C-states</title>
<updated>2022-05-09T07:14:41+00:00</updated>
<author>
<name>Ville Syrjälä</name>
<email>ville.syrjala@linux.intel.com</email>
</author>
<published>2022-04-21T13:36:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f3106b0b0113f919289139676924ecaa3b6d81ef'/>
<id>urn:sha1:f3106b0b0113f919289139676924ecaa3b6d81ef</id>
<content type='text'>
commit fc45e55ebc58dbf622cb89ddbf797589c7a5510b upstream.

The "safe state" index is used by acpi_idle_enter_bm() to avoid
entering a C-state that may require bus mastering to be disabled
on entry in the cases when this is not going to happen.  For this
reason, it should not be set to point to C3 type of C-states, because
they may require bus mastering to be disabled on entry in principle.

This was broken by commit d6b88ce2eb9d ("ACPI: processor idle: Allow
playing dead in C3 state") which inadvertently allowed the "safe
state" index to point to C3 type of C-states.

This results in a machine that won't boot past the point when it first
enters C3. Restore the correct behaviour (either demote to C1/C2, or
use C3 but also set ARB_DIS=1).

I hit this on a Fujitsu Siemens Lifebook S6010 (P3) machine.

Fixes: d6b88ce2eb9d ("ACPI: processor idle: Allow playing dead in C3 state")
Cc: 5.16+ &lt;stable@vger.kernel.org&gt; # 5.16+
Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Tested-by: Woody Suwalski &lt;wsuwalski@gmail.com&gt;
[ rjw: Subject and changelog adjustments ]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Revert "ACPI: processor: idle: fix lockup regression on 32-bit ThinkPad T40"</title>
<updated>2022-05-09T07:14:41+00:00</updated>
<author>
<name>Ville Syrjälä</name>
<email>ville.syrjala@linux.intel.com</email>
</author>
<published>2022-04-20T13:44:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=746140625a0f6e8b6e16e999618d3236855a668c'/>
<id>urn:sha1:746140625a0f6e8b6e16e999618d3236855a668c</id>
<content type='text'>
commit 20e582e16af24b074e583f9551fad557882a3c9d upstream.

This reverts commit bfe55a1f7fd6bfede16078bf04c6250fbca11588.

This was presumably misdiagnosed as an inability to use C3 at
all when I suspect the real problem is just misconfiguration of
C3 vs. ARB_DIS.

Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Cc: 5.16+ &lt;stable@vger.kernel.org&gt; # 5.16+
Tested-by: Woody Suwalski &lt;wsuwalski@gmail.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>ACPI: processor: idle: fix lockup regression on 32-bit ThinkPad T40</title>
<updated>2022-04-20T07:34:04+00:00</updated>
<author>
<name>Woody Suwalski</name>
<email>wsuwalski@gmail.com</email>
</author>
<published>2022-02-09T21:05:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ff810f85ed3f3c6709d05d2497a8ef0d1cda2cf7'/>
<id>urn:sha1:ff810f85ed3f3c6709d05d2497a8ef0d1cda2cf7</id>
<content type='text'>
commit bfe55a1f7fd6bfede16078bf04c6250fbca11588 upstream.

Add and ACPI idle power level limit for 32-bit ThinkPad T40.

There is a regression on T40 introduced by commit d6b88ce2, starting
with kernel 5.16:

commit d6b88ce2eb9d2698eb24451eb92c0a1649b17bb1
Author: Richard Gong &lt;richard.gong@amd.com&gt;
Date:   Wed Sep 22 08:31:16 2021 -0500

  ACPI: processor idle: Allow playing dead in C3 state

The above patch is trying to enter C3 state during init, what is causing
a T40 system freeze. I have not found a similar issue on any other of my
32-bit machines.

The fix is to add another exception to the processor_power_dmi_table[] list.
As a result the dmesg shows as expected:

[2.155398] ACPI: IBM ThinkPad T40 detected - limiting to C2 max_cstate. Override with "processor.max_cstate=9"
[2.155404] ACPI: processor limited to max C-state 2

The fix is trivial and affects only vintage T40 systems.

Fixes: d6b88ce2eb9d ("CPI: processor idle: Allow playing dead in C3 state")
Signed-off-by: Woody Suwalski &lt;wsuwalski@gmail.com&gt;
Reviewed-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Cc: 5.16+ &lt;stable@vger.kernel.org&gt; # 5.16+
[ rjw: New subject ]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Cc: "Limonciello, Mario" &lt;Mario.Limonciello@amd.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
