* Tony Lindgren <tony@xxxxxxxxxxx> [180910 20:10]: > +static void __maybe_unused > +omap4_gpio_disable_level_quirk(struct gpio_bank *bank) > +{ > + /* Restore level registers after idle */ > + writel_relaxed(bank->context.leveldetect0, > + bank->base + bank->regs->leveldetect0); > + writel_relaxed(bank->context.leveldetect1, > + bank->base + bank->regs->leveldetect1); > + > + /* Clear wake after idle */ > + writel_relaxed(0, bank->base + bank->regs->wkup_en); /* Reset saved wkup_en, it will be set for next idle again */ bank->context.wake_en = 0; > +} Clearing the saved wkup_en is needed above I noticed testing again with gpio4 which has pdata->loses_context set. Otherwise runtime_resume will write to wkup_en enabling it for runtime which will the next idle fail. Regards, Tony