OSDN Git Service

GIC: Show interrupts that triggered wakeup
authorAbhijeet Dharmapurikar <adharmap@codeaurora.org>
Mon, 13 Dec 2010 20:04:27 +0000 (12:04 -0800)
committerYimin Peng <yiminp@codeaurora.org>
Thu, 3 May 2018 06:54:03 +0000 (14:54 +0800)
This change is to satisfy the logging requirement of
wakeup interrupts. Add code to log the trigger status
of wakeup interrupts. This helps in debugging
the cause of wakeup when the system is suspended

Change-Id: I0f724296f9133433cdbc3271a9b91c6fa992a2ff
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
drivers/irqchip/irq-gic.c

index 2ca62ef..20800b1 100644 (file)
@@ -258,11 +258,35 @@ static int gic_suspend(void)
        return 0;
 }
 
+static void gic_show_resume_irq(struct gic_chip_data *gic)
+{
+       unsigned int i;
+       u32 enabled;
+       u32 pending[32];
+       void __iomem *base = gic_data_dist_base(gic);
+
+       raw_spin_lock(&irq_controller_lock);
+       for (i = 0; i * 32 < gic->gic_irqs; i++) {
+               enabled = readl_relaxed(base + GIC_DIST_ENABLE_CLEAR + i * 4);
+               pending[i] = readl_relaxed(base + GIC_DIST_PENDING_SET + i * 4);
+               pending[i] &= enabled;
+       }
+       raw_spin_unlock(&irq_controller_lock);
+
+       for (i = find_first_bit((unsigned long *)pending, gic->gic_irqs);
+               i < gic->gic_irqs;
+               i = find_next_bit((unsigned long *)pending,
+                               gic->gic_irqs, i+1)) {
+               pr_warn("%s: %d triggered", __func__, i + gic->irq_offset);
+       }
+}
+
 static void gic_resume_one(struct gic_chip_data *gic)
 {
        unsigned int i;
        void __iomem *base = gic_data_dist_base(gic);
 
+       gic_show_resume_irq(gic);
        for (i = 0; i * 32 < gic->gic_irqs; i++) {
                /* disable all of them */
                writel_relaxed(0xffffffff,