On Sun, Jan 27, 2019 at 10:58 PM Andrew Lunn <andrew@xxxxxxx> wrote: > On SoC reset all GPIO interrupts are disable. However, if kexec is > used to boot into a new kernel, the SoC does not experience a > reset. Hence GPIO interrupts can be left enabled from the previous > kernel. It is then possible for the interrupt to fire before an > interrupt handler is registered, resulting in the kernel complaining > of an "unexpected IRQ trap", the interrupt is never cleared, and so > fires again, resulting in an interrupt storm. > > Disable all GPIO interrupts before registering the GPIO IRQ chip. > > Cc: Stefan Agner <stefan@xxxxxxxx> > Fixes: 7f2691a19627 ("gpio: vf610: add gpiolib/IRQ chip driver for Vybrid") > Signed-off-by: Andrew Lunn <andrew@xxxxxxx> Patch applied for fixes with Stefan's ACK. > I was wondering if this should be done in gpiolib, as part of > gpiochip_irqchip_add() ? It could be dangerous I think, we have so many cases where it is dangerous to augment hardware states without asking, just reading the state of the gpio level using ->get_direction() etc was controversial. I'd say let's keep this in the drivers for now, but certainly all drivers that can should mask all their IRQs off before proceeding to add the irqchip. Yours, Linus Walleij