https://bugzilla.kernel.org/show_bug.cgi?id=207015

            Bug ID: 207015
           Summary: Do not configure two power buttons with buggy firmware
           Product: ACPI
           Version: 2.5
    Kernel Version: 5.6-rc7
          Hardware: All
                OS: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: ACPICA-Core
          Assignee: acpi_acpica-c...@kernel-bugs.osdl.org
          Reporter: pmenzel+bugzilla.kernel....@molgen.mpg.de
        Regression: No

Most firmware seems to violate the ACPI spec (Table 4-13 Power Button Support)
by configuring two power buttons.

1.  On a desktop board:

```
[…]
[    0.000000] DMI: Micro-Star International Co., Ltd. MS-7A37/B350M MORTAR
(MS-7A37), BIOS 1.MR 12/02/2019
[…]
[    7.272188] input: Power Button as
/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0C:00/input/input2
[    7.272247] ACPI: Power Button [PWRB]
[    7.272294] input: Power Button as
/devices/LNXSYSTM:00/LNXPWRBN:00/input/input3
[    7.272342] ACPI: Power Button [PWRF]
```

2.  On a laptop (no idea where the two buttons come from here):

```
[…]
[    0.000000] DMI: Dell Inc. Latitude E7250/0TVD2T, BIOS A19 01/23/2018
[…]
[    6.638110] calling  acpi_button_driver_init+0x0/0x1000 [button] @ 323
[    6.638232] input: Lid Switch as
/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0D:00/input/input3
[    6.639672] ACPI: Lid Switch [LID0]
[    6.639684] probe of PNP0C0D:00 returned 1 after 1502 usecs
[    6.639730] input: Power Button as
/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0C:00/input/input4
[    6.639799] ACPI: Power Button [PBTN]
[    6.639807] probe of PNP0C0C:00 returned 1 after 114 usecs
[    6.639841] input: Sleep Button as
/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0E:00/input/input5
[    6.639888] ACPI: Sleep Button [SBTN]
[    6.639897] probe of PNP0C0E:00 returned 1 after 87 usecs
[    6.639938] input: Power Button as
/devices/LNXSYSTM:00/LNXPWRBN:00/input/input6
[    6.639990] ACPI: Power Button [PWRF]
[    6.640003] probe of LNXPWRBN:00 returned 1 after 95 usecs
[    6.640012] initcall acpi_button_driver_init+0x0/0x1000 [button] returned 0
after 510 usecs
```

If an ACPI PNP0C0C device, the PWR_Button field in FACP should not be zero.

Furquan noticed this for coreboot [1], and fwts also added a check for this.

The Linux kernel should also warn about this firmware bug, and only set up the
fixed hardware power button, if the field in FACP is zero.

The Linux code below would need to be adapted, but I wonder how to read the
FACP state.

```
        if (!strcmp(hid, ACPI_BUTTON_HID_POWER) ||
            !strcmp(hid, ACPI_BUTTON_HID_POWERF)) {
                button->type = ACPI_BUTTON_TYPE_POWER;
                strcpy(name, ACPI_BUTTON_DEVICE_NAME_POWER);
                sprintf(class, "%s/%s",
                        ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_POWER);
```

This way udev and other user space programs also would not have to configure
the incorrect button device.

[1]: https://review.coreboot.org/c/coreboot/+/27272
[2]:
https://git.launchpad.net/fwts/commit/?id=8a93b82ce64d1e23bfd8943707e8429a693e2a97

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

_______________________________________________
acpi-bugzilla mailing list
acpi-bugzilla@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/acpi-bugzilla

Reply via email to