Skip to contentSkip to conversation

ACPI: x86: Work around AMD CPM _L05 notifying a missing dGPU on ASUS G513QY

PATCH New Mario Limonciello 1 participant 1 message Nov 22 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ACPI: x86: Work around AMD CPM _L05 notifying a missing dGPU on ASUS G513QY

The AMD CPM D3cold SSDT (OEM table ID "CPMD3CLD") on the ASUS ROG Strix G513QY (BIOS G513QY.335) handles the dGPU hotplug GPE with:

Scope (\_GPE) { Method (_L05) { Notify (\_SB.PCI0.GPP0.VGA, 0x81) } }

On this board the Navi 22 sits behind an on-package PCIe switch and is \_SB.PCI0.GPP0.SWUS.SWDS.VGA; \_SB.PCI0.GPP0.VGA is not defined by any table. The interpreter correctly aborts the method:

ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.GPP0.VGA], AE_NOT_FOUND ACPI Error: Aborting method \_GPE._L05 due to previous error (AE_NOT_FOUND) ACPI Error: AE_NOT_FOUND, while evaluating GPE method [_L05]

so the Notify is lost and a dGPU in D3cold is never woken for the hotplug. Other firmware on the same board (the _L00 handler and the ATIF dispatchers) guards both the GPP0.VGA and GPP0.SWUS.SWDS.VGA paths with CondRefOf(), so only this method was missed.

Aliasing the missing name is not an option: those guarded branches would then both resolve and dispatch to the dGPU twice. Instead, load a small built-in SSDT with a method that notifies the real node and replace _L05 with a GPE handler that runs it. The handler defers to a workqueue, as AML can't run in interrupt context, and re-arms the level-triggered GPE behind the notify queue as ACPICA does for _Lxx methods.

Match the DMI for the G513QY and introduce a new quirk behind a new ACPI_AML_QUIRKS option.

---
 drivers/acpi/Kconfig          |  16 +++++
 drivers/acpi/x86/Makefile     |   1 +
 drivers/acpi/x86/cpm_d3cold.c | 161 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 178 insertions(+)
drivers/acpi/Kconfig +16 -0
index fa3eb52b22cd8..70a8d3c79a1b5 100644
@@ -393,6 +393,22 @@ config ACPI_TABLE_OVERRIDE_VIA_BUILTIN_INITRD
 
 	  See Documentation/admin-guide/acpi/initrd_table_override.rst for details
 
+config ACPI_AML_QUIRKS
+	bool "Workarounds for known AML bugs in system firmware"
+	depends on X86
+	help
+	  Some systems ship AML that cannot work as written, for example a
+	  method that notifies a device which does not exist in the namespace.
+	  This option builds workarounds for such firmware bugs. Each one is
+	  enabled only on the specific systems it is known to be needed on
+	  (matched by DMI), and loads small built-in tables and/or takes over
+	  an ACPI event from the firmware's own method on those systems.
+
+	  Currently this covers the AMD CPM D3cold dGPU hotplug GPE on the
+	  ASUS ROG Strix G513QY.
+
+	  Systems that are not on the list are unaffected. If unsure, say N.
+
 config ACPI_DEBUG
 	bool "Debug Statements"
 	default y
drivers/acpi/x86/Makefile +1 -0
index 63c99509ed9de..04c2c7ffc3a1c 100644
@@ -4,5 +4,6 @@ acpi-x86-y		+= cmos_rtc.o
 acpi-x86-$(CONFIG_PCI)	+= lpss.o
 acpi-x86-y		+= s2idle.o
 acpi-x86-y		+= utils.o
+acpi-x86-$(CONFIG_ACPI_AML_QUIRKS) += cpm_d3cold.o
 
 obj-$(CONFIG_X86)	+= blacklist.o
drivers/acpi/x86/cpm_d3cold.c new file +161 -0

161 lines not on this page · raw message

---
base-commit: aebb7274476403040d582c61478df8f4a7bf9cd3
change-id: 20261122-fdo-gitlab-6061-d6cbed847dbc

Best regards,

Signature · 1 line
Mario Limonciello <[email protected]>