Skip to content

Commit 43a5410

Browse files
tombagregkh
authored andcommitted
drm/tidss: Fix issue in irq handling causing irq-flood issue
commit 44b6730ab53ef04944fbaf6da0e77397531517b7 upstream. It has been observed that sometimes DSS will trigger an interrupt and the top level interrupt (DISPC_IRQSTATUS) is not zero, but the VP and VID level interrupt-statuses are zero. As the top level irqstatus is supposed to tell whether we have VP/VID interrupts, the thinking of the driver authors was that this particular case could never happen. Thus the driver only clears the DISPC_IRQSTATUS bits which has corresponding interrupts in VP/VID status. So when this issue happens, the driver will not clear DISPC_IRQSTATUS, and we get an interrupt flood. It is unclear why the issue happens. It could be a race issue in the driver, but no such race has been found. It could also be an issue with the HW. However a similar case can be easily triggered by manually writing to DISPC_IRQSTATUS_RAW. This will forcibly set a bit in the DISPC_IRQSTATUS and trigger an interrupt, and as the driver never clears the bit, we get an interrupt flood. To fix the issue, always clear DISPC_IRQSTATUS. The concern with this solution is that if the top level irqstatus is the one that triggers the interrupt, always clearing DISPC_IRQSTATUS might leave some interrupts unhandled if VP/VID interrupt statuses have bits set. However, testing shows that if any of the irqstatuses is set (i.e. even if DISPC_IRQSTATUS == 0, but a VID irqstatus has a bit set), we will get an interrupt. Co-developed-by: Bin Liu <[email protected]> Signed-off-by: Bin Liu <[email protected]> Co-developed-by: Devarsh Thakkar <[email protected]> Signed-off-by: Devarsh Thakkar <[email protected]> Co-developed-by: Jonathan Cormier <[email protected]> Signed-off-by: Jonathan Cormier <[email protected]> Fixes: 32a1795 ("drm/tidss: New driver for TI Keystone platform Display SubSystem") Cc: [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 e8af363 commit 43a5410

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

drivers/gpu/drm/tidss/tidss_dispc.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -679,24 +679,20 @@ static
679679
void dispc_k3_clear_irqstatus(struct dispc_device *dispc, dispc_irq_t clearmask)
680680
{
681681
unsigned int i;
682-
u32 top_clear = 0;
683682

684683
for (i = 0; i < dispc->feat->num_vps; ++i) {
685-
if (clearmask & DSS_IRQ_VP_MASK(i)) {
684+
if (clearmask & DSS_IRQ_VP_MASK(i))
686685
dispc_k3_vp_write_irqstatus(dispc, i, clearmask);
687-
top_clear |= BIT(i);
688-
}
689686
}
690687
for (i = 0; i < dispc->feat->num_planes; ++i) {
691-
if (clearmask & DSS_IRQ_PLANE_MASK(i)) {
688+
if (clearmask & DSS_IRQ_PLANE_MASK(i))
692689
dispc_k3_vid_write_irqstatus(dispc, i, clearmask);
693-
top_clear |= BIT(4 + i);
694-
}
695690
}
696691
if (dispc->feat->subrev == DISPC_K2G)
697692
return;
698693

699-
dispc_write(dispc, DISPC_IRQSTATUS, top_clear);
694+
/* always clear the top level irqstatus */
695+
dispc_write(dispc, DISPC_IRQSTATUS, dispc_read(dispc, DISPC_IRQSTATUS));
700696

701697
/* Flush posted writes */
702698
dispc_read(dispc, DISPC_IRQSTATUS);

0 commit comments

Comments
 (0)