drm/amd/amdgpu: SRIOV full reset issue with VCN
authorBokun Zhang <bokun.zhang@amd.com>
Thu, 30 Nov 2023 00:11:22 +0000 (19:11 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 6 Dec 2023 20:22:37 +0000 (15:22 -0500)
- After a full reset, VF's FB will be cleaned. This
  includes the VCN's fw_shared memory.

  However, there is no suspend-resume routine for
  SRIOV VF. Therefore, the data in the fw_shared
  memory will be lost forever and it causes engine
  hang later on.

  We must repopulate the data in fw_shared during
  SRIOV hw_init

Signed-off-by: Bokun Zhang <bokun.zhang@amd.com>
Reviewed-by: Emily Deng <Emily.Deng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c

index 28b7f96b42e5982c179587776a234697fa90bba8..169ed400ee7b7413263ab48a2de1e75aa3ed00f7 100644 (file)
@@ -1280,6 +1280,9 @@ static int vcn_v4_0_start_sriov(struct amdgpu_device *adev)
                if (adev->vcn.harvest_config & (1 << i))
                        continue;
 
+               // Must re/init fw_shared at beginning
+               vcn_v4_0_fw_shared_init(adev, i);
+
                table_size = 0;
 
                MMSCH_V4_0_INSERT_DIRECT_RD_MOD_WT(SOC15_REG_OFFSET(VCN, i,