]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ACPI: TAD: Check AC wake capability before enabling wakeup
authorXu Rao <raoxu@uniontech.com>
Thu, 25 Jun 2026 13:29:03 +0000 (21:29 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 25 Jun 2026 13:39:58 +0000 (15:39 +0200)
ACPI_TAD_AC_WAKE is a non-zero bit definition, so testing the macro
itself is always true. As a result, every TAD device is initialized as
a system wakeup device, including RTC-only devices and devices whose
wake capability bits were cleared because _PRW is absent.

Test the capability value returned by _GCP instead. This keeps
RTC-only TAD devices usable without advertising a wakeup capability
that the firmware does not provide.

Fixes: 6c711fde3a1c ("ACPI: TAD: Support RTC without wakeup")
Cc: All applicable <stable@vger.kernel.org>
Signed-off-by: Xu Rao <raoxu@uniontech.com>
Link: https://patch.msgid.link/961A84FF37B50665+20260625132903.2840457-1-raoxu@uniontech.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/acpi_tad.c

index cac07e997028a3c0f4ea281f29d7280552b0ba75..1a60fba59fda58fa1c08ffa6fef99afcf3281ca6 100644 (file)
@@ -852,7 +852,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) {
+       if (caps & ACPI_TAD_AC_WAKE) {
                device_init_wakeup(dev, true);
                dev_pm_set_driver_flags(dev, DPM_FLAG_SMART_SUSPEND |
                                             DPM_FLAG_MAY_SKIP_RESUME);