drm/amdgpu: Skip using MC FB Offset when APU flag is set for SRIOV.
authorGavin Wan <Gavin.Wan@amd.com>
Mon, 3 Apr 2023 21:49:41 +0000 (17:49 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 9 Jun 2023 13:58:02 +0000 (09:58 -0400)
The MC_VM_FB_OFFSET is PF only register. It cannot be read on VF.
So, the driver should not use MC_VM_FB_OFFSET address to set the
address of dev->gmc.aper_base.

Signed-off-by: Gavin Wan <Gavin.Wan@amd.com>
Reviewed-by: Zhigang Luo <zhigang.luo@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c

index 1653d77df3ba3ddf516ce56947bd9b9a83567300..58bcd1e1f1b6ef53d26ee4817713322db696be69 100644 (file)
@@ -1644,7 +1644,8 @@ static int gmc_v9_0_mc_init(struct amdgpu_device *adev)
         */
 
        /* check whether both host-gpu and gpu-gpu xgmi links exist */
-       if (((adev->flags & AMD_IS_APU) && !amdgpu_passthrough(adev)) ||
+       if ((!amdgpu_sriov_vf(adev) &&
+               (adev->flags & AMD_IS_APU) && !amdgpu_passthrough(adev)) ||
            (adev->gmc.xgmi.supported &&
             adev->gmc.xgmi.connected_to_cpu)) {
                adev->gmc.aper_base =