Skip to content

Commit cdb79ba

Browse files
stschakeTiejun Chen
authored and
Tiejun Chen
committed
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: anholt#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 a926eff commit cdb79ba

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

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

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

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

0 commit comments

Comments
 (0)