diff options
| author | Maíra Canal <mcanal@igalia.com> | 2026-09-25 16:10:19 -0300 |
|---|---|---|
| committer | Maíra Canal <mcanal@igalia.com> | 2026-10-08 16:20:06 -0300 |
| commit | 6abc8e4dcfbc1d26a94c0ac037dfb3716f686b1f (patch) | |
| tree | b721b4c7c31f55d2a856c401909df001ae0b0d67 /tools/lib/python | |
| parent | 789f290b2e81d42820bddcb4010ffbc2ae2ded54 (diff) | |
| download | linux-next-6abc8e4dcfbc1d26a94c0ac037dfb3716f686b1f.tar.gz linux-next-6abc8e4dcfbc1d26a94c0ac037dfb3716f686b1f.zip | |
drm/vc4: Disable the V3D interrupt across runtime suspend
vc4_irq_disable() masks the V3D interrupt sources and then calls
synchronize_irq() before the V3D is powered down. However, by itself,
this is not enough to quiesce the interrupt handler.
synchronize_irq() waits for handlers that have already set
IRQD_IRQ_INPROGRESS, and for irqchips reporting IRQCHIP_STATE_ACTIVE.
A GIC interrupt chip is able to mark an interrupt active as soon as a
CPU acknowledges it, so there these checks cover the whole dispatch path.
On RPi 0-3, however, the interrupt controller is ARMCTRL, which has no
active state. A CPU that has read the hwirq out of the pending register
but has not yet reached handle_level_irq() stays invisible to
synchronize_irq().
During a power transition, vc4_irq() may therefore run after the power
domain is off, where every V3D register read will return 0xdeadbeef.
0xdeadbeef has FLDONE, FRDONE and OUTOMEM set. This problem doesn't
trigger NULL pointer dereference issues only because the functions
vc4_irq_finish_bin_job() and vc4_irq_finish_render_job() return early
when there is no job pointer, but OUTOMEM is still able to schedule
vc4_overflow_mem_work() after vc4_irq_disable() has already cancelled it.
Therefore, fix the spurious interrupts by disabling the interrupt line
across the PM transition. To preserve the enable/disable balance, move
vc4_irq_install() and request the IRQ line disabled before the first
runtime resume.
Fixes: 9b6f461582e6 ("drm/vc4: v3d: Stop disabling interrupts")
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Link: https://patch.msgid.link/20260925191318.541938-1-mcanal@igalia.com
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions
