From fbeca4a8414c03a1564d7a370964187be51a3e6c Mon Sep 17 00:00:00 2001 From: Mahantesh Kumbar Date: Wed, 28 Jun 2017 16:53:41 +0530 Subject: gpu: nvgpu: Falcon controller wait for halt - Added nvgpu_flcn_wait_for_halt() interface to wait for falcon halt, which block till falcon halt or timeout expire for selected falcon controller - Replaced falcon wait for halt code with method nvgpu_flcn_wait_for_halt() NVGPU JIRA-99 Change-Id: Ie1809dc29ff65bddc7ef2859a9ee9b4f0003b127 Signed-off-by: Mahantesh Kumbar Reviewed-on: https://git-master/r/1510201 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Terje Bergstrom GVS: Gerrit_Virtual_Submit Reviewed-by: Vijayakumar Subbu --- drivers/gpu/nvgpu/gp106/sec2_gp106.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'drivers/gpu/nvgpu/gp106/sec2_gp106.c') diff --git a/drivers/gpu/nvgpu/gp106/sec2_gp106.c b/drivers/gpu/nvgpu/gp106/sec2_gp106.c index 06f62a99..20171309 100644 --- a/drivers/gpu/nvgpu/gp106/sec2_gp106.c +++ b/drivers/gpu/nvgpu/gp106/sec2_gp106.c @@ -57,20 +57,9 @@ int sec2_clear_halt_interrupt_status(struct gk20a *g, unsigned int timeout) int sec2_wait_for_halt(struct gk20a *g, unsigned int timeout) { u32 data = 0; - int completion = -EBUSY; - struct nvgpu_timeout to; - - nvgpu_timeout_init(g, &to, timeout, NVGPU_TIMER_CPU_TIMER); - do { - data = gk20a_readl(g, psec_falcon_cpuctl_r()); - if (data & psec_falcon_cpuctl_halt_intr_m()) { - /*CPU is halted break*/ - completion = 0; - break; - } - nvgpu_udelay(1); - } while (!nvgpu_timeout_expired(&to)); + int completion = 0; + completion = nvgpu_flcn_wait_for_halt(&g->sec2_flcn, timeout); if (completion) { nvgpu_err(g, "ACR boot timed out"); return completion; -- cgit v1.2.2