From: Viresh Kumar <viresh.kumar@linaro.org>
To: Rafael Wysocki <rjw@rjwysocki.net>
Cc: Linaro Kernel Mailman List <linaro-kernel@lists.linaro.org>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
Prarit Bhargava <prarit@redhat.com>,
Saravana Kannan <skannan@codeaurora.org>,
Viresh Kumar <viresh.kumar@linaro.org>
Subject: Re: [PATCH 16/17] cpufreq: remove check for cpufreq_disabled() from cpufreq_cpu_{get|put}()
Date: Sun, 25 Jan 2015 18:54:27 +0530 [thread overview]
Message-ID: <CAKohpomwDr2B+4ncjFyfem1o03gJ+N6bdDEDtdJTvreN6ivp9Q@mail.gmail.com> (raw)
In-Reply-To: <49250a2946ff12500a5474eb9384c125b3ede23c.1420181916.git.viresh.kumar@linaro.org>
On 2 January 2015 at 12:34, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> In most of the cases cpufreq wouldn't be disabled and this adds unnecessary
> delay for its users. In the case if cpufreq is really disabled, then the per-cpu
> variable will also return NULL and things will continue working as is. Remove
> this unnecessary check.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
> drivers/cpufreq/cpufreq.c | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index 14d637a28dd8..62c6a0b8b0d1 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -202,9 +202,6 @@ struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu)
> struct cpufreq_policy *policy = NULL;
> unsigned long flags;
>
> - if (cpufreq_disabled())
> - return NULL;
> -
> if (!down_read_trylock(&cpufreq_rwsem))
> return NULL;
>
> @@ -229,9 +226,6 @@ EXPORT_SYMBOL_GPL(cpufreq_cpu_get);
>
> void cpufreq_cpu_put(struct cpufreq_policy *policy)
> {
> - if (cpufreq_disabled())
> - return;
> -
> kobject_put(&policy->kobj);
> up_read(&cpufreq_rwsem);
> }
@Rafael: Are you fine with this patch as is? I meant, you just left it for
rebase conflict or because you want it to be part of the WARN() you
suggested?
The WARN here might not be a good idea as this can be called by
users while cpufreq is disabled. But we don't need this check because
of the reasons I mentioned in commit log.
next prev parent reply other threads:[~2015-01-25 13:24 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-02 7:04 [PATCH 00/17] cpufreq: trivial cleanups Viresh Kumar
2015-01-02 7:04 ` [PATCH 01/17] cpufreq: remove dangling comment Viresh Kumar
2015-01-02 7:04 ` [PATCH 02/17] cpufreq: remove extra parenthesis Viresh Kumar
2015-01-02 7:04 ` [PATCH 03/17] cpufreq: don't need line break in show_scaling_cur_freq() Viresh Kumar
2015-01-02 7:04 ` [PATCH 04/17] cpufreq: merge 'if' blocks in __cpufreq_remove_dev_prepare() Viresh Kumar
2015-01-02 7:04 ` [PATCH 05/17] cpufreq: s/__find_governor/find_governor Viresh Kumar
2015-01-02 7:04 ` [PATCH 06/17] cpufreq: No need to check for has_target() Viresh Kumar
2015-01-02 7:04 ` [PATCH 07/17] cpufreq: pass policy to cpufreq_out_of_sync Viresh Kumar
2015-01-02 7:04 ` [PATCH 08/17] cpufreq: pass policy to __cpufreq_get() Viresh Kumar
2015-01-02 7:04 ` [PATCH 09/17] cpufreq: update driver_data->flags only if we are registering driver Viresh Kumar
2015-01-02 7:04 ` [PATCH 10/17] cpufreq: get rid of CONFIG_{HOTPLUG_CPU|SMP} mess Viresh Kumar
2015-01-02 7:04 ` [PATCH 11/17] cpufreq: get rid of 'tpolicy' from __cpufreq_add_dev() Viresh Kumar
2015-01-02 7:04 ` [PATCH 12/17] cpufreq: use light-weight cpufreq_cpu_get_raw() in __cpufreq_add_dev Viresh Kumar
2015-01-02 7:04 ` [PATCH 13/17] cpufreq: limit the scope of l_p_j variables Viresh Kumar
2015-01-02 7:04 ` [PATCH 14/17] cpufreq: check cpufreq_policy_list instead of scanning policies for all CPUs Viresh Kumar
2015-01-02 7:04 ` [PATCH 15/17] cpufreq: don't check if cpu > nr_cpu_ids Viresh Kumar
2015-01-02 7:04 ` [PATCH 16/17] cpufreq: remove check for cpufreq_disabled() from cpufreq_cpu_{get|put}() Viresh Kumar
2015-01-25 13:24 ` Viresh Kumar [this message]
2015-01-26 0:39 ` Rafael J. Wysocki
2015-01-27 3:47 ` Viresh Kumar
2015-01-02 7:04 ` [PATCH 17/17] cpufreq: move some initialization stuff to cpufreq_policy_alloc() Viresh Kumar
2015-01-12 6:11 ` [PATCH 00/17] cpufreq: trivial cleanups Viresh Kumar
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=CAKohpomwDr2B+4ncjFyfem1o03gJ+N6bdDEDtdJTvreN6ivp9Q@mail.gmail.com \
--to=viresh.kumar@linaro.org \
--cc=linaro-kernel@lists.linaro.org \
--cc=linux-pm@vger.kernel.org \
--cc=prarit@redhat.com \
--cc=rjw@rjwysocki.net \
--cc=skannan@codeaurora.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;
as well as URLs for NNTP newsgroup(s).