Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu: Do not program AGP BAR regs under SRIOV in gfxhub_v1_0.c

SRIOV VF does not have write access to AGP BAR regs.
Skip the writes to avoid a dmesg warning.

Signed-off-by: Victor Lu <victorchengchi.lu@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Victor Lu and committed by
Alex Deucher
057fef20 20c34e5c

+5 -5
+5 -5
drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c
··· 92 92 { 93 93 uint64_t value; 94 94 95 - /* Program the AGP BAR */ 96 - WREG32_SOC15_RLC(GC, 0, mmMC_VM_AGP_BASE, 0); 97 - WREG32_SOC15_RLC(GC, 0, mmMC_VM_AGP_BOT, adev->gmc.agp_start >> 24); 98 - WREG32_SOC15_RLC(GC, 0, mmMC_VM_AGP_TOP, adev->gmc.agp_end >> 24); 99 - 100 95 if (!amdgpu_sriov_vf(adev) || adev->asic_type <= CHIP_VEGA10) { 96 + /* Program the AGP BAR */ 97 + WREG32_SOC15_RLC(GC, 0, mmMC_VM_AGP_BASE, 0); 98 + WREG32_SOC15_RLC(GC, 0, mmMC_VM_AGP_BOT, adev->gmc.agp_start >> 24); 99 + WREG32_SOC15_RLC(GC, 0, mmMC_VM_AGP_TOP, adev->gmc.agp_end >> 24); 100 + 101 101 /* Program the system aperture low logical page number. */ 102 102 WREG32_SOC15_RLC(GC, 0, mmMC_VM_SYSTEM_APERTURE_LOW_ADDR, 103 103 min(adev->gmc.fb_start, adev->gmc.agp_start) >> 18);