lkml.org 
[lkml]   [2021]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 3/4] PM: domains: Drop/restore performance state votes for devices at runtime PM
On 04-06-21, 09:45, Ulf Hansson wrote:
> Starting calls from the subsystem/driver:
>
> ------
> dev_pm_genpd_set_performance_state(dev, 100);
> "run a use case with device runtime resumed"
> ...
> "use case ends"
> dev_pm_genpd_set_performance_state(dev, 0);
> pm_runtime_put()
> ->genpd_runtime_suspend()
> gpd_data->performance_state == 0, -> gpd_data->rpm_pstate = 0;
> ...
> "new use case start"
> dev_pm_genpd_set_performance_state(dev, 100);
> pm_runtime_get_sync()
> ->genpd_runtime_resume()
> gpd_data->performance_state == 100, -> gpd_data->rpm_pstate = 0;
> (This is where we need to check for "zero" to not override the value)
> .....
> ------
>
> I wouldn't say that the above is the way how I see the calls to
> dev_pm_genpd_set_performance_state (or actually
> dev_pm_opp_set_rate|opp()) being deployed. The calls should rather be
> done from the subsystem/driver's ->runtime_suspend|resume() callback,
> then the path above would work in the way you suggest.
>
> Although, as we currently treat performance states and power states in
> genpd orthogonally, I wanted to make sure we could cope with both
> situations.

I think letting the drivers to call
dev_pm_genpd_set_performance_state(dev, 0) from suspend/resume makes
it really ugly/racy as both depend on the gpd_data->performance_state
for this. It doesn't look nice. And we shouldn't try to protect such
drivers.

Anyway, your call :)

> Did this help? :-)

Yes :)

--
viresh

\
 
 \ /
  Last update: 2021-06-07 06:49    [W:0.054 / U:0.896 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site