diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2015-10-06 09:38:45 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-10-27 09:53:42 +0900 |
commit | b2e33f9e0ef4847f3d7c265f8adb478e7a74cb4c (patch) | |
tree | 8ff822c969fe2896bcfda20bca45af4e2d855cbd /drivers/gpu/drm/amd/amdgpu/cik.c | |
parent | 421216eb5efd68d1c6bd3e4c969f71079bd9d0af (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/cik.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/cik.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/cik.c b/drivers/gpu/drm/amd/amdgpu/cik.c index 341c56681841..519fa515c4d8 100644 --- a/drivers/gpu/drm/amd/amdgpu/cik.c +++ b/drivers/gpu/drm/amd/amdgpu/cik.c @@ -1565,6 +1565,9 @@ static void cik_pcie_gen3_enable(struct amdgpu_device *adev) int ret, i; u16 tmp16; + if (pci_is_root_bus(adev->pdev->bus)) + return; + if (amdgpu_pcie_gen2 == 0) return; |