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

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdgpu: Reinit FW shared flags on VCN v5.0.1

After a full device reset, shared memory region will clear out and it's
not possible to reliably save the region in case of RAS errors.
Reinitialize the flags if required.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Lijo Lazar and committed by
Alex Deucher
6ef5ccaa 6e094020

+20 -8
+20 -8
drivers/gpu/drm/amd/amdgpu/vcn_v5_0_1.c
··· 76 76 return 0; 77 77 } 78 78 79 + static void vcn_v5_0_1_fw_shared_init(struct amdgpu_device *adev, int inst_idx) 80 + { 81 + struct amdgpu_vcn5_fw_shared *fw_shared; 82 + 83 + fw_shared = adev->vcn.inst[inst_idx].fw_shared.cpu_addr; 84 + 85 + if (fw_shared->sq.is_enabled) 86 + return; 87 + fw_shared->present_flag_0 = 88 + cpu_to_le32(AMDGPU_FW_SHARED_FLAG_0_UNIFIED_QUEUE); 89 + fw_shared->sq.is_enabled = 1; 90 + 91 + if (amdgpu_vcnfw_log) 92 + amdgpu_vcn_fwlog_init(&adev->vcn.inst[inst_idx]); 93 + } 94 + 79 95 /** 80 96 * vcn_v5_0_1_sw_init - sw init for VCN block 81 97 * ··· 112 96 return r; 113 97 114 98 for (i = 0; i < adev->vcn.num_vcn_inst; i++) { 115 - volatile struct amdgpu_vcn5_fw_shared *fw_shared; 116 - 117 99 vcn_inst = GET_INST(VCN, i); 118 100 119 101 r = amdgpu_vcn_sw_init(adev, i); ··· 136 122 if (r) 137 123 return r; 138 124 139 - fw_shared = adev->vcn.inst[i].fw_shared.cpu_addr; 140 - fw_shared->present_flag_0 = cpu_to_le32(AMDGPU_FW_SHARED_FLAG_0_UNIFIED_QUEUE); 141 - fw_shared->sq.is_enabled = true; 142 - 143 - if (amdgpu_vcnfw_log) 144 - amdgpu_vcn_fwlog_init(&adev->vcn.inst[i]); 125 + vcn_v5_0_1_fw_shared_init(adev, i); 145 126 } 146 127 147 128 /* TODO: Add queue reset mask when FW fully supports it */ ··· 215 206 ((adev->doorbell_index.vcn.vcn_ring0_1 << 1) + 216 207 9 * vcn_inst), 217 208 adev->vcn.inst[i].aid_id); 209 + 210 + /* Re-init fw_shared, if required */ 211 + vcn_v5_0_1_fw_shared_init(adev, i); 218 212 219 213 r = amdgpu_ring_test_helper(ring); 220 214 if (r)