Hi Jon, On Tue, Feb 16, 2016 at 10:28 AM, Jon Hunter <jonathanh@xxxxxxxxxx> wrote: > On 09/02/16 15:19, Geert Uytterhoeven wrote: >> The R-Car GPIO driver handles Runtime PM for requested GPIOs only. >> >> When using a GPIO purely as an interrupt source, no Runtime PM handling >> is done, and the GPIO module's clock may not be enabled. >> >> To fix this: >> - Add .irq_request_resources() and .irq_release_resources() callbacks >> to handle Runtime PM when an interrupt is requested, > > I know that when I was looking at runtime-pm support for IRQ chips > (which I have been meaning to get back too), the problem with > irq_request_resources() is that it is called from the context of a > spinlock (in __setup_irq()). You mentioned that you have not seen any > reports of might_sleep_if(), but have you ensured that it is actually > runtime resuming in your testing and you are not getting lucky? It must be runtime-resuming, because without the call to pm_runtime_get_sync() interrupts don't work. > An alternative for you might be to use the > irq_bus_lock/irq_bus_sync_unlock callbacks. See what Grygorii > implemented for OMAP in commit aca82d1cbb49 ("gpio: omap: move pm > runtime in irq_chip.irq_bus_lock/sync_unlock"). Thanks, that indeed looks interesting... > As I mentioned I do plan to get back to the series for adding runtime-pm > support for IRQ chips, in the next week or two. Looking forward to it! Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds