summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/vi.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2015-10-06 09:38:45 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-10-27 09:53:42 +0900
commitb2e33f9e0ef4847f3d7c265f8adb478e7a74cb4c (patch)
tree8ff822c969fe2896bcfda20bca45af4e2d855cbd /drivers/gpu/drm/amd/amdgpu/vi.c
parent421216eb5efd68d1c6bd3e4c969f71079bd9d0af (diff)
drm/amdgpu: check before checking pci bridge registers
commit e79d5c0870eedce94e5f5a2ffab30511e48fa144 upstream. Make sure we are not the root device before attempting to read the pcie bridge registers to check the pcie gen speeed. Fixes a crash when the device is passed through to a VM. Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/vi.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/vi.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c
index 4f58a1e18de6..9ffa56cebdbc 100644
--- a/drivers/gpu/drm/amd/amdgpu/vi.c
+++ b/drivers/gpu/drm/amd/amdgpu/vi.c
@@ -968,6 +968,9 @@ static void vi_pcie_gen3_enable(struct amdgpu_device *adev)
u32 mask;
int ret;
+ if (pci_is_root_bus(adev->pdev->bus))
+ return;
+
if (amdgpu_pcie_gen2 == 0)
return;