mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
gpu: nvgpu: gsp: add cmdq/msgq init check
- Instead of waiting for mailbox update waiting for cmdq/msgq initialization request would be the better way to check the communication between NVGPU and GSP before sending any cmd. NVGPU-7342 Signed-off-by: Ramesh Mylavarapu <rmylavarapu@nvidia.com> Change-Id: I6d20764516cee14ad84da7cc9a06c9370675786f Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2650148 Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
e5fd0453cf
commit
6c1a77dfa9
@@ -91,6 +91,28 @@ void nvgpu_gsp_sched_sw_deinit(struct gk20a *g)
|
||||
}
|
||||
}
|
||||
|
||||
static int gsp_sched_wait_for_init(struct gk20a *g,
|
||||
struct nvgpu_gsp_sched *gsp_sched, signed int timeoutms)
|
||||
{
|
||||
nvgpu_log_fn(g, " ");
|
||||
|
||||
do {
|
||||
if (gsp_sched->gsp_ready) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (timeoutms <= 0) {
|
||||
nvgpu_err(g, "gsp wait for init timedout");
|
||||
return -1;
|
||||
}
|
||||
|
||||
nvgpu_msleep(10);
|
||||
timeoutms -= 10;
|
||||
} while (true);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nvgpu_gsp_sched_sw_init(struct gk20a *g)
|
||||
{
|
||||
int err = 0;
|
||||
@@ -177,6 +199,12 @@ int nvgpu_gsp_sched_bootstrap_ns(struct gk20a *g)
|
||||
goto de_init;
|
||||
}
|
||||
|
||||
status = gsp_sched_wait_for_init(g, gsp_sched, GSP_WAIT_TIME_MS);
|
||||
if (status != 0) {
|
||||
nvgpu_err(g, "gsp wait for basic init failed ");
|
||||
goto de_init;
|
||||
}
|
||||
|
||||
return status;
|
||||
de_init:
|
||||
nvgpu_gsp_sched_sw_deinit(g);
|
||||
|
||||
Reference in New Issue
Block a user