Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 391e49f0 authored by Abhijeet Dharmapurikar's avatar Abhijeet Dharmapurikar Committed by Yimin Peng
Browse files

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: default avatarAbhijeet Dharmapurikar <adharmap@codeaurora.org>
parent 76330c4c
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -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,