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

drm/amdgpu: switch to amdgpu_ras_late_init for nbio v7_4 (v2)

call helper function in late init phase to handle ras init
for nbio ip block

v2: init local var r to 0 in case the function return failure
on asics that don't have ras_late_init implementation

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

authored by

Hawking Zhang and committed by
Alex Deucher
22e1d14f 9ad1dc29

+12 -1
+12 -1
drivers/gpu/drm/amd/amdgpu/soc15.c
··· 1215 1215 static int soc15_common_late_init(void *handle) 1216 1216 { 1217 1217 struct amdgpu_device *adev = (struct amdgpu_device *)handle; 1218 + int r = 0; 1218 1219 1219 1220 if (amdgpu_sriov_vf(adev)) 1220 1221 xgpu_ai_mailbox_get_irq(adev); 1221 1222 1222 - return 0; 1223 + if (adev->nbio.funcs->ras_late_init) 1224 + r = adev->nbio.funcs->ras_late_init(adev); 1225 + 1226 + return r; 1223 1227 } 1224 1228 1225 1229 static int soc15_common_sw_init(void *handle) ··· 1299 1295 soc15_enable_doorbell_aperture(adev, false); 1300 1296 if (amdgpu_sriov_vf(adev)) 1301 1297 xgpu_ai_mailbox_put_irq(adev); 1298 + 1299 + if (amdgpu_ras_is_supported(adev, adev->nbio.ras_if->block)) { 1300 + if (adev->nbio.funcs->init_ras_controller_interrupt) 1301 + amdgpu_irq_put(adev, &adev->nbio.ras_controller_irq, 0); 1302 + if (adev->nbio.funcs->init_ras_err_event_athub_interrupt) 1303 + amdgpu_irq_put(adev, &adev->nbio.ras_err_event_athub_irq, 0); 1304 + } 1302 1305 1303 1306 return 0; 1304 1307 }