From: Mario Limonciello Date: Wed, 20 May 2026 15:46:18 +0000 (-0500) Subject: drm/amdgpu: Adjust _PR3 detection X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=c21487ce5fa112b6faef271e4a97c5e4a8d7194c;p=thirdparty%2Flinux.git drm/amdgpu: Adjust _PR3 detection _PR3 detection was changed in commit 134b8c5d8674 ("drm/amd: Fix detection of _PR3 on the PCIe root port") to look at the root port of the topology containing the GPU. This however was too far because it ignored whether or not all the intermediary bridges could power off the device. The original design in commit b10c1c5b3a4e ("drm/amdgpu: add check for ACPI power resources") was too narrow because it matched the switches internal to the GPU. Use the goldilocks approach and look for the first bridge outside of the GPU and check for _PR3 on that device. Fixes: 134b8c5d8674 ("drm/amd: Fix detection of _PR3 on the PCIe root port") Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index e9a88343389c..d2d70c4b2ac5 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -2028,7 +2028,7 @@ static int amdgpu_device_ip_early_init(struct amdgpu_device *adev) adev->flags |= AMD_IS_PX; if (!(adev->flags & AMD_IS_APU)) { - parent = pcie_find_root_port(adev->pdev); + parent = amdgpu_device_find_parent(adev); adev->has_pr3 = parent ? pci_pr3_present(parent) : false; }