[PATCH 2/2] drm/vc4: Ensure interrupts are disabled

From: Stefan Schake
Date: Thu Nov 09 2017 - 20:05:58 EST


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@xxxxxxxxx>
---
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