On Wed, Jul 8, 2020 at 6:58 PM Dmitry Osipenko <digetx@xxxxxxxxx> wrote: > > I noticed on Nexus 7 that after rebooting from downstream kernel to > upstream, the GPIO interrupt is triggering non-stop despite of interrupts despite interrupts > being disabled for all of GPIOs. This happens because Nexus 7 uses a > soft-reboot, meaning that bootloader should take care of resetting > hardware, but bootloader doesn't do it well. In a result, GPIO interrupt but the bootloader As a result > may be left ON at a boot time. Let's mask all GPIO interrupts at the > driver's initialization time in order to resolve the issue. ... > mgpio->gpio_chip.ngpio = MAX77620_GPIO_NR; > mgpio->gpio_chip.can_sleep = 1; > mgpio->gpio_chip.base = -1; > + mgpio->gpio_chip.irq.init_hw = max77620_gpio_irq_init_hw, Now this seems a bit awkward. Perhaps you need first to switch to use GPIO IRQ chip structure? It's also in the TODO of the GPIO subsystem ;-) ... > #ifdef CONFIG_OF_GPIO > mgpio->gpio_chip.of_node = pdev->dev.parent->of_node; > #endif This seems to be done by GPIO library. Also point to improve: don't shadow error from platform_get_irq(). -- With Best Regards, Andy Shevchenko