Re: Powering down unused PM domains (was: Re: [PATCH 0/4] PM / Domains: Fix race conditions during boot)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday, October 08, 2014 02:00:50 PM Ulf Hansson wrote:
> On 7 October 2014 21:09, Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> wrote:
> > Hi Ulf,
> >
> > On Tue, Sep 30, 2014 at 2:43 PM, Ulf Hansson <ulf.hansson@xxxxxxxxxx> wrote:
> >> Instead, let's improve the situation, by preventing genpd from powering
> >> off any of the PM domains until late_init. At that point genpd already
> >> tries to power off unused PM domains, so it seems like a decent match.
> >
> > Note that powering off unused PM domains is currently limited to
> > CONFIG_PM_RUNTIME=y.
> > If CONFIG_PM_RUNTIME is disabled, unused PM domains are not powered down,
> > and may even stay powered-up during system suspend.
> 
> Right. That's obviously not an acceptable behaviour, we can do better.
> 
> >
> > With CONFIG_PM_RUNTIME=y, we have:
> >   A1. All PM domains are powered up during initialization.
> >   A2. After initialization, all unused PM domains are powered down by the
> >       genpd_poweroff_unused() late_initcall.
> >       "unused" means PM domains containing no active devices and no active
> >       subdomains. I.e. PM domains containing (a) only suspended devices, or
> >       (b) no[*] devices at all will be powered down.
> >   A3. PM domains will be powered up or down, depending on devices moving from
> >       inactive to active state, or vice versa. This includes system suspend,
> >       which can be considered some form of devices moving to an inactive
> >       state.
> >
> > In contrast, with CONFIG_PM_RUNTIME=n, we have:
> >   B1. All PM domains are powered up during initialization,
> >   B2. After initialization, PM domains just stay powered up,
> >   B3. PM domains will be powered down on system suspend, and powered up on
> >       system resume, based on the dev_pm_ops of the PM domain each device
> >       belongs to.
> >
> > While operation A2 is PM domain-centric (it walks the list of genpd domains),
> > A3 and B3 are device-centric (A3 operates on one specific device, B3 walks the
> > list of devices).
> > Hence B3 never touches PM domains that don't contain any devices[*].
> > So these PM domains are kept powered-up if CONFIG_PM_RUNTIME=n, even on
> > system suspend.
> >
> > Shouldn't PM domains without devices be powered down at some point?
> > When? In B2, or in B3?
> 
> I agree with Rafael and Sylwester, that it would be an advantage if PM
> domains can be initialized in powered off state. Simply because, those
> may then be left in powered off state all the time, if they are
> unused.
> 
> That's been my long term approach, but let's see if we can get there
> without the intermediate step proposed in this patchset...
> 
> Now, to support the above and to solve the race conditions, we need to
> be able to power up the PM domain, prior probing of a device. I am
> thinking of a solution aimed to affect subsystem level code (buses)
> and not drivers, since we need keep the impact on a reasonable level.

That sounds like a good approach to me.

Also that should work regardless of whether or not the drivers in question
implement runtime PM callbacks.

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SoC Development]     [Linux Rockchip Development]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Linux SCSI]     [Yosemite News]

  Powered by Linux