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

Commit d231399e authored by Cassidy Burden's avatar Cassidy Burden
Browse files

irqchip: gic: Add kconfig option for gic panic handler



Don't handle panic in gic driver unless debugging to save space. Enabling
gic panic handler allows developers to inspect gic from a RAM dump, but
requires 12 KiB of stack space for storing the registers.

Change-Id: Ic6d8ed956a09bc2d6608174244ecab25fb4ae216
Signed-off-by: default avatarCassidy Burden <cburden@codeaurora.org>
parent ae871193
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -16,6 +16,16 @@ config ARM_GIC_V3
	select IRQ_DOMAIN
	select MULTI_IRQ_HANDLER

config ARM_GIC_PANIC_HANDLER
	bool "GIC Panic Handler"
	depends on ARM_GIC_V3 || ARM_GIC
	help
	  Save GIC distributor registers to RAM buffer on kernel panic.
	  gic-v3 will have an additional buffer for router registers.
	  Mainly for debugging purposes.

	  For production kernels, you should say 'N' here.

config ARM_NVIC
	bool
	select IRQ_DOMAIN
+7 −0
Original line number Diff line number Diff line
@@ -76,7 +76,9 @@ struct gic_chip_data {
	unsigned int wakeup_irqs[32];
	unsigned int enabled_irqs[32];
#endif
#ifdef CONFIG_ARM_GIC_PANIC_HANDLER
	u32 saved_regs[0x400];
#endif
};

static DEFINE_RAW_SPINLOCK(irq_controller_lock);
@@ -181,6 +183,7 @@ static void gic_disable_irq(struct irq_data *d)
		gic_arch_extn.irq_disable(d);
}

#ifdef CONFIG_ARM_GIC_PANIC_HANDLER
static int gic_panic_handler(struct notifier_block *this,
			unsigned long event, void *ptr)
{
@@ -196,6 +199,7 @@ static int gic_panic_handler(struct notifier_block *this,
static struct notifier_block gic_panic_blk = {
	.notifier_call = gic_panic_handler,
};
#endif

#ifdef CONFIG_PM
static int gic_suspend_one(struct gic_chip_data *gic)
@@ -1219,7 +1223,10 @@ gic_of_init(struct device_node *node, struct device_node *parent)
		gic_cascade_irq(gic_cnt, irq);
	}
	gic_cnt++;

#ifdef CONFIG_ARM_GIC_PANIC_HANDLER
	atomic_notifier_chain_register(&panic_notifier_list, &gic_panic_blk);
#endif
	return 0;
}
IRQCHIP_DECLARE(gic_400, "arm,gic-400", gic_of_init);