In the case of RAS err_event_athub, the VCPU buffers are corrupted and cannot be restored in amdgpu_vcn_resume(), the buffers are cleared to 0 for good. However, the firmware flags stored in the buffers need to be reset, or the firmware cannot work properly. Signed-off-by: Xiang Liu <xiang.liu@xxxxxxx> --- drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c index d011e4678ca1..49ef8f43e3c5 100644 --- a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c @@ -279,6 +279,8 @@ static int vcn_v4_0_3_hw_init(struct amdgpu_ip_block *ip_block) ring->sched.ready = true; } } else { + volatile struct amdgpu_vcn4_fw_shared *fw_shared; + for (i = 0; i < adev->vcn.num_vcn_inst; ++i) { vcn_inst = GET_INST(VCN, i); ring = &adev->vcn.inst[i].ring_enc[0]; @@ -303,6 +305,16 @@ static int vcn_v4_0_3_hw_init(struct amdgpu_ip_block *ip_block) regVCN_RB1_DB_CTRL); } + fw_shared = adev->vcn.inst[i].fw_shared.cpu_addr; + if (!fw_shared->sq.is_enabled) { + fw_shared->present_flag_0 = cpu_to_le32( + AMDGPU_FW_SHARED_FLAG_0_UNIFIED_QUEUE); + fw_shared->sq.is_enabled = true; + + if (amdgpu_vcnfw_log) + amdgpu_vcn_fwlog_init(&adev->vcn.inst[i]); + } + r = amdgpu_ring_test_helper(ring); if (r) return r; -- 2.34.1