GIC: Show interrupts that triggered wakeup

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>
This commit is contained in:
Abhijeet Dharmapurikar 2010-12-13 12:04:27 -08:00 committed by Yimin Peng
parent 76330c4c30
commit 391e49f093

View 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,