Skip to content

Commit

Permalink
MIPS: SNI: Fix spurious interrupts
Browse files Browse the repository at this point in the history
[ Upstream commit b959b97860d0fee8c8f6a3e641d3c2ad76eab6be ]

On A20R machines the interrupt pending bits in cause register need to be
updated by requesting the chipset to do it. This needs to be done to
find the interrupt cause and after interrupt service. In
commit 0b888c7 ("MIPS: SNI: Convert to new irq_chip functions") the
function to do after service update got lost, which caused spurious
interrupts.

Fixes: 0b888c7 ("MIPS: SNI: Convert to new irq_chip functions")
Signed-off-by: Thomas Bogendoerfer <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
tsbogend authored and gregkh committed Sep 23, 2020
1 parent f9300df commit ca070bb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions arch/mips/sni/a20r.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,10 @@ static struct platform_device sc26xx_pdev = {
},
};

static u32 a20r_ack_hwint(void)
/*
* Trigger chipset to update CPU's CAUSE IP field
*/
static u32 a20r_update_cause_ip(void)
{
u32 status = read_c0_status();

Expand Down Expand Up @@ -205,12 +208,14 @@ static void a20r_hwint(void)
int irq;

clear_c0_status(IE_IRQ0);
status = a20r_ack_hwint();
status = a20r_update_cause_ip();
cause = read_c0_cause();

irq = ffs(((cause & status) >> 8) & 0xf8);
if (likely(irq > 0))
do_IRQ(SNI_A20R_IRQ_BASE + irq - 1);

a20r_update_cause_ip();
set_c0_status(IE_IRQ0);
}

Expand Down

0 comments on commit ca070bb

Please sign in to comment.