From: Rafael J. Wysocki Date: Mon, 23 Mar 2026 15:26:37 +0000 (+0100) Subject: ACPI: TAD: Use DC wakeup only if AC wakeup is supported X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f706a63fd82242a21cb5248b76c21d3c302a4b54;p=thirdparty%2Fkernel%2Flinux.git ACPI: TAD: Use DC wakeup only if AC wakeup is supported According to Section 9.17.2 of ACPI 6.6 [1], setting ACPI_TAD_DC_WAKE in the capabilities without setting ACPI_TAD_AC_WAKE is invalid, so don't support wakeup if that's the case. Moreover, it is sufficient to check ACPI_TAD_AC_WAKE alone to determine if wakeup is supported at all, so use this observation to simplify one check. Link: https://uefi.org/specs/ACPI/6.6/09_ACPI_Defined_Devices_and_Device_Specific_Objects.html#gcp-get-capability [1] Signed-off-by: Rafael J. Wysocki Link: https://patch.msgid.link/2833494.mvXUDI8C0e@rafael.j.wysocki --- diff --git a/drivers/acpi/acpi_tad.c b/drivers/acpi/acpi_tad.c index d67c43edf8558..8b43d883125ed 100644 --- a/drivers/acpi/acpi_tad.c +++ b/drivers/acpi/acpi_tad.c @@ -706,6 +706,9 @@ static int acpi_tad_probe(struct platform_device *pdev) caps &= ~(ACPI_TAD_AC_WAKE | ACPI_TAD_DC_WAKE); } + if (!(caps & ACPI_TAD_AC_WAKE)) + caps &= ~ACPI_TAD_DC_WAKE; + dd = devm_kzalloc(dev, sizeof(*dd), GFP_KERNEL); if (!dd) return -ENOMEM; @@ -719,7 +722,7 @@ static int acpi_tad_probe(struct platform_device *pdev) * runtime suspend. Everything else should be taken care of by the ACPI * PM domain callbacks. */ - if (ACPI_TAD_AC_WAKE | ACPI_TAD_DC_WAKE) { + if (ACPI_TAD_AC_WAKE) { device_init_wakeup(dev, true); dev_pm_set_driver_flags(dev, DPM_FLAG_SMART_SUSPEND | DPM_FLAG_MAY_SKIP_RESUME);