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

Commit 10396393 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "platsmp: Print the pending irqs in case of hotplug failure"

parents 346451ea 2a7fc798
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
#include <linux/msm_rtb.h>
#include <soc/qcom/spm.h>
#include <soc/qcom/pm.h>
#include <linux/irqchip/arm-gic.h>

#include <asm/smp_plat.h>
#include <asm/vfp.h>
@@ -53,7 +54,10 @@ static inline void platform_do_lowpower(unsigned int cpu, int *spurious)
		 * The trouble is, letting people know about this is not really
		 * possible, since we are currently running incoherently, and
		 * therefore cannot safely call printk() or anything else
		 * Read the pending interrupts to understand why we woke up
		 */
		local_irq_disable();
		gic_show_pending_irq();
		(*spurious)++;
	}
}
+26 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
 *  linux/arch/arm/common/gic.c
 *
 *  Copyright (C) 2002 ARM Limited, All Rights Reserved.
 *  Copyright (c) 2014, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
@@ -241,6 +242,31 @@ static int gic_suspend(void)

extern int msm_show_resume_irq_mask;

/*
 * 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_irq(void)
{
	void __iomem *base;
	unsigned long pending[32];
	u32 enabled;
	unsigned int i, j;

	for (i = 0; i < MAX_GIC_NR; i++) {
		base = gic_data_dist_base(&gic_data[i]);
		for (j = 0; j * 32 < gic_data[i].gic_irqs; j++) {
			enabled = readl_relaxed(base +
						GIC_DIST_ENABLE_SET + j * 4);
			pending[j] = readl_relaxed(base +
						GIC_DIST_PENDING_SET + j * 4);
			pending[j] &= enabled;
			pr_err("Pending irqs[%d] %lx\n", j, pending[j]);
		}
	}
}

static void gic_show_resume_irq(struct gic_chip_data *gic)
{
	unsigned int i;
+2 −1
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
 *  include/linux/irqchip/arm-gic.h
 *
 *  Copyright (C) 2002 ARM Limited, All Rights Reserved.
 *  Copyright (c) 2014, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
@@ -81,6 +82,6 @@ static inline void gic_init(unsigned int nr, int start,

bool gic_is_spi_pending(unsigned int irq);
void gic_clear_spi_pending(unsigned int irq);

void gic_show_pending_irq(void);
#endif /* __ASSEMBLY */
#endif