Linux Power Management development
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Amit Kucheria <amit.kucheria@linaro.org>
Cc: Viresh Kumar <viresh.kumar@linaro.org>,
	Robin Randhawa <robin.randhawa@arm.com>,
	linux-pm@vger.kernel.org, Liviu Dudau <Liviu.Dudau@arm.com>,
	linux-kernel@vger.kernel.org, cpufreq@vger.kernel.org,
	Steve Bannister <Steve.Bannister@arm.com>,
	Arvind Chauhan <arvind.chauhan@arm.com>,
	Lists linaro-kernel <linaro-kernel@lists.linaro.org>,
	Charles Garcia-Tobin <charles.garcia-tobin@arm.com>
Subject: Re: [PATCH] cpufreq: stats: do cpufreq_cpu_put() corresponding to cpufreq_cpu_get
Date: Fri, 22 Mar 2013 12:59:42 +0100	[thread overview]
Message-ID: <38998218.UX7TkEXzYs@vostro.rjw.lan> (raw)
In-Reply-To: <CAP245DWx_C0wcW-9SCfR0ViqyyqNbAeZnWfeMiXSgRGupo9jWQ@mail.gmail.com>

On Friday, March 22, 2013 04:42:57 PM Amit Kucheria wrote:
> On Fri, Mar 22, 2013 at 3:43 PM, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> > In cpufreq_stats_free_sysfs() we aren't balancing calls to cpufreq_cpu_get()
> > with cpufreq_cpu_put(). This will never let us have ref count to policy->kobj as
> > zero.
> 
> Rafael,
> 
> Since this prevents booting on our hardware (we unregister and
> re-register the cpufreq driver to account for virtual cores), will
> this be considered as a hotfix for 3.9?

Sure.  Can you please remind me what hardware is that, though?

Rafael


> > Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> 
> Acked-by: Amit Kucheria <amit.kucheria@linaro.org>
> 
> > ---
> >  drivers/cpufreq/cpufreq_stats.c | 12 ++++++++----
> >  1 file changed, 8 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c
> > index 2fd779e..bfd6273 100644
> > --- a/drivers/cpufreq/cpufreq_stats.c
> > +++ b/drivers/cpufreq/cpufreq_stats.c
> > @@ -180,15 +180,19 @@ static void cpufreq_stats_free_sysfs(unsigned int cpu)
> >  {
> >         struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);
> >
> > -       if (!cpufreq_frequency_get_table(cpu))
> > +       if (!policy)
> >                 return;
> >
> > -       if (policy && !policy_is_shared(policy)) {
> > +       if (!cpufreq_frequency_get_table(cpu))
> > +               goto put_ref;
> > +
> > +       if (!policy_is_shared(policy)) {
> >                 pr_debug("%s: Free sysfs stat\n", __func__);
> >                 sysfs_remove_group(&policy->kobj, &stats_attr_group);
> >         }
> > -       if (policy)
> > -               cpufreq_cpu_put(policy);
> > +
> > +put_ref:
> > +       cpufreq_cpu_put(policy);
> >  }
> >
> >  static int cpufreq_stats_create_table(struct cpufreq_policy *policy,
> > --
> > 1.7.12.rc2.18.g61b472e
> >
> --
> To unsubscribe from this list: send the line "unsubscribe cpufreq" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

  parent reply	other threads:[~2013-03-22 11:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-22 10:13 [PATCH] cpufreq: stats: do cpufreq_cpu_put() corresponding to cpufreq_cpu_get Viresh Kumar
2013-03-22 11:12 ` Amit Kucheria
2013-03-22 11:17   ` Viresh Kumar
2013-03-22 11:47     ` Rafael J. Wysocki
2013-03-22 11:59   ` Rafael J. Wysocki [this message]
2013-03-22 11:55     ` Viresh Kumar
2013-03-22 11:59       ` Amit Kucheria
2013-03-22 12:12       ` Rafael J. Wysocki
2013-03-22 12:10         ` Viresh Kumar
2013-03-22 13:22           ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=38998218.UX7TkEXzYs@vostro.rjw.lan \
    --to=rjw@sisk.pl \
    --cc=Liviu.Dudau@arm.com \
    --cc=Steve.Bannister@arm.com \
    --cc=amit.kucheria@linaro.org \
    --cc=arvind.chauhan@arm.com \
    --cc=charles.garcia-tobin@arm.com \
    --cc=cpufreq@vger.kernel.org \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=robin.randhawa@arm.com \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox