lkml.org 
[lkml]   [2015]   [Jul]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH] cpufreq: Initialize the governor again while restoring policy
    Date
    On Wednesday, July 08, 2015 11:23:58 AM Viresh Kumar wrote:
    > When all CPUs of a policy are hot-unplugged, we EXIT the governor but
    > don't mark policy->governor as NULL. This was done in order to keep last
    > used governor's information intact in sysfs, while the CPUs are offline.
    >
    > We also missed marking policy->governor as NULL while restoring the
    > policy. Because of that, we call __cpufreq_governor(CPUFREQ_GOV_LIMITS)

    How exactly does that happen?

    > for an uninitialized policy. Which eventually returns -EBUSY.
    >
    > Fix this by setting policy->governor to NULL while restoring the policy.
    >
    > Reported-by: Pi-Cheng Chen <pi-cheng.chen@linaro.org>
    > Reported-by: "Jon Medhurst (Tixy)" <tixy@linaro.org>
    > Fixes: 18bf3a124ef8 ("cpufreq: Mark policy->governor = NULL for inactive policies")
    > Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
    > ---
    > For 4.2-rc
    >
    > drivers/cpufreq/cpufreq.c | 1 +
    > 1 file changed, 1 insertion(+)
    >
    > diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
    > index b612411655f9..2c22e3902e72 100644
    > --- a/drivers/cpufreq/cpufreq.c
    > +++ b/drivers/cpufreq/cpufreq.c
    > @@ -1132,6 +1132,7 @@ static struct cpufreq_policy *cpufreq_policy_restore(unsigned int cpu)
    >
    > down_write(&policy->rwsem);
    > policy->cpu = cpu;
    > + policy->governor = NULL;
    > up_write(&policy->rwsem);
    > }
    >
    >

    --
    I speak only for myself.
    Rafael J. Wysocki, Intel Open Source Technology Center.


    \
     
     \ /
      Last update: 2015-07-09 02:21    [W:2.647 / U:0.108 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site