Hi Niklas, On Friday 09 Dec 2016 00:15:51 Niklas Söderlund wrote: > On 2016-12-08 23:40:42 +0200, Laurent Pinchart wrote: > > On Thursday 08 Dec 2016 18:32:28 Niklas Söderlund wrote: > >> From: Geert Uytterhoeven <geert+renesas@xxxxxxxxx> > >> > >> Currently gpio modules are runtime-resumed at probe time. This means the > >> gpio module will be active all the time (except during system suspend, > >> if not configured as a wake-up source). > >> > >> While an R-Car Gen2 gpio module retains pins configured for output at > >> the requested level while put in standby mode, gpio register cannot be > >> accessed while suspended. Unfortunately pm_runtime_get_sync() cannot be > >> called from all contexts where gpio register access is needed. Hence > >> move the Runtime PM handling from probe/remove time to gpio request/free > >> time, which is probably the best we can do. > >> > >> On r8a7791/koelsch, gpio modules 0, 1, 3, and 4 are now suspended during > >> normal use (gpio2 is used for LEDs and regulators, gpio5 for keys, gpio6 > >> for SD-Card CD & WP, gpio7 for keys and regulators). > >> > >> Signed-off-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx> > >> [Niklas: s/gpio_to_priv(chip)/gpiochip_get_data(chip)/] > > > > Just curious, what's the rationale for this ? > > This was changed for the whole driver after the original patch was > applied (at the time of change the patch was not yet reverted), see [1]. > I needed to update this when I resurrected the patch, maybe I could have > been more clever and reverted the revert patch but this felt cleaner, if > it's better to do it the other way around and revert a revert please let > me know so I can do so in the future. No, this is fine. I'm a bit dubious about [1] given that it consumes more CPU cycles without any benefit as far as I can see. Maybe I can't see far enough though, Linus Walleij could prove me wrong :-) > [1] c7b6f457cb53bcee ("gpio: rcar: use gpiochip data pointer"). -- Regards, Laurent Pinchart