From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793287453; b=Keti69F0oIz703PbqnF7HxvnKrvm6sEaoxvbXGduzj5QuPjMg4uWZqKIkpXIPsz66+Yc I8VKi0eOyYQs9wvKRN8kIE9aMzVjQNlMBIP2iu7Z1AcNYBvGsI2tDZ5QGYvxvrBsYDw/W +6NFJ5qOEu8Z5Uo0YoULvVakr/ekQhFj2UnaHypwACRhMKbzsPnwfIfQun9tu7sWfW5b1 t/+SqkXTQVt4dGASCsIhPzl0o1IBeclL+D1IVMXdAmDDJ4I4/L0FyLWEIxg9OK1FC3mLe gLmOJ33WtD7U3JRpjlYHjutx4f3ogaNtedr2yxFkFQ5STy6pwzwcN/00qxtOYLYO6iw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793287453; h=Received:DKIM-Signature:Message-ID:Date:MIME-Version:User-Agent: Subject:Content-Language:To:Cc:References:From:In-Reply-To: Content-Type:Content-Transfer-Encoding; bh=Lgd8fgwbirjHQ+5iAWJuOW0Yf9aVXUfWyvj9lr8cQT0=; b=JkRUYo4+eAb5a90M0Yc2cqSoeWj9qb35fdPdbgs8deG7qayzJT9baqyEefWodIOzlLpy FEd4T3Ezn092JH5huZDD2BEJX6dlCWDeBiU1fMTad0zH6k1lxAPuQpX7AFFGgWsJ2LE8D /B8/kZvKob9oHx+cXaaxYEm3r4D9zyz//9+xtu5zOfFTPmxXFWbBXAvbfTjwyUTC7o2oU m0UIQRPxIe4bPAT2YxS/Fz90Q1nymjNqqC7NBoIhqDGPeglA+42riTj2nQRKAmJS2QvAo 3H1mLtKrlUSdrcD7hQfeGqXt2I5OzZfO/ifzdWBJbJew+JAxc4g4Y1dqJWZzSVavboA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=kKLvXNsL; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 98D79606A31A; Thu, 29 Oct 2026 15:24:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=kKLvXNsL Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0A261F01816; Thu, 29 Oct 2026 15:24:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1793287452; bh=Lgd8fgwbirjHQ+5iAWJuOW0Yf9aVXUfWyvj9lr8cQT0=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=kKLvXNsLO+fE5J0zqkf7bh1q34h/uaracZrMOO0K3Nnd4XGSdqCb674H9nak9UqR1 f2+k+3yMnnw26oi4TIXUVgKiUAbM6rJVTtL+rQZlNQyIEAPv6BmrtA/IOtvNzIKrLf +UjYNgck5WIMGxfWcS4Bl+nnPwnuuQvYVFaYEQIVtw9CLC6o2D6+YweQUPFIN34tmw q231QBUuz9HvEfC0DE4+hsyd2wjaz+RNihWTtjKHofxaWFVsJiF5tpM4HAsR7KYGzv 1aafBlUMu0Eea93KWYMHvJ1lFokNIuf+mHx2f1r3eOGhCz+9jStDYXCF1GUoiJkeUM BjS7UdqmI3n1A== Message-ID: <8072db9e-0df4-4fc5-b86a-cc50ac7934a9@kernel.org> Date: Thu, 29 Oct 2026 10:24:08 -0500 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/2] drm/amdgpu: handle broken dGPU hotplug GPE on ASUS ROG Strix G513QY Content-Language: en-US To: Mike Lothian , amd-gfx@lists.freedesktop.org, alexander.deucher@amd.com, christian.koenig@amd.com, "Rafael J. Wysocki" Cc: dri-devel@lists.freedesktop.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org References: <20261029151422.56791-1-mike@fireburn.co.uk> <20261029151422.56791-3-mike@fireburn.co.uk> From: Mario Limonciello In-Reply-To: <20261029151422.56791-3-mike@fireburn.co.uk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit +Rafael On 10/29/26 10:14, Mike Lothian wrote: > The AMD CPM D3cold table on the G513QY (BIOS 335) handles the dGPU > hotplug GPE with: > > Method (_L05) { Notify (\_SB.PCI0.GPP0.VGA, 0x81) } > > On this board the Navi 22 sits behind its on-package PCIe switch, so > the dGPU node is \_SB.PCI0.GPP0.SWUS.SWDS.VGA_ and every hotplug on the > USB-C DP alt mode port while the dGPU is in D3cold logs: > > 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] > > The notify is lost, the dGPU stays powered off and the external > displays stay dark. Masking the GPE (acpi_mask_gpe=0x05), the usual > workaround, removes the errors but also the hotplug. > > On boards listed in a DMI table, and only when the notify target does > not resolve, install a handler for the GPE in place of the _Lxx method. > It requests a runtime resume of the dGPU, which re-detects all links and > sends a hotplug event, and re-arms the level-triggered GPE from a > delayed work so it cannot storm while the dGPU powers up. If the > firmware is fixed, or the path is supplied by an SSDT override, the > firmware method is left in charge. > > Other boards using the same CPM table may need adding to the list. > > Link: https://forum.endeavouros.com/t/boots-into-black-screen-unresponsive-amd/49430 > Assisted-by: Claude:claude-opus-5-5 > Signed-off-by: Mike Lothian Can you please post an acpidump to a kernel bugzilla or drm bug associated with this issue? This generally feels like an ACPI interpreter issue to me. > --- > drivers/gpu/drm/amd/amdgpu/amdgpu.h | 3 + > drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 103 ++++++++++++++++++++++- > 2 files changed, 105 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h > index deb63122828d..d8a7fea8be9a 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h > @@ -642,6 +642,9 @@ struct amdgpu_device { > bool accel_working; > struct notifier_block acpi_nb; > bool acpi_dgpu_notify; > + bool acpi_hpd_gpe_installed; > + u32 acpi_hpd_gpe; > + struct delayed_work acpi_hpd_gpe_work; > struct notifier_block pm_nb; > struct amdgpu_i2c_chan *i2c_bus[AMDGPU_MAX_I2C_BUS]; > struct debugfs_blob_wrapper debugfs_vbios_blob; > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c > index a4041f90b374..182791f4cc86 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c > @@ -25,6 +25,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -1297,6 +1298,103 @@ static void amdgpu_acpi_dgpu_notify(acpi_handle handle, u32 event, void *data) > pm_request_resume(adev->dev); > } > > +/* > + * Some AMD CPM D3cold tables handle the dGPU hotplug GPE with > + * Notify(\_SB.PCI0.GPP0.VGA, 0x81), but on boards where the dGPU sits behind > + * an on-package PCIe switch the node is \_SB.PCI0.GPP0.SWUS.SWDS.VGA_, so the > + * _Lxx method aborts with AE_NOT_FOUND and the dGPU is never woken. On those > + * boards take over the GPE and do what the notify would have done. > + */ > +struct amdgpu_acpi_hpd_gpe_quirk { > + const char *notify_path; > + u32 gpe; > +}; > + > +static const struct amdgpu_acpi_hpd_gpe_quirk g513qy_hpd_gpe = { > + .notify_path = "\\_SB.PCI0.GPP0.VGA", > + .gpe = 0x05, > +}; > + > +static const struct dmi_system_id amdgpu_acpi_hpd_gpe_quirks[] = { > + { > + .ident = "ASUS ROG Strix G513QY", > + .matches = { > + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), > + DMI_MATCH(DMI_BOARD_NAME, "G513QY"), > + }, > + .driver_data = (void *)&g513qy_hpd_gpe, > + }, > + {} > +}; > + > +/* GPE handlers run in interrupt context; the GPE stays disabled until the work re-arms it */ > +static u32 amdgpu_acpi_hpd_gpe_handler(acpi_handle gpe_device, u32 gpe, void *data) > +{ > + struct amdgpu_device *adev = data; > + > + pm_request_resume(adev->dev); > + schedule_delayed_work(&adev->acpi_hpd_gpe_work, msecs_to_jiffies(500)); > + > + return 0; > +} > + > +/* > + * Re-arm after a delay: the GPE is level triggered and may stay asserted > + * while the dGPU powers up, so this bounds the rate at which it refires. > + */ > +static void amdgpu_acpi_hpd_gpe_work(struct work_struct *work) > +{ > + struct amdgpu_device *adev = > + container_of(work, struct amdgpu_device, acpi_hpd_gpe_work.work); > + > + acpi_finish_gpe(NULL, adev->acpi_hpd_gpe); > +} > + > +static void amdgpu_acpi_hpd_gpe_init(struct amdgpu_device *adev) > +{ > + const struct amdgpu_acpi_hpd_gpe_quirk *quirk; > + const struct dmi_system_id *id; > + acpi_handle handle; > + > + id = dmi_first_match(amdgpu_acpi_hpd_gpe_quirks); > + if (!id) > + return; > + quirk = id->driver_data; > + > + /* Firmware (or a table override) already provides the notify target */ > + if (ACPI_SUCCESS(acpi_get_handle(NULL, quirk->notify_path, &handle))) > + return; > + > + adev->acpi_hpd_gpe = quirk->gpe; > + INIT_DELAYED_WORK(&adev->acpi_hpd_gpe_work, amdgpu_acpi_hpd_gpe_work); > + if (ACPI_FAILURE(acpi_install_gpe_handler(NULL, quirk->gpe, > + ACPI_GPE_LEVEL_TRIGGERED, > + amdgpu_acpi_hpd_gpe_handler, > + adev))) > + return; > + if (ACPI_FAILURE(acpi_enable_gpe(NULL, quirk->gpe))) { > + acpi_remove_gpe_handler(NULL, quirk->gpe, > + amdgpu_acpi_hpd_gpe_handler); > + return; > + } > + > + adev->acpi_hpd_gpe_installed = true; > + dev_info(adev->dev, "handling dGPU hotplug GPE 0x%02x (%s missing)\n", > + quirk->gpe, quirk->notify_path); > +} > + > +static void amdgpu_acpi_hpd_gpe_fini(struct amdgpu_device *adev) > +{ > + if (!adev->acpi_hpd_gpe_installed) > + return; > + > + acpi_disable_gpe(NULL, adev->acpi_hpd_gpe); > + cancel_delayed_work_sync(&adev->acpi_hpd_gpe_work); > + acpi_remove_gpe_handler(NULL, adev->acpi_hpd_gpe, > + amdgpu_acpi_hpd_gpe_handler); > + adev->acpi_hpd_gpe_installed = false; > +} > + > /* Call all ACPI methods here */ > /** > * amdgpu_acpi_init - init driver acpi support > @@ -1343,12 +1441,14 @@ int amdgpu_acpi_init(struct amdgpu_device *adev) > register_acpi_notifier(&adev->acpi_nb); > > if (!(adev->flags & AMD_IS_APU) && ACPI_COMPANION(adev->dev) && > - adev->pm.rpm_mode == AMDGPU_RUNPM_BOCO) > + adev->pm.rpm_mode == AMDGPU_RUNPM_BOCO) { > adev->acpi_dgpu_notify = > !acpi_dev_install_notify_handler(ACPI_COMPANION(adev->dev), > ACPI_DEVICE_NOTIFY, > amdgpu_acpi_dgpu_notify, > adev); > + amdgpu_acpi_hpd_gpe_init(adev); > + } > > return 0; > } > @@ -1369,6 +1469,7 @@ void amdgpu_acpi_get_backlight_caps(struct amdgpu_dm_backlight_caps *caps) > */ > void amdgpu_acpi_fini(struct amdgpu_device *adev) > { > + amdgpu_acpi_hpd_gpe_fini(adev); > if (adev->acpi_dgpu_notify) { > acpi_dev_remove_notify_handler(ACPI_COMPANION(adev->dev), > ACPI_DEVICE_NOTIFY,