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: add RAS poison consumption handler for SRIOV

Send message to PF if VF receives RAS poison consumption interrupt.

Signed-off-by: Tao Zhou <tao.zhou1@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Tao Zhou and committed by
Alex Deucher
e643823d ae844dd7

+24 -16
+24 -16
drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c
··· 169 169 { 170 170 int ret = AMDGPU_RAS_SUCCESS; 171 171 172 - if (!adev->gmc.xgmi.connected_to_cpu) { 173 - struct ras_err_data err_data = {0, 0, 0, NULL}; 174 - struct ras_common_if head = { 175 - .block = AMDGPU_RAS_BLOCK__UMC, 176 - }; 177 - struct ras_manager *obj = amdgpu_ras_find_obj(adev, &head); 172 + if (!amdgpu_sriov_vf(adev)) { 173 + if (!adev->gmc.xgmi.connected_to_cpu) { 174 + struct ras_err_data err_data = {0, 0, 0, NULL}; 175 + struct ras_common_if head = { 176 + .block = AMDGPU_RAS_BLOCK__UMC, 177 + }; 178 + struct ras_manager *obj = amdgpu_ras_find_obj(adev, &head); 178 179 179 - ret = amdgpu_umc_do_page_retirement(adev, &err_data, NULL, reset); 180 + ret = amdgpu_umc_do_page_retirement(adev, &err_data, NULL, reset); 180 181 181 - if (ret == AMDGPU_RAS_SUCCESS && obj) { 182 - obj->err_data.ue_count += err_data.ue_count; 183 - obj->err_data.ce_count += err_data.ce_count; 182 + if (ret == AMDGPU_RAS_SUCCESS && obj) { 183 + obj->err_data.ue_count += err_data.ue_count; 184 + obj->err_data.ce_count += err_data.ce_count; 185 + } 186 + } else if (reset) { 187 + /* MCA poison handler is only responsible for GPU reset, 188 + * let MCA notifier do page retirement. 189 + */ 190 + kgd2kfd_set_sram_ecc_flag(adev->kfd.dev); 191 + amdgpu_ras_reset_gpu(adev); 184 192 } 185 - } else if (reset) { 186 - /* MCA poison handler is only responsible for GPU reset, 187 - * let MCA notifier do page retirement. 188 - */ 189 - kgd2kfd_set_sram_ecc_flag(adev->kfd.dev); 190 - amdgpu_ras_reset_gpu(adev); 193 + } else { 194 + if (adev->virt.ops && adev->virt.ops->ras_poison_handler) 195 + adev->virt.ops->ras_poison_handler(adev); 196 + else 197 + dev_warn(adev->dev, 198 + "No ras_poison_handler interface in SRIOV!\n"); 191 199 } 192 200 193 201 return ret;