Commit 253696cc authored by Stefan Schake's avatar Stefan Schake Committed by Eric Anholt

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: https://github.com/anholt/linux/issues/114Signed-off-by: default avatarStefan Schake <stschake@gmail.com>
Fixes: d5b1a78a ("drm/vc4: Add support for drawing 3D frames.")
Signed-off-by: default avatarEric Anholt <eric@anholt.net>
Reviewed-by: default avatarEric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/1510275907-993-2-git-send-email-stschake@gmail.com
parent 44419ce7
...@@ -208,6 +208,9 @@ vc4_irq_postinstall(struct drm_device *dev) ...@@ -208,6 +208,9 @@ vc4_irq_postinstall(struct drm_device *dev)
{ {
struct vc4_dev *vc4 = to_vc4_dev(dev); struct vc4_dev *vc4 = to_vc4_dev(dev);
/* Undo the effects of a previous vc4_irq_uninstall. */
enable_irq(dev->irq);
/* Enable both the render done and out of memory interrupts. */ /* Enable both the render done and out of memory interrupts. */
V3D_WRITE(V3D_INTENA, V3D_DRIVER_IRQS); V3D_WRITE(V3D_INTENA, V3D_DRIVER_IRQS);
...@@ -225,6 +228,9 @@ vc4_irq_uninstall(struct drm_device *dev) ...@@ -225,6 +228,9 @@ vc4_irq_uninstall(struct drm_device *dev)
/* Clear any pending interrupts we might have left. */ /* Clear any pending interrupts we might have left. */
V3D_WRITE(V3D_INTCTL, V3D_DRIVER_IRQS); V3D_WRITE(V3D_INTCTL, V3D_DRIVER_IRQS);
/* Finish any interrupt handler still in flight. */
disable_irq(dev->irq);
cancel_work_sync(&vc4->overflow_mem_work); cancel_work_sync(&vc4->overflow_mem_work);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment