summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMario Limonciello <mario.limonciello@amd.com>2026-05-30 10:16:25 +0300
committerAlex Deucher <alexander.deucher@amd.com>2026-06-03 20:47:12 +0300
commitfbace613a5a4a910956380c1cc1f49e321e3906a (patch)
tree9b8e4ce75f74f0e30291e05ed8d6811b5955fb64
parentee911514a9f8382df08181b5e90702c3284a697e (diff)
downloadlinux-fbace613a5a4a910956380c1cc1f49e321e3906a.tar.xz
drm/amd: Fix amdgpu_device_find_parent()
commit eb53125a7ad9 ("drm/amd: Add dedicated helper for amdgpu_device_find_parent()") created a dedicated helper to find the parent device outside of the dGPU but it had a logic error that caused it to walk all the way up the topology and return the wrong device. Break out of the loop when the device is found. Reviewed-by: Alexander Deucher <alexander.deucher@amd.com> Fixes: eb53125a7ad9 ("drm/amd: Add dedicated helper for amdgpu_device_find_parent()") Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_device.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 480eeb8510f8..e9a88343389c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1921,6 +1921,7 @@ static struct pci_dev *amdgpu_device_find_parent(struct amdgpu_device *adev)
while ((parent = pci_upstream_bridge(parent))) {
if (parent->vendor == PCI_VENDOR_ID_ATI)
continue;
+ break;
}
return parent;