4.9-stable review patch.  If anyone has any objections, please let me know.


From: Stefan Schake <stsch...@gmail.com>

[ Upstream commit 253696ccd613fbdaa5aba1de44c461a058e0a114 ]

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/114
Signed-off-by: Stefan Schake <stsch...@gmail.com>
Fixes: d5b1a78a772f ("drm/vc4: Add support for drawing 3D frames.")
Signed-off-by: Eric Anholt <e...@anholt.net>
Reviewed-by: Eric Anholt <e...@anholt.net>
Signed-off-by: Sasha Levin <alexander.le...@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gre...@linuxfoundation.org>
 drivers/gpu/drm/vc4/vc4_irq.c |    6 ++++++
 1 file changed, 6 insertions(+)

--- a/drivers/gpu/drm/vc4/vc4_irq.c
+++ b/drivers/gpu/drm/vc4/vc4_irq.c
@@ -208,6 +208,9 @@ vc4_irq_postinstall(struct drm_device *d
        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. */
@@ -225,6 +228,9 @@ vc4_irq_uninstall(struct drm_device *dev
        /* Clear any pending interrupts we might have left. */
+       /* Finish any interrupt handler still in flight. */
+       disable_irq(dev->irq);

Reply via email to