Skip to content

Commit bc78826

Browse files
stschakeanholt
authored andcommitted
drm/vc4: Account for interrupts in flight
Synchronously disable the IRQ to make the following cancel_work_sync invocation effective. An interrupt in flight could enqueue further overflow mem work. As we free the binner BO immediately following vc4_irq_uninstall this caused a NULL pointer dereference in the work callback vc4_overflow_mem_work. Link: #114 Signed-off-by: Stefan Schake <[email protected]> Fixes: d5b1a78 ("drm/vc4: Add support for drawing 3D frames.") Signed-off-by: Eric Anholt <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit 253696c)
1 parent e8c2100 commit bc78826

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/gpu/drm/vc4/vc4_irq.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,9 @@ vc4_irq_postinstall(struct drm_device *dev)
204204
{
205205
struct vc4_dev *vc4 = to_vc4_dev(dev);
206206

207+
/* Undo the effects of a previous vc4_irq_uninstall. */
208+
enable_irq(dev->irq);
209+
207210
/* Enable both the render done and out of memory interrupts. */
208211
V3D_WRITE(V3D_INTENA, V3D_DRIVER_IRQS);
209212

@@ -221,6 +224,9 @@ vc4_irq_uninstall(struct drm_device *dev)
221224
/* Clear any pending interrupts we might have left. */
222225
V3D_WRITE(V3D_INTCTL, V3D_DRIVER_IRQS);
223226

227+
/* Finish any interrupt handler still in flight. */
228+
disable_irq(dev->irq);
229+
224230
cancel_work_sync(&vc4->overflow_mem_work);
225231
}
226232

0 commit comments

Comments
 (0)