From a06b5ff2d21718437db01d1660dbceb83605e220 Mon Sep 17 00:00:00 2001 From: Rajesh Devaraj Date: Sun, 20 Mar 2022 15:39:50 +0000 Subject: [PATCH] gpu: nvgpu: update error reporting in av+l MISC_EC is not supported in platforms like L4T. In such case, -ENODEV error code will be returned by Safety_Services. This patch updates error reporting to consider this scenario. JIRA NVGPU-8094 Bug 3366818 Bug 3491596 Change-Id: I0316571fe44418e738ae784da0584cf1040cb6cb Signed-off-by: Rajesh Devaraj Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2684283 Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-cert Reviewed-by: Dinesh T Reviewed-by: Ankur Kishore GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/os/linux/cic/cic_report_err.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/nvgpu/os/linux/cic/cic_report_err.c b/drivers/gpu/nvgpu/os/linux/cic/cic_report_err.c index 4ce110c94..4f874947c 100644 --- a/drivers/gpu/nvgpu/os/linux/cic/cic_report_err.c +++ b/drivers/gpu/nvgpu/os/linux/cic/cic_report_err.c @@ -86,12 +86,19 @@ int nvgpu_cic_mon_report_err_safety_services(struct gk20a *g, u32 err_id) * to report GPU HW errors to Safety_Services via MISC_EC interface. */ ret = epl_report_misc_ec_error(dev, MISC_EC_SW_ERR_CODE_0, err_id); - if (ret != 0) { - nvgpu_err(g, "Error reporting to Safety_Services failed"); - nvgpu_err(g, "ret (%d). err (0x%x)", ret, err_id); + if (ret == 0) { + nvgpu_err(g, "Reported err_id(0x%x) to Safety_Services", + err_id); + } else if (ret == -ENODEV) { + /** + * MISC_EC is not supported in L4T. + */ + ret = 0; + nvgpu_err(g, "Error reporting is not supported in " + "this platform"); } else { - nvgpu_err(g, "Reported err (0x%x) to Safety_Services", - err_id); + nvgpu_err(g, "Error reporting to Safety_Services failed"); + nvgpu_err(g, "ret(%d). err_id(0x%x)", ret, err_id); } #endif