Skip to content

Commit 042eeba

Browse files
Devarsh Thakkargregkh
authored andcommitted
drm/tidss: Clear the interrupt status for interrupts being disabled
commit 361a2ebb5cad211732ec3c5d962de49b21895590 upstream. The driver does not touch the irqstatus register when it is disabling interrupts. This might cause an interrupt to trigger for an interrupt that was just disabled. To fix the issue, clear the irqstatus registers right after disabling the interrupts. Fixes: 32a1795 ("drm/tidss: New driver for TI Keystone platform Display SubSystem") Cc: [email protected] Reported-by: Jonathan Cormier <[email protected]> Closes: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1394222/am625-issue-about-tidss-rcu_preempt-self-detected-stall-on-cpu/5424479#5424479 Signed-off-by: Devarsh Thakkar <[email protected]> [Tomi: mostly rewrote the patch] Reviewed-by: Jonathan Cormier <[email protected]> Tested-by: Jonathan Cormier <[email protected]> Reviewed-by: Aradhya Bhatia <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 43a5410 commit 042eeba

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

drivers/gpu/drm/tidss/tidss_dispc.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -599,14 +599,17 @@ void dispc_k2g_set_irqenable(struct dispc_device *dispc, dispc_irq_t mask)
599599
{
600600
dispc_irq_t old_mask = dispc_k2g_read_irqenable(dispc);
601601

602-
/* clear the irqstatus for newly enabled irqs */
602+
/* clear the irqstatus for irqs that will be enabled */
603603
dispc_k2g_clear_irqstatus(dispc, (mask ^ old_mask) & mask);
604604

605605
dispc_k2g_vp_set_irqenable(dispc, 0, mask);
606606
dispc_k2g_vid_set_irqenable(dispc, 0, mask);
607607

608608
dispc_write(dispc, DISPC_IRQENABLE_SET, (1 << 0) | (1 << 7));
609609

610+
/* clear the irqstatus for irqs that were disabled */
611+
dispc_k2g_clear_irqstatus(dispc, (mask ^ old_mask) & old_mask);
612+
610613
/* flush posted write */
611614
dispc_k2g_read_irqenable(dispc);
612615
}
@@ -738,7 +741,7 @@ static void dispc_k3_set_irqenable(struct dispc_device *dispc,
738741

739742
old_mask = dispc_k3_read_irqenable(dispc);
740743

741-
/* clear the irqstatus for newly enabled irqs */
744+
/* clear the irqstatus for irqs that will be enabled */
742745
dispc_k3_clear_irqstatus(dispc, (old_mask ^ mask) & mask);
743746

744747
for (i = 0; i < dispc->feat->num_vps; ++i) {
@@ -763,6 +766,9 @@ static void dispc_k3_set_irqenable(struct dispc_device *dispc,
763766
if (main_disable)
764767
dispc_write(dispc, DISPC_IRQENABLE_CLR, main_disable);
765768

769+
/* clear the irqstatus for irqs that were disabled */
770+
dispc_k3_clear_irqstatus(dispc, (old_mask ^ mask) & old_mask);
771+
766772
/* Flush posted writes */
767773
dispc_read(dispc, DISPC_IRQENABLE_SET);
768774
}

0 commit comments

Comments
 (0)