Skip to content

ACPI: scan: fix the fixed event power button since 6.18.57

Ting-Han Hou linux-acpi regressions stable 1 version Applied

Status from this message: Queued 1/3 for 6.18, thanks. 2/3 and 3/3 are not needed there.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 1 replyApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/3ACPI: scan: Register platform devices for fixed event buttonsdrivers/acpi/acpi_platform.c drivers/acpi/scan.c+25 -170 replies
2/3ACPI: scan: Avoid registering platform devices with resource overlapsdrivers/acpi/acpi_platform.c+37 -21 reply
3/3ACPI: scan: Do not combine resources that overlap completelydrivers/acpi/acpi_platform.c+7 -10 replies

Reviews trailers per patch

2 of 3 patches have a Reviewed-by or Acked-by.

PatchJulienPaul MenzelAndy ShevchenkoNathan ChancellorJarkko Sakkinen
1/3
2/3T-b R-b R-b
3/3T-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v1 thread

Cover letter [PATCH 6.18.y 0/3] ACPI: scan: fix the fixed event power button since 6.18.57

Since 6.18.57, the ACPI power button is not bound to any driver when it is a fixed event device (LNXPWRBN), so ACPI power-off requests are ignored. This was reported for QEMU guests by Wolfgang Walter [1] and Frederic MARIE-JOSEPH [2], and for Dell servers (power button and iDRAC graceful shutdown) by Bob Anderson [1]. The ASRock H310CM-HDV report on linux-acpi [3] (ff_pwr_btn "STS invalid") may be the same problem.

6.18.57 got 52d864019636 ("ACPI: button: Convert the driver to a platform one") as a dependency of fe80251152fe ("ACPI: button: Fix ACPI GPE handler leak during removal"), but not ab06eb920401 ("ACPI: scan:
Register platform devices for fixed event buttons"), so fixed event buttons have no platform device to bind to. Bob found that ab06eb920401 fixes it, Wolfgang confirmed that, and Sasha queued it for 6.18 [1]. 6.18.59-rc1 also converts the tiny power button driver to a platform one, so with CONFIG_ACPI_TINY_POWER_BUTTON=y the fixed event power button stops working in 6.18.59-rc1 as well (it still works in 6.18.58).

ab06eb920401 was then dropped from the 6.18 queue together with its two upstream follow-up fixes (stable-queue c4d7fb7346 "drop acpi patches"), with a FAILED report for f234fdaae1ca. With the three patches as they were queued, drivers/acpi/acpi_platform.c does not build on 6.18.y:

drivers/acpi/acpi_platform.c:92:21: error: implicit declaration of function '__resource_contains_unbound' [-Wimplicit-function-declaration]

__resource_contains_unbound() comes from edfaa81d5da5 ("resource: Add __resource_contains_unbound() for internal contains checks"), which is not in 6.18.y, so patch 3 uses resource_contains() instead; the note in that patch explains why this is equivalent here. Patches 1 and 2 are clean cherry-picks. aef7792cddca, which also has
"Fixes: ab06eb920401", only rewords a debug message and is not included.

The series applies to both v6.18.58 and the current 6.18 queue (6.18.59-rc1).

Testing: x86_64, QEMU q35 with KVM, an initramfs whose init waits for the power button and then powers off, and QMP system_powerdown sent after boot:

                                        without series   with series
  6.18.58,     CONFIG_ACPI_BUTTON=y     ignored          KEY_POWER, off in 0.5s
  6.18.59-rc1, CONFIG_ACPI_BUTTON=y     ignored          KEY_POWER, off in 0.5s
  6.18.59-rc1, ACPI_TINY_POWER_BUTTON   ignored          signal 38 to init, off in 0.5s

6.18.58, ACPI_TINY_POWER_BUTTON works (still an ACPI driver there)

"ignored" means there is no "Power Button" input device, LNXPWRBN:00 has no physical node, and nothing happens until init gives up after 40 seconds. With the series, LNXPWRBN:00 gets a platform device bound to acpi-button (or acpi-tiny-power-button), and the only new kernel messages during boot are "input: Power Button as /devices/platform/LNXPWRBN:00/input/input0" and "ACPI: button: Power Button [PWRF]". A KASAN + PROVE_LOCKING + DEBUG_ATOMIC_SLEEP + DEBUG_LIST build of 6.18.59-rc1 with the series boots and powers off without splats, and there are no new W=1 or sparse warnings in drivers/acpi/acpi_platform.c and drivers/acpi/scan.c.

Not tested: real hardware, and machines whose _CRS has overlapping resources (the case patches 2 and 3 are about).

Tool use: most of this work was done with an LLM coding assistant (Claude Code with Claude Opus 5.5). It found the regression reports and the dropped queue patches while going through recent stable FAILED mails, rebuilt 6.18.59-rc1 from stable-queue (its tree matches linux-stable-rc), made the resource_contains() change in patch 3 and wrote the notes in patches 1 and 3, wrote the test initramfs and scripts, ran the builds and QEMU tests listed above, and drafted this cover letter. Patches 1 and 2 are unmodified upstream code. I reviewed the series and the test results before sending.

[1] https://lore.kernel.org/all/[email protected]/
[2] https://lore.kernel.org/all/[email protected]/
[3] https://lore.kernel.org/all/CADP5X9+xCTkxXZO1dcTodrwsfW=piV41c5f_zaOq6KsrxD0Hhw@mail.gmail.com/

Rafael J. Wysocki (3):
ACPI: scan: Register platform devices for fixed event buttons
ACPI: scan: Avoid registering platform devices with resource overlaps
ACPI: scan: Do not combine resources that overlap completely

 drivers/acpi/acpi_platform.c | 79 ++++++++++++++++++++++++++++--------
 drivers/acpi/scan.c          |  4 ++
 2 files changed, 66 insertions(+), 17 deletions(-)

base-commit: 2926d88bb7fc4608fd942453d929c39e4e5ec006

Signature · 1 line
2.53.0