Skip to content

Commit

Permalink
drm/amdgpu: check before checking pci bridge registers
Browse files Browse the repository at this point in the history
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>
Cc: stable@vger.kernel.org
  • Loading branch information
Alex Deucher committed Oct 6, 2015
1 parent 26d0c21 commit e79d5c0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/gpu/drm/amd/amdgpu/cik.c
Original file line number Diff line number Diff line change
Expand Up @@ -1567,6 +1567,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;

Expand Down
3 changes: 3 additions & 0 deletions drivers/gpu/drm/amd/amdgpu/vi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,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;

Expand Down

0 comments on commit e79d5c0

Please sign in to comment.