From b6c72410bb5dd7c5e8f55e65577670545c81a5dd Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Wed, 2 Sep 2020 20:12:10 +0530 Subject: [PATCH] gpu: nvgpu: execute CTXSW ucode initialization per GR instance Move CTXSW ucode initialization to separate static API gr_init_ctxsw_falcon_support() and execute this per GR instance with nvgpu_gr_exec_with_ret_for_each_instance() Jira NVGPU-5648 Change-Id: I6e0fa72bd568eaac027bb12edcdf90255336f0a1 Signed-off-by: Deepak Nibade Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2409532 Reviewed-by: automaticguardword Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-cert Reviewed-by: Antony Clince Alex Reviewed-by: mobile promotions GVS: Gerrit_Virtual_Submit Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/gr/gr.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/nvgpu/common/gr/gr.c b/drivers/gpu/nvgpu/common/gr/gr.c index 41446208c..df62182d3 100644 --- a/drivers/gpu/nvgpu/common/gr/gr.c +++ b/drivers/gpu/nvgpu/common/gr/gr.c @@ -760,6 +760,20 @@ static int gr_init_sm_id_config_early(struct gk20a *g) } #endif +static int gr_init_ctxsw_falcon_support(struct gk20a *g) +{ + struct nvgpu_gr *gr = &g->gr[g->mig.cur_gr_instance]; + int err; + + err = nvgpu_gr_falcon_init_ctxsw(g, gr->falcon); + if (err != 0) { + gr_intr_report_ctxsw_error(g, GPU_FECS_CTXSW_INIT_ERROR, 0, 0); + return err; + } + + return 0; +} + int nvgpu_gr_init_support(struct gk20a *g) { int err = 0; @@ -788,9 +802,9 @@ int nvgpu_gr_init_support(struct gk20a *g) } #endif - err = nvgpu_gr_falcon_init_ctxsw(g, g->gr->falcon); + err = nvgpu_gr_exec_with_ret_for_each_instance(g, + gr_init_ctxsw_falcon_support(g)); if (err != 0) { - gr_intr_report_ctxsw_error(g, GPU_FECS_CTXSW_INIT_ERROR, 0, 0); return err; }