From d8a872c810916714067e2089c68d2fd0e65da43c Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Mon, 15 Dec 2025 13:48:14 +0100 Subject: [PATCH 1/9] ACPI: PCI: PM: Rework root bus notification setup Since pci_acpi_add_bus_pm_notifier() is only suitable for adding ACPI PM notifiers to root buses, rename it to pci_acpi_add_root_pm_notifier() and modify it to take an additional "root" argument, which is then used for passing a PCI root bridge device pointer to acpi_add_pm_notifier(). That function uses it to populate the "dev" field in the context structure attached to the ACPI device object that will receive the ACPI "wake" notifications on behalf of the given PCI root bus. The context structure in question is passed to pci_acpi_wake_bus(), so the latter can be simplified quite a bit now because the target PCI host bridge structure address can be derived from "dev". No intentional functional impact. This change will also facilitate a subsequent update related to the registration of wakeup sources. Signed-off-by: Rafael J. Wysocki Reviewed-by: Armin Wolf [ rjw: Kerneldoc comment fixup ] Link: https://patch.msgid.link/2395263.ElGaqSPkdT@rafael.j.wysocki Signed-off-by: Rafael J. Wysocki --- drivers/acpi/pci_root.c | 2 +- drivers/pci/pci-acpi.c | 15 ++++++--------- include/linux/pci-acpi.h | 3 ++- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index 74ade4160314..9d7f85dadc48 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c @@ -738,7 +738,7 @@ static int acpi_pci_root_add(struct acpi_device *device, if (no_aspm) pcie_no_aspm(); - pci_acpi_add_bus_pm_notifier(device); + pci_acpi_add_root_pm_notifier(device, root); device_set_wakeup_capable(root->bus->bridge, device->wakeup.flags.valid); if (hotadd) { diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index 9369377725fa..79980203a1fb 100644 --- a/drivers/pci/pci-acpi.c +++ b/drivers/pci/pci-acpi.c @@ -847,12 +847,7 @@ bool shpchp_is_native(struct pci_dev *bridge) */ static void pci_acpi_wake_bus(struct acpi_device_wakeup_context *context) { - struct acpi_device *adev; - struct acpi_pci_root *root; - - adev = container_of(context, struct acpi_device, wakeup.context); - root = acpi_driver_data(adev); - pci_pme_wakeup_bus(root->bus); + pci_pme_wakeup_bus(to_pci_host_bridge(context->dev)->bus); } /** @@ -885,12 +880,14 @@ static void pci_acpi_wake_dev(struct acpi_device_wakeup_context *context) } /** - * pci_acpi_add_bus_pm_notifier - Register PM notifier for root PCI bus. + * pci_acpi_add_root_pm_notifier - Register PM notifier for root PCI bus. * @dev: PCI root bridge ACPI device. + * @root: PCI root corresponding to @dev. */ -acpi_status pci_acpi_add_bus_pm_notifier(struct acpi_device *dev) +acpi_status pci_acpi_add_root_pm_notifier(struct acpi_device *dev, + struct acpi_pci_root *root) { - return acpi_add_pm_notifier(dev, NULL, pci_acpi_wake_bus); + return acpi_add_pm_notifier(dev, root->bus->bridge, pci_acpi_wake_bus); } /** diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h index 078225b514d4..c0c54baadf04 100644 --- a/include/linux/pci-acpi.h +++ b/include/linux/pci-acpi.h @@ -12,7 +12,8 @@ #include #ifdef CONFIG_ACPI -extern acpi_status pci_acpi_add_bus_pm_notifier(struct acpi_device *dev); +extern acpi_status pci_acpi_add_root_pm_notifier(struct acpi_device *dev, + struct acpi_pci_root *pci_root); static inline acpi_status pci_acpi_remove_bus_pm_notifier(struct acpi_device *dev) { return acpi_remove_pm_notifier(dev); From 057edc58aa5926d63840c7f30afe0953d3994fa3 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Mon, 15 Dec 2025 13:49:17 +0100 Subject: [PATCH 2/9] ACPI: PM: Register wakeup sources under physical devices Currently, acpi_add_pm_notifier() registers wakeup sources under ACPI companions of the devices affected by the handling of wakeup events which goes against the rule that a struct acpi_device can only be a parent of another struct acpi_device. Moreover, it would be more logically consistent to register wakeup sources under the devices affected by wakeup events handling which would cause them to appear in more suitable places in sysfs and would help to identify the devices they are associated with more easily. Accordingly, update acpi_add_pm_notifier() to register wakeup sources under the "target" devices directly instead of registering them under the ACPI companions of those devices. Signed-off-by: Rafael J. Wysocki Reviewed-by: Armin Wolf Link: https://patch.msgid.link/1944126.tdWV9SEqCh@rafael.j.wysocki --- drivers/acpi/device_pm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c index 4e0583274b8f..cff3186aa945 100644 --- a/drivers/acpi/device_pm.c +++ b/drivers/acpi/device_pm.c @@ -586,8 +586,7 @@ acpi_status acpi_add_pm_notifier(struct acpi_device *adev, struct device *dev, goto out; mutex_lock(&acpi_pm_notifier_lock); - adev->wakeup.ws = wakeup_source_register(&adev->dev, - dev_name(&adev->dev)); + adev->wakeup.ws = wakeup_source_register(dev, dev_name(&adev->dev)); adev->wakeup.context.dev = dev; adev->wakeup.context.func = func; adev->wakeup.flags.notifier_present = true; From 2aa1e462508d73e4fa2de26a3d50c867bb784830 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Mon, 29 Dec 2025 14:29:59 +0100 Subject: [PATCH 3/9] ACPI: sysfs: Add device cid attribute for exposing _CID lists Add a new sysfs attribute called "cid" under struct acpi_device for exposing the list of compatible device IDs returned by the device's _CID object, if present. The new attribute will be present only if the _CID object is present. Signed-off-by: Rafael J. Wysocki Reviewed-by: Andy Shevchenko Link: https://patch.msgid.link/5957407.DvuYhMxLoT@rafael.j.wysocki --- drivers/acpi/device_sysfs.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/drivers/acpi/device_sysfs.c b/drivers/acpi/device_sysfs.c index cd199fbe4dc9..8cc9507b3c6d 100644 --- a/drivers/acpi/device_sysfs.c +++ b/drivers/acpi/device_sysfs.c @@ -403,6 +403,33 @@ hid_show(struct device *dev, struct device_attribute *attr, char *buf) } static DEVICE_ATTR_RO(hid); +static ssize_t cid_show(struct device *dev, struct device_attribute *attr, + char *buf) +{ + struct acpi_device *acpi_dev = to_acpi_device(dev); + struct acpi_device_info *info = NULL; + ssize_t len = 0; + + acpi_get_object_info(acpi_dev->handle, &info); + if (!info) + return 0; + + if (info->valid & ACPI_VALID_CID) { + struct acpi_pnp_device_id_list *cid_list = &info->compatible_id_list; + int i; + + for (i = 0; i < cid_list->count - 1; i++) + len += sysfs_emit_at(buf, len, "%s,", cid_list->ids[i].string); + + len += sysfs_emit_at(buf, len, "%s\n", cid_list->ids[i].string); + } + + kfree(info); + + return len; +} +static DEVICE_ATTR_RO(cid); + static ssize_t uid_show(struct device *dev, struct device_attribute *attr, char *buf) { @@ -520,6 +547,7 @@ static DEVICE_ATTR_RO(status); static struct attribute *acpi_attrs[] = { &dev_attr_path.attr, &dev_attr_hid.attr, + &dev_attr_cid.attr, &dev_attr_modalias.attr, &dev_attr_description.attr, &dev_attr_adr.attr, @@ -562,6 +590,9 @@ static bool acpi_show_attr(struct acpi_device *dev, const struct device_attribut if (attr == &dev_attr_status) return acpi_has_method(dev->handle, "_STA"); + if (attr == &dev_attr_cid) + return acpi_has_method(dev->handle, "_CID"); + /* * If device has _EJ0, 'eject' file is created that is used to trigger * hot-removal function from userland. From ba6ded26dffe511b862a98a25955955e7154bfa8 Mon Sep 17 00:00:00 2001 From: Ai Chao Date: Tue, 13 Jan 2026 15:27:19 +0800 Subject: [PATCH 4/9] ACPI: resource: Add JWIPC JVC9100 to irq1_level_low_skip_override[] Like the JWIPC JVC9100 has its serial IRQ (10 and 11) described as ActiveLow in the DSDT, which the kernel overrides to EdgeHigh which breaks the serial. irq 10, level, active-low, shared, skip-override irq 11, level, active-low, shared, skip-override Add the JVC9100 to the irq1_level_low_skip_override[] quirk table to fix this. Signed-off-by: Ai Chao Link: https://patch.msgid.link/20260113072719.4154485-1-aichao@kylinos.cn Signed-off-by: Rafael J. Wysocki --- drivers/acpi/resource.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c index d16906f46484..bc8050d8a6f5 100644 --- a/drivers/acpi/resource.c +++ b/drivers/acpi/resource.c @@ -532,6 +532,12 @@ static const struct dmi_system_id irq1_level_low_skip_override[] = { DMI_MATCH(DMI_BOARD_NAME, "16T90SP"), }, }, + { + /* JWIPC JVC9100 */ + .matches = { + DMI_MATCH(DMI_BOARD_NAME, "JVC9100"), + }, + }, { } }; @@ -706,6 +712,8 @@ struct irq_override_cmp { static const struct irq_override_cmp override_table[] = { { irq1_level_low_skip_override, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false }, + { irq1_level_low_skip_override, 10, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 1, false }, + { irq1_level_low_skip_override, 11, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 1, false }, { irq1_edge_low_force_override, 1, ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_LOW, 1, true }, }; From de69a0875324c72b9fc78503f6852ea1e380f5f7 Mon Sep 17 00:00:00 2001 From: Gergo Koteles Date: Fri, 9 Jan 2026 01:16:19 +0100 Subject: [PATCH 5/9] ACPI: x86: s2idle: Remove dead code in lps0_device_attach() The rev_id is always 0 for AMD since commit e32d546483a2 ("ACPI: x86: Drop quirk for HP Elitebook"), so this condition will never be true. Remove the dead code. Signed-off-by: Gergo Koteles Reviewed-by: Mario Limonciello (AMD) Link: https://patch.msgid.link/20260109001619.37532-1-soyer@irl.hu Signed-off-by: Rafael J. Wysocki --- drivers/acpi/x86/s2idle.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/acpi/x86/s2idle.c b/drivers/acpi/x86/s2idle.c index cc3c83e4cc23..f97a4dff336e 100644 --- a/drivers/acpi/x86/s2idle.c +++ b/drivers/acpi/x86/s2idle.c @@ -463,9 +463,6 @@ static int lps0_device_attach(struct acpi_device *adev, lps0_dsm_func_mask = (lps0_dsm_func_mask << 1) | 0x1; acpi_handle_debug(adev->handle, "_DSM UUID %s: Adjusted function mask: 0x%x\n", ACPI_LPS0_DSM_UUID_AMD, lps0_dsm_func_mask); - } else if (lps0_dsm_func_mask_microsoft > 0 && rev_id) { - lps0_dsm_func_mask_microsoft = -EINVAL; - acpi_handle_debug(adev->handle, "_DSM Using AMD method\n"); } } else { rev_id = 1; From 64a506fb7c531651ccbdc78a3e0abc96f35e8be3 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Tue, 13 Jan 2026 14:38:41 +0100 Subject: [PATCH 6/9] ACPI: PM: Adjust messages regarding postponed ACPI PM The debug messages added by commit f7599be2bb76 ("ACPI: PM: postpone bringing devices to D0 unless we need them") in acpi_subsys_resume_early() and acpi_subsys_resume() are not quite accurate because what is postponed is not just a transition to D0, but also an adjustment of the device's wakeup setting (which may involve disabling a GPE among other things). Moreover, these messages don't even mention ACPI. Rephrase them and adjust the style to match other messages in device_pm.c. Signed-off-by: Rafael J. Wysocki Reviewed-by: Dmitry Torokhov Link: https://patch.msgid.link/5969819.DvuYhMxLoT@rafael.j.wysocki --- drivers/acpi/device_pm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c index cff3186aa945..aa55ecfc2923 100644 --- a/drivers/acpi/device_pm.c +++ b/drivers/acpi/device_pm.c @@ -1251,7 +1251,7 @@ static int acpi_subsys_resume_early(struct device *dev) return 0; if (pm && !pm->resume_early) { - dev_dbg(dev, "postponing D0 transition to normal resume stage\n"); + dev_dbg(dev, "Postponing ACPI PM to normal resume stage\n"); return 0; } @@ -1273,7 +1273,7 @@ static int acpi_subsys_resume(struct device *dev) int ret = 0; if (!dev_pm_skip_resume(dev) && pm && !pm->resume_early) { - dev_dbg(dev, "executing postponed D0 transition\n"); + dev_dbg(dev, "Applying postponed ACPI PM\n"); ret = acpi_dev_resume(dev); } From ed0a1ac2aa936a0abc2d940eff51158de6e8cec0 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Wed, 21 Jan 2026 09:50:49 +0100 Subject: [PATCH 7/9] ACPI: PCI: simplify code with acpi_get_local_u64_address() Now we have a helper so there's no need to open-code. Signed-off-by: Andy Shevchenko Reviewed-by: Bjorn Helgaas Link: https://patch.msgid.link/20260121085105.2282380-1-andriy.shevchenko@linux.intel.com Signed-off-by: Rafael J. Wysocki --- drivers/acpi/pci_slot.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/acpi/pci_slot.c b/drivers/acpi/pci_slot.c index 741bcc9d6d6a..15234b65ea22 100644 --- a/drivers/acpi/pci_slot.c +++ b/drivers/acpi/pci_slot.c @@ -42,8 +42,9 @@ static int check_slot(acpi_handle handle, unsigned long long *sun) { int device = -1; - unsigned long long adr, sta; + unsigned long long sta; acpi_status status; + u64 adr; struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer); @@ -56,10 +57,9 @@ check_slot(acpi_handle handle, unsigned long long *sun) goto out; } - status = acpi_evaluate_integer(handle, "_ADR", NULL, &adr); - if (ACPI_FAILURE(status)) { - pr_debug("_ADR returned %d on %s\n", - status, (char *)buffer.pointer); + if (acpi_get_local_u64_address(handle, &adr)) { + pr_debug("_ADR returned with failure on %s\n", + (char *)buffer.pointer); goto out; } From 785632d82648569b1ce8f11854d0775b219e2706 Mon Sep 17 00:00:00 2001 From: Sumeet Pawnikar Date: Mon, 26 Jan 2026 15:09:49 +0530 Subject: [PATCH 8/9] ACPI: sysfs: Replace sprintf() with sysfs_emit() Replace all sprintf() calls with sysfs_emit() in sysfs show functions. sysfs_emit() is preferred to sprintf() for formatting sysfs output as it provides better bounds checking and prevents potential buffer overflows. Signed-off-by: Sumeet Pawnikar [ rjw: Subject and changelog edits ] Link: https://patch.msgid.link/20260126093949.8910-1-sumeet4linux@gmail.com Signed-off-by: Rafael J. Wysocki --- drivers/acpi/device_sysfs.c | 20 ++++++++++---------- drivers/acpi/sysfs.c | 30 +++++++++++++++--------------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/drivers/acpi/device_sysfs.c b/drivers/acpi/device_sysfs.c index 8cc9507b3c6d..c5434b998604 100644 --- a/drivers/acpi/device_sysfs.c +++ b/drivers/acpi/device_sysfs.c @@ -27,7 +27,7 @@ static ssize_t acpi_object_path(acpi_handle handle, char *buf) if (result) return result; - result = sprintf(buf, "%s\n", (char *)path.pointer); + result = sysfs_emit(buf, "%s\n", (char *)path.pointer); kfree(path.pointer); return result; } @@ -347,7 +347,7 @@ static ssize_t real_power_state_show(struct device *dev, if (ret) return ret; - return sprintf(buf, "%s\n", acpi_power_state_string(state)); + return sysfs_emit(buf, "%s\n", acpi_power_state_string(state)); } static DEVICE_ATTR_RO(real_power_state); @@ -357,7 +357,7 @@ static ssize_t power_state_show(struct device *dev, { struct acpi_device *adev = to_acpi_device(dev); - return sprintf(buf, "%s\n", acpi_power_state_string(adev->power.state)); + return sysfs_emit(buf, "%s\n", acpi_power_state_string(adev->power.state)); } static DEVICE_ATTR_RO(power_state); @@ -399,7 +399,7 @@ hid_show(struct device *dev, struct device_attribute *attr, char *buf) { struct acpi_device *acpi_dev = to_acpi_device(dev); - return sprintf(buf, "%s\n", acpi_device_hid(acpi_dev)); + return sysfs_emit(buf, "%s\n", acpi_device_hid(acpi_dev)); } static DEVICE_ATTR_RO(hid); @@ -435,7 +435,7 @@ static ssize_t uid_show(struct device *dev, { struct acpi_device *acpi_dev = to_acpi_device(dev); - return sprintf(buf, "%s\n", acpi_device_uid(acpi_dev)); + return sysfs_emit(buf, "%s\n", acpi_device_uid(acpi_dev)); } static DEVICE_ATTR_RO(uid); @@ -445,9 +445,9 @@ static ssize_t adr_show(struct device *dev, struct acpi_device *acpi_dev = to_acpi_device(dev); if (acpi_dev->pnp.bus_address > U32_MAX) - return sprintf(buf, "0x%016llx\n", acpi_dev->pnp.bus_address); + return sysfs_emit(buf, "0x%016llx\n", acpi_dev->pnp.bus_address); else - return sprintf(buf, "0x%08llx\n", acpi_dev->pnp.bus_address); + return sysfs_emit(buf, "0x%08llx\n", acpi_dev->pnp.bus_address); } static DEVICE_ATTR_RO(adr); @@ -509,7 +509,7 @@ sun_show(struct device *dev, struct device_attribute *attr, if (ACPI_FAILURE(status)) return -EIO; - return sprintf(buf, "%llu\n", sun); + return sysfs_emit(buf, "%llu\n", sun); } static DEVICE_ATTR_RO(sun); @@ -525,7 +525,7 @@ hrv_show(struct device *dev, struct device_attribute *attr, if (ACPI_FAILURE(status)) return -EIO; - return sprintf(buf, "%llu\n", hrv); + return sysfs_emit(buf, "%llu\n", hrv); } static DEVICE_ATTR_RO(hrv); @@ -540,7 +540,7 @@ static ssize_t status_show(struct device *dev, struct device_attribute *attr, if (ACPI_FAILURE(status)) return -EIO; - return sprintf(buf, "%llu\n", sta); + return sysfs_emit(buf, "%llu\n", sta); } static DEVICE_ATTR_RO(status); diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c index e596224302f4..1bd2f555e673 100644 --- a/drivers/acpi/sysfs.c +++ b/drivers/acpi/sysfs.c @@ -687,7 +687,7 @@ static ssize_t counter_show(struct kobject *kobj, acpi_irq_not_handled; all_counters[num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_GPE].count = acpi_gpe_count; - size = sprintf(buf, "%8u", all_counters[index].count); + size = sysfs_emit(buf, "%8u", all_counters[index].count); /* "gpe_all" or "sci" */ if (index >= num_gpes + ACPI_NUM_FIXED_EVENTS) @@ -698,29 +698,29 @@ static ssize_t counter_show(struct kobject *kobj, goto end; if (status & ACPI_EVENT_FLAG_ENABLE_SET) - size += sprintf(buf + size, " EN"); + size += sysfs_emit_at(buf, size, " EN"); else - size += sprintf(buf + size, " "); + size += sysfs_emit_at(buf, size, " "); if (status & ACPI_EVENT_FLAG_STATUS_SET) - size += sprintf(buf + size, " STS"); + size += sysfs_emit_at(buf, size, " STS"); else - size += sprintf(buf + size, " "); + size += sysfs_emit_at(buf, size, " "); if (!(status & ACPI_EVENT_FLAG_HAS_HANDLER)) - size += sprintf(buf + size, " invalid "); + size += sysfs_emit_at(buf, size, " invalid "); else if (status & ACPI_EVENT_FLAG_ENABLED) - size += sprintf(buf + size, " enabled "); + size += sysfs_emit_at(buf, size, " enabled "); else if (status & ACPI_EVENT_FLAG_WAKE_ENABLED) - size += sprintf(buf + size, " wake_enabled"); + size += sysfs_emit_at(buf, size, " wake_enabled"); else - size += sprintf(buf + size, " disabled "); + size += sysfs_emit_at(buf, size, " disabled "); if (status & ACPI_EVENT_FLAG_MASKED) - size += sprintf(buf + size, " masked "); + size += sysfs_emit_at(buf, size, " masked "); else - size += sprintf(buf + size, " unmasked"); + size += sysfs_emit_at(buf, size, " unmasked"); end: - size += sprintf(buf + size, "\n"); + size += sysfs_emit_at(buf, size, "\n"); return result ? result : size; } @@ -937,7 +937,7 @@ static void __exit interrupt_stats_exit(void) static ssize_t pm_profile_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { - return sprintf(buf, "%d\n", acpi_gbl_FADT.preferred_profile); + return sysfs_emit(buf, "%d\n", acpi_gbl_FADT.preferred_profile); } static const struct kobj_attribute pm_profile_attr = __ATTR_RO(pm_profile); @@ -946,7 +946,7 @@ static ssize_t enabled_show(struct kobject *kobj, struct kobj_attribute *attr, c { struct acpi_hotplug_profile *hotplug = to_acpi_hotplug_profile(kobj); - return sprintf(buf, "%d\n", hotplug->enabled); + return sysfs_emit(buf, "%d\n", hotplug->enabled); } static ssize_t enabled_store(struct kobject *kobj, struct kobj_attribute *attr, @@ -1000,7 +1000,7 @@ void acpi_sysfs_add_hotplug_profile(struct acpi_hotplug_profile *hotplug, static ssize_t force_remove_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { - return sprintf(buf, "%d\n", 0); + return sysfs_emit(buf, "%d\n", 0); } static ssize_t force_remove_store(struct kobject *kobj, From 229ecbaac6b31f89c554b77eb407377a5eade7d4 Mon Sep 17 00:00:00 2001 From: Jakob Riemenschneider Date: Tue, 27 Jan 2026 21:01:21 +0100 Subject: [PATCH 9/9] ACPI: x86: s2idle: Invoke Microsoft _DSM Function 9 (Turn On Display) Windows 11, version 22H2 introduced a new function index (Function 9) to the Microsoft LPS0 _DSM, titled "Turn On Display Notification". According to Microsoft documentation, this function signals to the system firmware that the OS intends to turn on the display when exiting Modern Standby. This allows the firmware to release Power Limits (PLx) earlier. Crucially, this patch fixes a functional issue observed on the Lenovo Yoga Slim 7i Aura (15ILL9), where system fans and keyboard backlights fail to resume after suspend. Investigation linked shows the EC on this device turns off these components during sleep but requires the Function 9 notification to wake them up again. This patch defines the new function index (ACPI_MS_TURN_ON_DISPLAY) and invokes it in acpi_s2idle_restore_early_lps0(). The execution order is updated to match the logic of an "intent" signal: 1. LPS0 Exit (Function 6) 2. Turn On Display Intent (Function 9) 3. Modern Standby Exit (Function 8) 4. Screen On (Function 4) Invoking Function 9 before the Modern Standby Exit ensures the firmware has time to restore power rails and functionality (like fans) before the software fully exits the sleep state. Link: https://learn.microsoft.com/en-us/windows-hardware/design/device-experiences/modern-standby-firmware-notifications#turn-on-display-notification-function-9 Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220505 Suggested-by: Antheas Kapenekakis Signed-off-by: Jakob Riemenschneider Link: https://patch.msgid.link/20260127200121.1292216-1-riemenschneiderjakob@gmail.com Signed-off-by: Rafael J. Wysocki --- drivers/acpi/x86/s2idle.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/acpi/x86/s2idle.c b/drivers/acpi/x86/s2idle.c index f97a4dff336e..b43d10f986a2 100644 --- a/drivers/acpi/x86/s2idle.c +++ b/drivers/acpi/x86/s2idle.c @@ -49,6 +49,7 @@ static const struct acpi_device_id lps0_device_ids[] = { #define ACPI_LPS0_EXIT 6 #define ACPI_LPS0_MS_ENTRY 7 #define ACPI_LPS0_MS_EXIT 8 +#define ACPI_MS_TURN_ON_DISPLAY 9 /* AMD */ #define ACPI_LPS0_DSM_UUID_AMD "e3f32452-febc-43ce-9039-932122d37721" @@ -356,6 +357,8 @@ static const char *acpi_sleep_dsm_state_to_str(unsigned int state) return "lps0 ms entry"; case ACPI_LPS0_MS_EXIT: return "lps0 ms exit"; + case ACPI_MS_TURN_ON_DISPLAY: + return "lps0 ms turn on display"; } } else { switch (state) { @@ -614,6 +617,9 @@ static void acpi_s2idle_restore_early_lps0(void) if (lps0_dsm_func_mask_microsoft > 0) { acpi_sleep_run_lps0_dsm(ACPI_LPS0_EXIT, lps0_dsm_func_mask_microsoft, lps0_dsm_guid_microsoft); + /* Intent to turn on display */ + acpi_sleep_run_lps0_dsm(ACPI_MS_TURN_ON_DISPLAY, + lps0_dsm_func_mask_microsoft, lps0_dsm_guid_microsoft); /* Modern Standby exit */ acpi_sleep_run_lps0_dsm(ACPI_LPS0_MS_EXIT, lps0_dsm_func_mask_microsoft, lps0_dsm_guid_microsoft);