mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] cpufreq: cpufreq-cpu0: No need to check cpu number in init()
@ 2013-03-30 12:56 Viresh Kumar
  2013-04-01  6:44 ` Shawn Guo
  0 siblings, 1 reply; 2+ messages in thread
From: Viresh Kumar @ 2013-03-30 12:56 UTC (permalink / raw)
  To: rjw, shawn.guo
  Cc: cpufreq, linux-pm, linux-kernel, linaro-kernel, patches,
	robin.randhawa, Steve.Bannister, Liviu.Dudau,
	charles.garcia-tobin, arvind.chauhan, Viresh Kumar

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>
---
 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 0f16267..1cab820 100644
--- a/drivers/cpufreq/cpufreq-cpu0.c
+++ b/drivers/cpufreq/cpufreq-cpu0.c
@@ -124,9 +124,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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] cpufreq: cpufreq-cpu0: No need to check cpu number in init()
  2013-03-30 12:56 [PATCH] cpufreq: cpufreq-cpu0: No need to check cpu number in init() Viresh Kumar
@ 2013-04-01  6:44 ` Shawn Guo
  0 siblings, 0 replies; 2+ messages in thread
From: Shawn Guo @ 2013-04-01  6:44 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: rjw, cpufreq, linux-pm, linux-kernel, linaro-kernel, patches,
	robin.randhawa, Steve.Bannister, Liviu.Dudau,
	charles.garcia-tobin, arvind.chauhan

On Sat, Mar 30, 2013 at 06:26:29PM +0530, Viresh Kumar wrote:
> 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>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-04-01  6:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-30 12:56 [PATCH] cpufreq: cpufreq-cpu0: No need to check cpu number in init() Viresh Kumar
2013-04-01  6:44 ` Shawn Guo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®