From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Evgeny Sagatov <evgeny.sagatov@gmail.com>
Cc: regressions@lists.linux.dev, linux-acpi@vger.kernel.org,
Thorsten Leemhuis <regressions@leemhuis.info>,
LKML <linux-kernel@vger.kernel.org>,
Wysocki Rafael J <rafael.j.wysocki@intel.com>
Subject: Re: Pressing the power button causes the device to freeze completely
Date: Tue, 28 Apr 2026 19:40:11 +0200 [thread overview]
Message-ID: <6281827.lOV4Wx5bFT@rafael.j.wysocki> (raw)
In-Reply-To: <CAGAxtY2QRhfoP5NjMQOg5WB15DpPcmX3aBWEy70xYKGMveZ_zg@mail.gmail.com>
On Monday, April 27, 2026 11:49:51 PM CEST Evgeny Sagatov wrote:
> apr 28 00:48:34 srv kernel: ACPI power button event
> apr 28 00:48:34 srv kernel: ACPI event status I/O port number: 1024
>
> пн, 27 апр. 2026 г. в 23:31, Rafael J. Wysocki <rafael@kernel.org>:
> >
> > On Monday, April 27, 2026 10:12:33 PM CEST Evgeny Sagatov wrote:
> > > dmesg | grep "frequency scaling"
> > > [ 8.552380] acpi_cpufreq: CPU0: Using I/O space for frequency scaling
> > > [ 8.552386] acpi_cpufreq: CPU0: frequency scaling I/O port number: 2176
> > > [ 8.552478] acpi_cpufreq: CPU1: Using I/O space for frequency scaling
> > > [ 8.552480] acpi_cpufreq: CPU1: frequency scaling I/O port number: 2176
> > > [ 8.552584] acpi_cpufreq: CPU2: Using I/O space for frequency scaling
> > > [ 8.552586] acpi_cpufreq: CPU2: frequency scaling I/O port number: 2176
> > > [ 8.552668] acpi_cpufreq: CPU3: Using I/O space for frequency scaling
> > > [ 8.552670] acpi_cpufreq: CPU3: frequency scaling I/O port number: 2176
The I/O ports that play the role in this issue are separate from each other in
the address space, but that need not mean that they are physically independent.
My current theory is that accessing one of them while an access to the other
one is still in progress may cause the platform to lock up, or there is an
access pattern that causes that to happen.
Let's first test the simplest variant of that theory and see what happens if
all I/O port accesses in acpi_os_write_port() are serialized, which is done
in the patch below (it is a replacement for all of the patches sent so far).
In addition, that patch causes schedutil to use the slow path for updating the
frequency because the I/O space is generally somewhat too slow to be used
from the scheduler context relatively often, but that should not affect the
behavior related to I/O space accesses.
Please check if the system still locks up after pressing the power button
with this patch applied.
---
drivers/acpi/osl.c | 9 +++++++--
drivers/cpufreq/acpi-cpufreq.c | 9 ++++++---
2 files changed, 13 insertions(+), 5 deletions(-)
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -700,8 +700,10 @@ EXPORT_SYMBOL(acpi_os_read_port);
acpi_status acpi_os_write_port(acpi_io_address port, u32 value, u32 width)
{
- if (!IS_ENABLED(CONFIG_HAS_IOPORT))
- return AE_NOT_IMPLEMENTED;
+#ifdef CONFIG_HAS_IOPORT
+ static DEFINE_RAW_SPINLOCK(acpi_os_write_port_lock);
+
+ guard(raw_spinlock_irqsave)(&acpi_os_write_port_lock);
if (width <= 8) {
outb(value, port);
@@ -715,6 +717,9 @@ acpi_status acpi_os_write_port(acpi_io_a
}
return AE_OK;
+#else
+ return AE_NOT_IMPLEMENTED;
+#endif
}
EXPORT_SYMBOL(acpi_os_write_port);
--- a/drivers/cpufreq/acpi-cpufreq.c
+++ b/drivers/cpufreq/acpi-cpufreq.c
@@ -878,6 +878,10 @@ static int acpi_cpufreq_cpu_init(struct
policy->freq_table = freq_table;
perf->state = 0;
+ policy->fast_switch_possible = !acpi_pstate_strict &&
+ !(policy_is_shared(policy) &&
+ policy->shared_type != CPUFREQ_SHARED_TYPE_ANY);
+
switch (perf->control_register.space_id) {
case ACPI_ADR_SPACE_SYSTEM_IO:
/*
@@ -887,6 +891,8 @@ static int acpi_cpufreq_cpu_init(struct
* unknown and not detectable via IO ports.
*/
policy->cur = acpi_cpufreq_guess_freq(data, policy->cpu);
+ /* I/O spcase is too slow for fast switching. */
+ policy->fast_switch_possible = false;
break;
case ACPI_ADR_SPACE_FIXED_HARDWARE:
acpi_cpufreq_driver.get = get_cur_freq_on_cpu;
@@ -912,9 +918,6 @@ static int acpi_cpufreq_cpu_init(struct
*/
data->resume = 1;
- policy->fast_switch_possible = !acpi_pstate_strict &&
- !(policy_is_shared(policy) && policy->shared_type != CPUFREQ_SHARED_TYPE_ANY);
-
if (perf->states[0].core_frequency * 1000 != freq_table[0].frequency)
pr_warn(FW_WARN "P-state 0 is not max freq\n");
next prev parent reply other threads:[~2026-04-28 17:40 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <184091776095270@mail.yandex.ru>
2026-04-16 8:22 ` Thorsten Leemhuis
[not found] ` <186071776359023@mail.yandex.ru>
2026-04-16 17:35 ` Thorsten Leemhuis
[not found] ` <26521776666243@mail.yandex.ru>
2026-04-20 6:41 ` Sagatov, Evgeniy
2026-04-20 6:54 ` Thorsten Leemhuis
2026-04-20 19:34 ` Sagatov, Evgeniy
2026-04-20 22:20 ` Sagatov, Evgeniy
2026-04-21 5:01 ` Thorsten Leemhuis
2026-04-21 9:28 ` Sagatov, Evgeniy
2026-04-21 15:11 ` Wysocki, Rafael J
2026-04-21 20:41 ` Rafael J. Wysocki
[not found] ` <168591776860440@mail.yandex.ru>
2026-04-22 12:36 ` Evgeny Sagatov
2026-04-22 13:26 ` Rafael J. Wysocki
2026-04-22 13:34 ` Evgeny Sagatov
2026-04-22 14:04 ` Rafael J. Wysocki
2026-04-22 14:48 ` Evgeny Sagatov
2026-04-23 13:17 ` Rafael J. Wysocki
2026-04-23 14:51 ` Evgeny Sagatov
2026-04-23 18:21 ` Rafael J. Wysocki
2026-04-23 20:07 ` Evgeny Sagatov
2026-04-24 14:40 ` Rafael J. Wysocki
2026-04-24 17:06 ` Evgeny Sagatov
2026-04-24 19:45 ` Rafael J. Wysocki
2026-04-24 21:18 ` Evgeny Sagatov
2026-04-26 14:50 ` Rafael J. Wysocki
2026-04-26 14:54 ` Rafael J. Wysocki
2026-04-26 20:45 ` Evgeny Sagatov
2026-04-27 18:48 ` Rafael J. Wysocki
2026-04-27 20:12 ` Evgeny Sagatov
2026-04-27 20:31 ` Rafael J. Wysocki
2026-04-27 21:49 ` Evgeny Sagatov
2026-04-28 17:40 ` Rafael J. Wysocki [this message]
2026-04-28 19:11 ` Evgeny Sagatov
2026-04-28 19:58 ` Rafael J. Wysocki
2026-04-28 21:05 ` Evgeny Sagatov
2026-04-29 18:24 ` Pressing the power button causes the device to freeze completely (schedutil involved) Rafael J. Wysocki
2026-04-29 20:22 ` Rafael J. Wysocki
2026-04-29 21:16 ` Evgeny Sagatov
2026-04-30 10:40 ` Rafael J. Wysocki
2026-04-30 10:53 ` Rafael J. Wysocki
2026-04-30 11:41 ` Evgeny Sagatov
2026-04-30 11:57 ` Evgeny Sagatov
2026-04-30 14:10 ` Rafael J. Wysocki
2026-04-30 16:04 ` Evgeny Sagatov
2026-04-30 13:57 ` Rafael J. Wysocki
2026-04-30 14:42 ` Rafael J. Wysocki
2026-04-30 23:05 ` Evgeny Sagatov
2026-04-30 23:17 ` Evgeny Sagatov
2026-05-01 12:00 ` Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6281827.lOV4Wx5bFT@rafael.j.wysocki \
--to=rafael@kernel.org \
--cc=evgeny.sagatov@gmail.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael.j.wysocki@intel.com \
--cc=regressions@leemhuis.info \
--cc=regressions@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®