On Mon, Jun 30, 2014 at 09:20:30AM +0200, Arnd Bergmann wrote: > On Saturday 28 June 2014 22:40:26 Thierry Reding wrote: > > > > pmc.c implements various routines to access the power management > > > > controller, some of which is needed by suspend/resume, some of it is > > > > needed by SMP. powergate.c implements a subset of the PMC that needs to > > > > be exported to drivers to enable power partitions on the SoC. I'm not > > > > aware of subsystems that deal with this kind of driver. > > > > > > > Please see above. > > > > Like I said, I don't see what business suspend/resume related code has > > in drivers/power. What we're talking about here really is functionality > > very specific to Tegra. Also some of that code needs to be run at very > > early points in the boot process, so we can't reasonably turn it into a > > proper driver anyway. > > I believe the powergate.c stuff can be changed into pm_domain code, but > we don't have a good subsystem with generic DT bindings yet, so that > may need some more groundwork first. drivers/power or a subdirectory > of that may end up being the right place though. So I ended up implementing the powergates as generic_pm_domain, but that breaks existing drivers currently. The reason is that generic_pm_domains are automatically turned off on suspend and turned back on on resume. On Tegra if a partition is powered off then the whole module looses state and would need to be completely reinitialized. None of the drivers currently support that and I'm also not sure if it's really what we want since it means for example redetecting links and reenumerating devices on PCI, or probing display outputs in DRM. That's going to take a lot of time and may not be appropriate for suspend-to-RAM. Unfortunately I haven't found a way to force a domain to remain powered during suspend/resume. Thierry
Attachment:
pgpaTQI2htJza.pgp
Description: PGP signature