Skip to contentSkip to conversation

irqchip/mvebu-gicp: clear pending irqs on init

PATCH Applied [email protected] 3 participants 4 messages Aug 3, 2025 – Aug 5, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover irqchip/mvebu-gicp: clear pending irqs on init

From: Elad Nachman <[email protected]>

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.

v2:
1) rewrap commit message

2) don't keep remap, unmap register space after clearing pending irqs

3) fix code styling

Elad Nachman (1):
irqchip/mvebu-gicp: clear pending irqs on init

 drivers/irqchip/irq-mvebu-gicp.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
Signature · 1 line
2.25.1
#1 lore raw

PATCH v2 1/1 irqchip/mvebu-gicp: clear pending irqs on init

From: Elad Nachman <[email protected]>

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.

---
 drivers/irqchip/irq-mvebu-gicp.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/irqchip/irq-mvebu-gicp.c +10 -0
index d3232d6d8dce..4b2cad09bc71 100644
@@ -178,6 +178,7 @@ static int mvebu_gicp_probe(struct platform_device *pdev)
 	};
 	struct mvebu_gicp *gicp;
 	int ret, i;
+	void __iomem *base;
 
 	gicp = devm_kzalloc(&pdev->dev, sizeof(*gicp), GFP_KERNEL);
 	if (!gicp)
@@ -236,6 +237,15 @@ static int mvebu_gicp_probe(struct platform_device *pdev)
 		return -ENODEV;
 	}
 
+	base = ioremap(gicp->res->start, gicp->res->end - gicp->res->start);
+	if (IS_ERR(base)) {
+		dev_err(&pdev->dev, "ioremap() failed. Unable to clear pending interrupts.\n");
+	} else {
+		for (i = 0; i < 64; i++)
+			writel(i, base + GICP_CLRSPI_NSR_OFFSET);
+		iounmap(base);
+	}
+
 	return msi_create_parent_irq_domain(&info, &gicp_msi_parent_ops) ? 0 : -ENOMEM;
 }
 
Signature · 1 line
2.25.1
merge bot Applied
#2 lore raw

[tip: irq/urgent] irqchip/mvebu-gicp: Clear pending interrupts on init

The following commit has been merged into the irq/urgent branch of tip:

The following commit has been merged into the irq/urgent branch of tip:

Commit-ID:     3c3d7dbab2c70a4bca47634d564bf659351c05ca
Gitweb:        https://git.kernel.org/tip/3c3d7dbab2c70a4bca47634d564bf659351c05ca
Author:        Elad Nachman <[email protected]>
AuthorDate:    Sun, 03 Aug 2025 13:25:48 +03:00
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Tue, 05 Aug 2025 10:35:03 +02:00

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.

---
 drivers/irqchip/irq-mvebu-gicp.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/irqchip/irq-mvebu-gicp.c +10 -0
index d3232d6..fd85c84 100644
@@ -177,6 +177,7 @@ static int mvebu_gicp_probe(struct platform_device *pdev)
 		.ops	= &gicp_domain_ops,
 	};
 	struct mvebu_gicp *gicp;
+	void __iomem *base;
 	int ret, i;
 
 	gicp = devm_kzalloc(&pdev->dev, sizeof(*gicp), GFP_KERNEL);
@@ -236,6 +237,15 @@ static int mvebu_gicp_probe(struct platform_device *pdev)
 		return -ENODEV;
 	}
 
+	base = ioremap(gicp->res->start, gicp->res->end - gicp->res->start);
+	if (IS_ERR(base)) {
+		dev_err(&pdev->dev, "ioremap() failed. Unable to clear pending interrupts.\n");
+	} else {
+		for (i = 0; i < 64; i++)
+			writel(i, base + GICP_CLRSPI_NSR_OFFSET);
+		iounmap(base);
+	}
+
 	return msi_create_parent_irq_domain(&info, &gicp_msi_parent_ops) ? 0 : -ENOMEM;
 }