Skip to content

Commit 7ae710f

Browse files
lunnlinusw
authored andcommitted
gpio: vf610: Mask all GPIO interrupts
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. Fixes: 7f2691a ("gpio: vf610: add gpiolib/IRQ chip driver for Vybrid") Signed-off-by: Andrew Lunn <andrew@lunn.ch> Acked-by: Stefan Agner <stefan@agner.ch> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent aa284d6 commit 7ae710f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/gpio/gpio-vf610.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ static int vf610_gpio_probe(struct platform_device *pdev)
253253
struct vf610_gpio_port *port;
254254
struct resource *iores;
255255
struct gpio_chip *gc;
256+
int i;
256257
int ret;
257258

258259
port = devm_kzalloc(&pdev->dev, sizeof(*port), GFP_KERNEL);
@@ -319,6 +320,10 @@ static int vf610_gpio_probe(struct platform_device *pdev)
319320
if (ret < 0)
320321
return ret;
321322

323+
/* Mask all GPIO interrupts */
324+
for (i = 0; i < gc->ngpio; i++)
325+
vf610_gpio_writel(0, port->base + PORT_PCR(i));
326+
322327
/* Clear the interrupt status register for all GPIO's */
323328
vf610_gpio_writel(~0, port->base + PORT_ISFR);
324329

0 commit comments

Comments
 (0)