Skip to content

Commit c9c73a0

Browse files
chenhuacaiMarc Zyngier
authored andcommitted
irqchip/loongson-liointc: Fix misuse of gc->mask_cache
In gc->mask_cache bits, 1 means enabled and 0 means disabled, but in the loongson-liointc driver mask_cache is misused by reverting its meaning. This patch fix the bug and update the comments as well. Fixes: dbb1522 ("irqchip: Add driver for Loongson I/O Local Interrupt Controller") Signed-off-by: Huacai Chen <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Reviewed-by: Jiaxun Yang <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected]
1 parent 8fea4b2 commit c9c73a0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/irqchip/irq-loongson-liointc.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static void liointc_chained_handle_irq(struct irq_desc *desc)
6060
if (!pending) {
6161
/* Always blame LPC IRQ if we have that bug */
6262
if (handler->priv->has_lpc_irq_errata &&
63-
(handler->parent_int_map & ~gc->mask_cache &
63+
(handler->parent_int_map & gc->mask_cache &
6464
BIT(LIOINTC_ERRATA_IRQ)))
6565
pending = BIT(LIOINTC_ERRATA_IRQ);
6666
else
@@ -132,11 +132,11 @@ static void liointc_resume(struct irq_chip_generic *gc)
132132
irq_gc_lock_irqsave(gc, flags);
133133
/* Disable all at first */
134134
writel(0xffffffff, gc->reg_base + LIOINTC_REG_INTC_DISABLE);
135-
/* Revert map cache */
135+
/* Restore map cache */
136136
for (i = 0; i < LIOINTC_CHIP_IRQ; i++)
137137
writeb(priv->map_cache[i], gc->reg_base + i);
138-
/* Revert mask cache */
139-
writel(~gc->mask_cache, gc->reg_base + LIOINTC_REG_INTC_ENABLE);
138+
/* Restore mask cache */
139+
writel(gc->mask_cache, gc->reg_base + LIOINTC_REG_INTC_ENABLE);
140140
irq_gc_unlock_irqrestore(gc, flags);
141141
}
142142

@@ -244,7 +244,7 @@ int __init liointc_of_init(struct device_node *node,
244244
ct->chip.irq_mask_ack = irq_gc_mask_disable_reg;
245245
ct->chip.irq_set_type = liointc_set_type;
246246

247-
gc->mask_cache = 0xffffffff;
247+
gc->mask_cache = 0;
248248
priv->gc = gc;
249249

250250
for (i = 0; i < LIOINTC_NUM_PARENT; i++) {

0 commit comments

Comments
 (0)