summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp106/sec2_gp106.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gp106/sec2_gp106.c')
-rw-r--r--drivers/gpu/nvgpu/gp106/sec2_gp106.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/drivers/gpu/nvgpu/gp106/sec2_gp106.c b/drivers/gpu/nvgpu/gp106/sec2_gp106.c
index 20171309..0f265710 100644
--- a/drivers/gpu/nvgpu/gp106/sec2_gp106.c
+++ b/drivers/gpu/nvgpu/gp106/sec2_gp106.c
@@ -34,24 +34,12 @@
34 34
35int sec2_clear_halt_interrupt_status(struct gk20a *g, unsigned int timeout) 35int sec2_clear_halt_interrupt_status(struct gk20a *g, unsigned int timeout)
36{ 36{
37 u32 data = 0; 37 int status = 0;
38 struct nvgpu_timeout to; 38
39 39 if (nvgpu_flcn_clear_halt_intr_status(&g->sec2_flcn, timeout))
40 nvgpu_timeout_init(g, &to, timeout, NVGPU_TIMER_CPU_TIMER); 40 status = -EBUSY;
41 do { 41
42 gk20a_writel(g, psec_falcon_irqsclr_r(), 42 return status;
43 gk20a_readl(g, psec_falcon_irqsclr_r()) | (0x10));
44 data = gk20a_readl(g, psec_falcon_irqstat_r());
45 if ((data & psec_falcon_irqstat_halt_true_f()) !=
46 psec_falcon_irqstat_halt_true_f())
47 /*halt irq is clear*/
48 break;
49 nvgpu_udelay(1);
50 } while (!nvgpu_timeout_expired(&to));
51
52 if (nvgpu_timeout_peek_expired(&to))
53 return -EBUSY;
54 return 0;
55} 43}
56 44
57int sec2_wait_for_halt(struct gk20a *g, unsigned int timeout) 45int sec2_wait_for_halt(struct gk20a *g, unsigned int timeout)