From: Viresh Kumar <viresh.kumar@linaro.org>
To: rjw@sisk.pl
Cc: cpufreq@vger.kernel.org, linux-pm@vger.kernel.org,
linux-kernel@vger.kernel.org,
Viresh Kumar <viresh.kumar@linaro.org>
Subject: [PATCH 3/9] cpufreq: cpufreq-cpu0: No need to check cpu number in init()
Date: Mon, 1 Apr 2013 18:27:43 +0530 [thread overview]
Message-ID: <e15015fc03add6737b546610c4bcd141f0e8ea7b.1364820620.git.viresh.kumar@linaro.org> (raw)
In-Reply-To: <cover.1364820620.git.viresh.kumar@linaro.org>
In-Reply-To: <cover.1364820620.git.viresh.kumar@linaro.org>
It is not possible for init() to be called for any cpu other than cpu0. During
bootup whatever cpu is used to boot system will be assigned as cpu0. And later
on policy->cpu can only change if we hotunplug all cpus first and then hotplug
them back in different order, which isn't possible (system requires atleast one
cpu to be up always :)).
Though I can see one situation where policy->cpu can be different then zero.
- Hot-unplug cpu 0.
- rmmod cpufreq-cpu0 module
- insmod it back
- hotplug cpu 0 again.
Here, policy->cpu would be different. But the driver doesn't have any dependency
on cpu0 as such. We don't mind which cpu of a system is policy->cpu and so this
check is just not required.
Remove it.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
---
drivers/cpufreq/cpufreq-cpu0.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c
index 6bb88af..4c5a4cf 100644
--- a/drivers/cpufreq/cpufreq-cpu0.c
+++ b/drivers/cpufreq/cpufreq-cpu0.c
@@ -130,9 +130,6 @@ static int cpu0_cpufreq_init(struct cpufreq_policy *policy)
{
int ret;
- if (policy->cpu != 0)
- return -EINVAL;
-
ret = cpufreq_frequency_table_cpuinfo(policy, freq_table);
if (ret) {
pr_err("invalid frequency table: %d\n", ret);
--
1.7.12.rc2.18.g61b472e
next prev parent reply other threads:[~2013-04-01 12:58 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-01 12:57 [PATCH 0/9] CPUFreq Updates & Fixes for 3.10 Viresh Kumar
2013-04-01 12:57 ` [PATCH 1/9] cpufreq: cpu0: Fix mistake in Documentation example Viresh Kumar
2013-04-01 12:57 ` [PATCH 2/9] cpufreq: Documentation: Fix cpufreq_frequency_table name Viresh Kumar
2013-04-01 12:57 ` Viresh Kumar [this message]
2013-04-01 12:57 ` [PATCH 4/9] cpufreq: cpufreq-cpu0: Call CPUFREQ_POSTCHANGE notifier for failure cases too Viresh Kumar
2013-04-01 12:57 ` [PATCH 5/9] cpufreq: Notify all policy->cpus in cpufreq_notify_transition() Viresh Kumar
2013-04-01 12:57 ` Viresh Kumar
2013-04-01 12:57 ` Viresh Kumar
2013-04-01 12:57 ` Viresh Kumar
2013-04-01 12:57 ` [PATCH 6/9] cpufreq: Don't check if cpu is online/offline for cpufreq callbacks Viresh Kumar
2013-04-01 13:09 ` Viresh Kumar
2013-04-01 12:59 ` Viresh Kumar
2013-04-01 16:58 ` David Miller
2013-04-01 16:58 ` David Miller
2013-04-01 12:57 ` [PATCH 7/9] cpufreq: drivers: don't check range of target freq in .target() Viresh Kumar
2013-04-01 12:57 ` [PATCH 8/9] cpufreq: drivers: Remove unnecessary assignments of policy-> members Viresh Kumar
2013-04-01 12:57 ` [PATCH 9/9] cpufreq: ARM big LITTLE: Add generic cpufreq driver and its DT glue Viresh Kumar
2013-04-01 21:05 ` [PATCH 0/9] CPUFreq Updates & Fixes for 3.10 Rafael J. Wysocki
2013-04-02 0:43 ` Viresh Kumar
2013-04-02 12:51 ` Rafael J. Wysocki
2013-04-02 13:23 ` Viresh Kumar
2013-04-02 13:45 ` 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=e15015fc03add6737b546610c4bcd141f0e8ea7b.1364820620.git.viresh.kumar@linaro.org \
--to=viresh.kumar@linaro.org \
--cc=cpufreq@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@sisk.pl \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.