Skip to content

Commit 3c3d7db

Browse files
eladnachmanKAGA-KOKO
authored andcommitted
irqchip/mvebu-gicp: Clear pending interrupts on init
When a kexec'ed kernel boots up, there might be stale unhandled interrupts pending in the interrupt controller. These are delivered as spurious interrupts once the boot CPU enables interrupts. Clear all pending interrupts when the driver is initialized to prevent these spurious interrupts from locking the CPU in an endless loop. Signed-off-by: Elad Nachman <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/all/[email protected]
1 parent 02cbf8e commit 3c3d7db

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/irqchip/irq-mvebu-gicp.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ static int mvebu_gicp_probe(struct platform_device *pdev)
177177
.ops = &gicp_domain_ops,
178178
};
179179
struct mvebu_gicp *gicp;
180+
void __iomem *base;
180181
int ret, i;
181182

182183
gicp = devm_kzalloc(&pdev->dev, sizeof(*gicp), GFP_KERNEL);
@@ -236,6 +237,15 @@ static int mvebu_gicp_probe(struct platform_device *pdev)
236237
return -ENODEV;
237238
}
238239

240+
base = ioremap(gicp->res->start, gicp->res->end - gicp->res->start);
241+
if (IS_ERR(base)) {
242+
dev_err(&pdev->dev, "ioremap() failed. Unable to clear pending interrupts.\n");
243+
} else {
244+
for (i = 0; i < 64; i++)
245+
writel(i, base + GICP_CLRSPI_NSR_OFFSET);
246+
iounmap(base);
247+
}
248+
239249
return msi_create_parent_irq_domain(&info, &gicp_msi_parent_ops) ? 0 : -ENOMEM;
240250
}
241251

0 commit comments

Comments
 (0)