lkml.org 
[lkml]   [2019]   [Feb]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 1/2] cpufreq: Allow light-weight tear down on CPU offline operation
On Mon, Feb 11, 2019 at 11:51 AM Rafael J. Wysocki <rafael@kernel.org> wrote:
>
> On Mon, Feb 11, 2019 at 9:41 AM Viresh Kumar <viresh.kumar@linaro.org> wrote:
> >
> > The cpufreq core doesn't remove the cpufreq policy anymore on CPU
> > offline operation, rather that happens when the CPU device gets
> > unregistered from the kernel. This allows faster recovery when the CPU
> > comes back online. This is also very useful during system wide
> > suspend/resume where we offline all non-boot CPUs during suspend and
> > then bring them back on resume.
> >
> > This commit takes the same idea a step ahead to allow drivers to do
> > light weight tear-down during CPU offline operation.
> >
> > A new callback is introduced, light_weight_exit(), which gets called
> > when all the CPUs of a policy are removed/offlined and the existing
> > exit() callback gets called when the policy gets freed.
> >
> > Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> > ---

[cut]

> > diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
> > index 9db074ecbbd7..36ce31516041 100644
> > --- a/include/linux/cpufreq.h
> > +++ b/include/linux/cpufreq.h
> > @@ -325,6 +325,7 @@ struct cpufreq_driver {
> > /* optional */
> > int (*bios_limit)(int cpu, unsigned int *limit);
> >
> > + int (*light_weight_exit)(struct cpufreq_policy *policy);
>
> Can you call it "offline"?
>
> > int (*exit)(struct cpufreq_policy *policy);
> > void (*stop_cpu)(struct cpufreq_policy *policy);
> > int (*suspend)(struct cpufreq_policy *policy);
> > --

Also, I would prefer a corresponding "online" callback to be there too
for symmetry and I'd prefer the core to decide to call "online"
instead of "init" for the light-weight case instead of ->init() itself
having to figure out the context.

\
 
 \ /
  Last update: 2019-02-11 11:57    [W:0.081 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site