]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amdgpu: Do not program AGP BAR regs under SRIOV in gfxhub_v1_0.c
authorVictor Lu <victorchengchi.lu@amd.com>
Thu, 13 Feb 2025 23:38:28 +0000 (18:38 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Jun 2025 12:37:01 +0000 (14:37 +0200)
[ Upstream commit 057fef20b8401110a7bc1c2fe9d804a8a0bf0d24 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c

index fad887a668866a813f28114b6753573cf64b453c..7949a87b03a84cc514ef792c7ca37c7a50168f69 100644 (file)
@@ -70,12 +70,12 @@ static void gfxhub_v1_0_init_system_aperture_regs(struct amdgpu_device *adev)
 {
        uint64_t value;
 
-       /* Program the AGP BAR */
-       WREG32_SOC15_RLC(GC, 0, mmMC_VM_AGP_BASE, 0);
-       WREG32_SOC15_RLC(GC, 0, mmMC_VM_AGP_BOT, adev->gmc.agp_start >> 24);
-       WREG32_SOC15_RLC(GC, 0, mmMC_VM_AGP_TOP, adev->gmc.agp_end >> 24);
-
        if (!amdgpu_sriov_vf(adev) || adev->asic_type <= CHIP_VEGA10) {
+               /* Program the AGP BAR */
+               WREG32_SOC15_RLC(GC, 0, mmMC_VM_AGP_BASE, 0);
+               WREG32_SOC15_RLC(GC, 0, mmMC_VM_AGP_BOT, adev->gmc.agp_start >> 24);
+               WREG32_SOC15_RLC(GC, 0, mmMC_VM_AGP_TOP, adev->gmc.agp_end >> 24);
+
                /* Program the system aperture low logical page number. */
                WREG32_SOC15_RLC(GC, 0, mmMC_VM_SYSTEM_APERTURE_LOW_ADDR,
                        min(adev->gmc.fb_start, adev->gmc.agp_start) >> 18);