Skip to content

Commit

Permalink
irqchip/loongson-htvec: Fix initial interrupt clearing
Browse files Browse the repository at this point in the history
commit 1d1e563 upstream.

In htvec_reset() only the first group of initial interrupts is cleared.
This sometimes causes spurious interrupts, so let's clear all groups.

While at it, fix the nearby comment that to match the reality of what
the driver does.

Fixes: 818e915 ("irqchip: Add Loongson HyperTransport Vector support")
Signed-off-by: Huacai Chen <chenhc@lemote.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/1599819978-13999-2-git-send-email-chenhc@lemote.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
chenhuacai authored and gregkh committed Nov 5, 2020
1 parent ccd11d1 commit be4e2dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/irqchip/irq-loongson-htvec.c
Expand Up @@ -151,7 +151,7 @@ static void htvec_reset(struct htvec *priv)
/* Clear IRQ cause registers, mask all interrupts */
for (idx = 0; idx < priv->num_parents; idx++) {
writel_relaxed(0x0, priv->base + HTVEC_EN_OFF + 4 * idx);
writel_relaxed(0xFFFFFFFF, priv->base);
writel_relaxed(0xFFFFFFFF, priv->base + 4 * idx);
}
}

Expand All @@ -172,7 +172,7 @@ static int htvec_of_init(struct device_node *node,
goto free_priv;
}

/* Interrupt may come from any of the 4 interrupt line */
/* Interrupt may come from any of the 8 interrupt lines */
for (i = 0; i < HTVEC_MAX_PARENT_IRQ; i++) {
parent_irq[i] = irq_of_parse_and_map(node, i);
if (parent_irq[i] <= 0)
Expand Down

0 comments on commit be4e2dc

Please sign in to comment.