Skip to content

ACPI: button: Fixes related to GPE handling and probe error path

Rafael J. Wysocki linux-acpi lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 2 repliesIn review
  2. v13 patches 5 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3ACPI: button: Fix ACPI GPE handler leak during removaldrivers/acpi/button.c+1 -10 replies
2/3ACPI: button: Enable wakeup GPEs for ACPI buttons at probe timedrivers/acpi/acpica/evxfgpe.c drivers/acpi/button.c include/acpi/acpixf.h+68 -92 replies
3/3ACPI: button: Add missing device class clearing on probe failuresdrivers/acpi/button.c+1 -00 replies

Reviews trailers per patch

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

PatchMario Limonciello (AMD)
1/3R-b
2/3
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/3] ACPI: button: Fixes related to GPE handling and probe error path

Hi All,

This is an update of

https://lore.kernel.org/linux-acpi/[email protected]/

sent to address sashiko.dev feedback on patch [2/3]:

Quoted 7 lines
Quoted 7 lines
(quoted diff) +0 -0
@@ -106,8 +109,7 @@ acpi_status acpi_enable_gpe(acpi_handle gpe_device,

u32 gpe_number)> >

(quoted diff) +0 -0
 	 */
 
 	gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number);
 	if (gpe_event_info) {
Quoted 11 lines
Quoted 4 lines
(quoted diff) +1 -2
-		if (ACPI_GPE_DISPATCH_TYPE(gpe_event_info->flags) !=
-		    ACPI_GPE_DISPATCH_NONE) {
+		if (ACPI_GPE_DISPATCH_TYPE(gpe_event_info->flags) & dispatch_type_mask)

{

Does this incorrectly treat sequential enumeration values as bit flags? ACPI_GPE_DISPATCH_METHOD is defined as 1, and ACPI_GPE_DISPATCH_NOTIFY is 3. Since dispatch_type_mask is passed as ACPI_GPE_DISPATCH_METHOD (1) from acpi_button_probe(), this bitwise AND evaluates to true for both METHOD (1 & 1 == 1) and NOTIFY (3 & 1 == 1).
Could this unintentionally enable GPEs for NOTIFY handlers?

The original series description below still applies.

This series fix three issues related to the ACPI button driver, one introduced during the 6.15 development cycle, one from the 7.0 cycle, and one that has been there for a long time, but has been omitted by mistake by a recent commit.

Thanks!