From 2b0e5ed3615d74afca55454decab79a381dfe5e8 Mon Sep 17 00:00:00 2001 From: sujeet baranwal Date: Tue, 11 Aug 2015 16:40:54 -0700 Subject: gpu: nvgpu: wakeup semaphores after clearing the interrupt Currently, we first invoke semaphore workqueue on all channels and then clear the interrupt This delay in clearing the interrupt can sometimes lead to dropping of new interrupt If that happens, we never invoke gk20a_channel_semaphore_wakeup() for new semaphore interrupts and semaphore waiting never completes. Fix this by moving gk20a_channel_semaphore_wakeup() after we clear the interrupt Bug 200083084 Bug 200117718 Change-Id: I7278cb378728e3799961411c4ed71d266d178a32 Signed-off-by: Deepak Nibade Signed-off-by: sujeet baranwal Reviewed-on: http://git-master/r/783175 Reviewed-by: Seshendra Gadagottu Tested-by: Seshendra Gadagottu Reviewed-by: Bharat Nihalani --- drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a') diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index 472dcc26..c36f2551 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c @@ -5612,17 +5612,17 @@ clean_up: int gk20a_gr_nonstall_isr(struct gk20a *g) { u32 gr_intr = gk20a_readl(g, gr_intr_nonstall_r()); - u32 clear_intr = 0; gk20a_dbg(gpu_dbg_intr, "pgraph nonstall intr %08x", gr_intr); if (gr_intr & gr_intr_nonstall_trap_pending_f()) { + /* Clear the interrupt */ + gk20a_writel(g, gr_intr_nonstall_r(), + gr_intr_nonstall_trap_pending_f()); + /* Wakeup all the waiting channels */ gk20a_channel_semaphore_wakeup(g); - clear_intr |= gr_intr_nonstall_trap_pending_f(); } - gk20a_writel(g, gr_intr_nonstall_r(), clear_intr); - return 0; } -- cgit v1.2.2