Commit 1a6513de authored by Mario Limonciello's avatar Mario Limonciello Committed by Alex Deucher
Browse files

drm/amd: Move AMD_IS_APU check for ASPM into top level function



There is no need for every ASIC driver to perform the same check.
Move the duplicated code into amdgpu_device_should_use_aspm().

Signed-off-by: default avatarMario Limonciello <mario.limonciello@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent fbf1035b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1496,6 +1496,8 @@ bool amdgpu_device_should_use_aspm(struct amdgpu_device *adev)
	default:
		return false;
	}
	if (adev->flags & AMD_IS_APU)
		return false;
	return pcie_aspm_enabled(adev->pdev);
}

+0 −4
Original line number Diff line number Diff line
@@ -1709,10 +1709,6 @@ static void cik_program_aspm(struct amdgpu_device *adev)
	if (pci_is_root_bus(adev->pdev->bus))
		return;

	/* XXX double check APUs */
	if (adev->flags & AMD_IS_APU)
		return;

	orig = data = RREG32_PCIE(ixPCIE_LC_N_FTS_CNTL);
	data &= ~PCIE_LC_N_FTS_CNTL__LC_XMIT_N_FTS_MASK;
	data |= (0x24 << PCIE_LC_N_FTS_CNTL__LC_XMIT_N_FTS__SHIFT) |
+1 −2
Original line number Diff line number Diff line
@@ -516,8 +516,7 @@ static void nv_program_aspm(struct amdgpu_device *adev)
	if (!amdgpu_device_should_use_aspm(adev) || !amdgpu_device_aspm_support_quirk())
		return;

	if (!(adev->flags & AMD_IS_APU) &&
	    (adev->nbio.funcs->program_aspm))
	if (adev->nbio.funcs->program_aspm)
		adev->nbio.funcs->program_aspm(adev);

}
+0 −2
Original line number Diff line number Diff line
@@ -2440,8 +2440,6 @@ static void si_program_aspm(struct amdgpu_device *adev)
	if (!amdgpu_device_should_use_aspm(adev))
		return;

	if (adev->flags & AMD_IS_APU)
		return;
	orig = data = RREG32_PCIE_PORT(PCIE_LC_N_FTS_CNTL);
	data &= ~LC_XMIT_N_FTS_MASK;
	data |= LC_XMIT_N_FTS(0x24) | LC_XMIT_N_FTS_OVERRIDE_EN;
+1 −2
Original line number Diff line number Diff line
@@ -646,8 +646,7 @@ static void soc15_program_aspm(struct amdgpu_device *adev)
	if (!amdgpu_device_should_use_aspm(adev))
		return;

	if (!(adev->flags & AMD_IS_APU) &&
	    (adev->nbio.funcs->program_aspm))
	if (adev->nbio.funcs->program_aspm)
		adev->nbio.funcs->program_aspm(adev);
}

Loading