drm/vc4: v3d: Stop disabling interrupts
authorMaxime Ripard <maxime@cerno.tech>
Mon, 11 Jul 2022 17:39:37 +0000 (19:39 +0200)
committerMaxime Ripard <maxime@cerno.tech>
Wed, 13 Jul 2022 08:46:13 +0000 (10:46 +0200)
The vc4_irq_disable(), among other things, will call disable_irq() to
complete any in-flight interrupts.

This requires its counterpart, vc4_irq_enable(), to call enable_irq() which
causes issues addressed in a later patch.

However, vc4_irq_disable() is called by two callees: vc4_irq_uninstall()
and vc4_v3d_runtime_suspend().

vc4_irq_uninstall() also calls free_irq() which already disables the
interrupt line. We thus don't require an explicit disable_irq() for that
call site.

vc4_v3d_runtime_suspend() doesn't have any other code. However, the rest of
vc4_irq_disable() masks the interrupts coming from the v3d, so explictly
disabling the interrupt line is also redundant.

The only thing we really care about is thus to make sure we don't have any
handler in-flight, as suggested by the comment. We can thus replace
disable_irq() by synchronize_irq().

Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://lore.kernel.org/r/20220711173939.1132294-68-maxime@cerno.tech
drivers/gpu/drm/vc4/vc4_irq.c
drivers/gpu/drm/vc4/vc4_v3d.c

index 2eacfb6773d28600608589b0264ac63b03c25178..a9fc63d9a7f0685843c064299050118ec26de2b9 100644 (file)
@@ -295,7 +295,7 @@ vc4_irq_disable(struct drm_device *dev)
        V3D_WRITE(V3D_INTCTL, V3D_DRIVER_IRQS);
 
        /* Finish any interrupt handler still in flight. */
-       disable_irq(vc4->irq);
+       synchronize_irq(vc4->irq);
 
        cancel_work_sync(&vc4->overflow_mem_work);
 }
index e7990bed0a96ca4b6fdce4c0d932b8f62de29150..a2da0db73a5ca73bc06f63907e98e9aad6b7cc01 100644 (file)
@@ -393,8 +393,6 @@ static int vc4_v3d_runtime_resume(struct device *dev)
 
        vc4_v3d_init_hw(&vc4->base);
 
-       /* We disabled the IRQ as part of vc4_irq_uninstall in suspend. */
-       enable_irq(vc4->irq);
        vc4_irq_enable(&vc4->base);
 
        return 0;