Skip to content

Commit 08bb420

Browse files
stschakegregkh
authored andcommitted
drm/vc4: Account for interrupts in flight
[ Upstream commit 253696c ] 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: anholt/linux#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] Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent bdf1923 commit 08bb420

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
@@ -208,6 +208,9 @@ vc4_irq_postinstall(struct drm_device *dev)
208208
{
209209
struct vc4_dev *vc4 = to_vc4_dev(dev);
210210

211+
/* Undo the effects of a previous vc4_irq_uninstall. */
212+
enable_irq(dev->irq);
213+
211214
/* Enable both the render done and out of memory interrupts. */
212215
V3D_WRITE(V3D_INTENA, V3D_DRIVER_IRQS);
213216

@@ -225,6 +228,9 @@ vc4_irq_uninstall(struct drm_device *dev)
225228
/* Clear any pending interrupts we might have left. */
226229
V3D_WRITE(V3D_INTCTL, V3D_DRIVER_IRQS);
227230

231+
/* Finish any interrupt handler still in flight. */
232+
disable_irq(dev->irq);
233+
228234
cancel_work_sync(&vc4->overflow_mem_work);
229235
}
230236

0 commit comments

Comments
 (0)