From a8581f02834477864bd1ef5b1c3e6f2150d01b79 Mon Sep 17 00:00:00 2001 From: Dinesh Kamalakannan Date: Wed, 8 Mar 2023 14:03:24 +0530 Subject: [PATCH] gpu: nvgpu: mailbox dump before reporting to SDL In case of ACR Bootstrap failure, print the mailbox values for the error code, before reporting the error to Safety Service. In some cases, once the error is reported to SDL, only the nvgpu_sw_quiesce debugs are there in sloginfo. Bug 3960710 Signed-off-by: Dinesh Kamalakannan Change-Id: Ib72bb4280cc80b39c5fb2e57f26c7b0e9ab6a4ad Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2867592 Reviewed-by: Mahantesh Kumbar Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-misra Reviewed-by: svc-mobile-cert GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/common/acr/acr_bootstrap.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/nvgpu/common/acr/acr_bootstrap.c b/drivers/gpu/nvgpu/common/acr/acr_bootstrap.c index eaffcd2ef..9fad1e404 100644 --- a/drivers/gpu/nvgpu/common/acr/acr_bootstrap.c +++ b/drivers/gpu/nvgpu/common/acr/acr_bootstrap.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2022, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -137,14 +137,16 @@ int nvgpu_acr_wait_for_completion(struct gk20a *g, struct hs_acr *acr_desc, data = nvgpu_falcon_mailbox_read(acr_desc->acr_flcn, FALCON_MAILBOX_0); if (data != 0U) { error_type = nvgpu_falcon_mailbox_read(acr_desc->acr_flcn, FALCON_MAILBOX_1); - if (nvgpu_is_enabled(g, NVGPU_ACR_NEXT_CORE_ENABLED)) { - acr_report_error_to_sdl(g, data, error_type); - } nvgpu_err(g, "flcn-%d: HS ucode boot failed, err %x", flcn_id, data); nvgpu_err(g, "flcn-%d: Mailbox-1 : 0x%x", flcn_id, nvgpu_falcon_mailbox_read(acr_desc->acr_flcn, FALCON_MAILBOX_1)); + + if (nvgpu_is_enabled(g, NVGPU_ACR_NEXT_CORE_ENABLED)) { + acr_report_error_to_sdl(g, data, error_type); + } + completion = -EAGAIN; error_type = ACR_BOOT_FAILED; goto exit;