Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e79d5c08 authored by Alex Deucher's avatar Alex Deucher
Browse files

drm/amdgpu: check before checking pci bridge registers



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: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
parent 26d0c21d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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;

+3 −0
Original line number Diff line number Diff line
@@ -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;