diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 8a6772c0da21..34945830abdf 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -344,6 +344,29 @@ static int gic_suspend(void) return 0; } +/* + * gic_show_pending_irq - Shows the pending interrupts + * Note: Interrupts should be disabled on the cpu from which + * this is called to get accurate list of pending interrupts. + */ +void gic_show_pending_irqs(void) +{ + void __iomem *base; + u32 pending, enabled; + unsigned int j; + + base = gic_data.dist_base; + for (j = 0; j * 32 < gic_data.irq_nr; j++) { + enabled = readl_relaxed(base + + GICD_ISENABLER + j * 4); + pending = readl_relaxed(base + + GICD_ISPENDR + j * 4); + pr_err("Pending and enabled irqs[%d] %x %x\n", j, + pending, enabled); + + } +} + static void gic_show_resume_irq(struct gic_chip_data *gic) { unsigned int i; diff --git a/include/linux/irqchip/arm-gic-v3.h b/include/linux/irqchip/arm-gic-v3.h index 1d21e98d6854..db71f25ad793 100644 --- a/include/linux/irqchip/arm-gic-v3.h +++ b/include/linux/irqchip/arm-gic-v3.h @@ -594,6 +594,7 @@ struct rdists { }; struct irq_domain; +void gic_show_pending_irqs(void); struct fwnode_handle; int its_cpu_init(void); int its_init(struct fwnode_handle *handle, struct rdists *rdists,