lkml.org 
[lkml]   [2017]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] drm/vc4: Ensure interrupts are disabled
Date
The overflow mem work callback vc4_overflow_mem_work reenables its
associated interrupt upon completion. To ensure all interrupts are disabled
when we return from vc4_irq_uninstall, we need to disable it again if
cancel_work_sync indicated pending work.

Signed-off-by: Stefan Schake <stschake@gmail.com>
---
drivers/gpu/drm/vc4/vc4_irq.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/vc4/vc4_irq.c b/drivers/gpu/drm/vc4/vc4_irq.c
index 61b2e53..7d780149d 100644
--- a/drivers/gpu/drm/vc4/vc4_irq.c
+++ b/drivers/gpu/drm/vc4/vc4_irq.c
@@ -231,7 +231,14 @@
/* Finish any interrupt handler still in flight. */
disable_irq(dev->irq);

- cancel_work_sync(&vc4->overflow_mem_work);
+ if (cancel_work_sync(&vc4->overflow_mem_work)) {
+ /*
+ * Work was still pending. The overflow mem work's
+ * callback reenables the OUTOMEM interrupt upon
+ * completion, so ensure it is disabled here.
+ */
+ V3D_WRITE(V3D_INTDIS, V3D_INT_OUTOMEM);
+ }
}

/** Reinitializes interrupt registers when a GPU reset is performed. */
--
1.9.1
\
 
 \ /
  Last update: 2017-11-10 02:06    [W:0.298 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site