From a46abe4d64df9210db8149736dad8d8fddeeb9ed Mon Sep 17 00:00:00 2001 From: smadhavan Date: Tue, 21 Jan 2020 15:03:57 +0530 Subject: [PATCH] gpu: nvgpu: Reduce ACR timeout wait to 100msec 10s wait for ACR timeout is longer than time allowed for entire GPU boot sequence. Hence we need to reduce it. This patch reduces ACR timeout wait period to 100msec for silicon platforms and retains the existing 10s for non silicon. JIRA NVGPU-4898 Change-Id: I29e58b34f09ed595336bf833ed6db13553794827 Signed-off-by: smadhavan Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2282857 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-misra Reviewed-by: svc-mobile-cert Reviewed-by: Vijayakumar Subbu Reviewed-by: mobile promotions GVS: Gerrit_Virtual_Submit Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/acr/acr_bootstrap.c | 10 +++++++++- drivers/gpu/nvgpu/common/acr/acr_priv.h | 5 +++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/nvgpu/common/acr/acr_bootstrap.c b/drivers/gpu/nvgpu/common/acr/acr_bootstrap.c index 7c42772a0..70c65593e 100644 --- a/drivers/gpu/nvgpu/common/acr/acr_bootstrap.c +++ b/drivers/gpu/nvgpu/common/acr/acr_bootstrap.c @@ -30,6 +30,7 @@ #include #include #include +#include #include "acr_bootstrap.h" #include "acr_priv.h" @@ -201,7 +202,14 @@ int nvgpu_acr_bootstrap_hs_ucode(struct gk20a *g, struct nvgpu_acr *acr, } /* wait for complete & halt */ - err = acr_wait_for_completion(g, acr_desc, ACR_COMPLETION_TIMEOUT_MS); + if (nvgpu_platform_is_silicon(g)) { + err = acr_wait_for_completion(g, acr_desc, + ACR_COMPLETION_TIMEOUT_SILICON_MS); + } else { + err = acr_wait_for_completion(g, acr_desc, + ACR_COMPLETION_TIMEOUT_NON_SILICON_MS); + } + if (err != 0) { nvgpu_err(g, "HS ucode completion err %d", err); goto err_free_ucode; diff --git a/drivers/gpu/nvgpu/common/acr/acr_priv.h b/drivers/gpu/nvgpu/common/acr/acr_priv.h index 90031810c..dca36a4cb 100644 --- a/drivers/gpu/nvgpu/common/acr/acr_priv.h +++ b/drivers/gpu/nvgpu/common/acr/acr_priv.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2019-2020, 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"), @@ -97,7 +97,8 @@ struct wpr_carveout_info; #define LSF_SEC2_UCODE_DESC_FUSA_BIN "sec2_ucode_fusa_desc.bin" #define LSF_SEC2_UCODE_SIG_FUSA_BIN "sec2_fusa_sig.bin" -#define ACR_COMPLETION_TIMEOUT_MS 10000U /*in msec */ +#define ACR_COMPLETION_TIMEOUT_NON_SILICON_MS 10000U /*in msec */ +#define ACR_COMPLETION_TIMEOUT_SILICON_MS 100 /*in msec */ struct acr_lsf_config { u32 falcon_id;