linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] cpufreq: arm_big_little: make vexpress driver dependent on bL core driver
@ 2014-03-14  6:40 Viresh Kumar
  2014-03-14  6:40 ` [PATCH 2/2] cpufreq: arm_big_little: set 'physical_cluster' for each cpu Viresh Kumar
  2014-03-14 12:34 ` [PATCH 1/2] cpufreq: arm_big_little: make vexpress driver dependent on bL core driver Rafael J. Wysocki
  0 siblings, 2 replies; 3+ messages in thread
From: Viresh Kumar @ 2014-03-14  6:40 UTC (permalink / raw)
  To: rjw
  Cc: linaro-kernel, cpufreq, linux-pm, linux-kernel, xin.wang,
	arvind.chauhan, Sudeep.Holla, Viresh Kumar

Currently vexpress big LITTLE driver selects ARM_BIG_LITTLE_CPUFREQ and so if
CONFIG_BIG_LITTLE isn't enabled and CONFIG_ARM_VEXPRESS_SPC_CPUFREQ is enabled
we get below warnings while compiling:

warning: (ARM_VEXPRESS_SPC_CPUFREQ) selects ARM_BIG_LITTLE_CPUFREQ which has
unmet direct dependencies (ARCH_HAS_CPUFREQ && CPU_FREQ && (ARM || ARM64) && ARM
&& BIG_LITTLE && ARM_CPU_TOPOLOGY && HAVE_CLK)

To fix this make ARM_VEXPRESS_SPC_CPUFREQ dependent on ARM_BIG_LITTLE_CPUFREQ
instead of selecting it.

This also moves entry for ARM_VEXPRESS_SPC_CPUFREQ along with other big LITTLE
config entries.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
Hi Rafael,

Both of these are fixes, please see if they can make it to 3.14 only.

Thanks.

 drivers/cpufreq/Kconfig.arm | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm
index 3129749..9fb6270 100644
--- a/drivers/cpufreq/Kconfig.arm
+++ b/drivers/cpufreq/Kconfig.arm
@@ -2,6 +2,7 @@
 # ARM CPU Frequency scaling drivers
 #
 
+# big LITTLE core layer and glue drivers
 config ARM_BIG_LITTLE_CPUFREQ
 	tristate "Generic ARM big LITTLE CPUfreq driver"
 	depends on ARM && BIG_LITTLE && ARM_CPU_TOPOLOGY && HAVE_CLK
@@ -16,6 +17,14 @@ config ARM_DT_BL_CPUFREQ
 	  This enables probing via DT for Generic CPUfreq driver for ARM
 	  big.LITTLE platform. This gets frequency tables from DT.
 
+config ARM_VEXPRESS_SPC_CPUFREQ
+        tristate "Versatile Express SPC based CPUfreq driver"
+	depends on ARM_BIG_LITTLE_CPUFREQ && ARCH_VEXPRESS_SPC
+        help
+          This add the CPUfreq driver support for Versatile Express
+	  big.LITTLE platforms using SPC for power management.
+
+
 config ARM_EXYNOS_CPUFREQ
 	bool
 
@@ -241,11 +250,3 @@ config ARM_TEGRA_CPUFREQ
 	default y
 	help
 	  This adds the CPUFreq driver support for TEGRA SOCs.
-
-config ARM_VEXPRESS_SPC_CPUFREQ
-        tristate "Versatile Express SPC based CPUfreq driver"
-        select ARM_BIG_LITTLE_CPUFREQ
-        depends on ARCH_VEXPRESS_SPC
-        help
-          This add the CPUfreq driver support for Versatile Express
-	  big.LITTLE platforms using SPC for power management.
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH 2/2] cpufreq: arm_big_little: set 'physical_cluster' for each cpu
  2014-03-14  6:40 [PATCH 1/2] cpufreq: arm_big_little: make vexpress driver dependent on bL core driver Viresh Kumar
@ 2014-03-14  6:40 ` Viresh Kumar
  2014-03-14 12:34 ` [PATCH 1/2] cpufreq: arm_big_little: make vexpress driver dependent on bL core driver Rafael J. Wysocki
  1 sibling, 0 replies; 3+ messages in thread
From: Viresh Kumar @ 2014-03-14  6:40 UTC (permalink / raw)
  To: rjw
  Cc: linaro-kernel, cpufreq, linux-pm, linux-kernel, xin.wang,
	arvind.chauhan, Sudeep.Holla, Viresh Kumar

We have a per-cpu variable for managing which cluster does a CPU belong to.
Currently physical_cluster is set only for the policy->cpu. And that results in
following on some SoC's:

- There are two clusters:
  - Cluster 0 has four ARM Cortex A7 CPUs (slower ones): 0,1,2,3
  - Cluster 1 has four ARM Cortex A15 CPUs (faster ones): 4,5,6,7
- CPUs are booted in order 0,1..7 and so initially policy->cpu for A7 cluster
  would be 0 and for A15 cluster would be 4.
- Now CPU4 (i.e. A15_0) is hotplugged out and so policy->cpu for A15 cluster
  becomes 5 (i.e. A15_1).
- But physical cluster is only set for CPU0 and CPU4 in ARM big LITTLE driver
  and isn't updated.
- Now freq change request comes for A15 cluster and we would try to update freq
  of physical_cluster of CPU5, i.e. A15_1. And it is currently set to zero
  (default value of uninitialized global variables).
- And so we actually try to change freq of A7 cluster instead of A15.
- This also results in kernel crash as sometimes we might request freq above
  A7's limit and CPU may behave badly..

Fix this by initializing physical_cluster for all CPUs of a policy.

(Adding signed-off by Xin as he reported this issue and provided this diff)

Signed-off-by: Xin Wang <xin.wang@arm.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/arm_big_little.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/cpufreq/arm_big_little.c b/drivers/cpufreq/arm_big_little.c
index 3d87078..bad2ed3 100644
--- a/drivers/cpufreq/arm_big_little.c
+++ b/drivers/cpufreq/arm_big_little.c
@@ -446,9 +446,12 @@ static int bL_cpufreq_init(struct cpufreq_policy *policy)
 	}
 
 	if (cur_cluster < MAX_CLUSTERS) {
+		int cpu;
+
 		cpumask_copy(policy->cpus, topology_core_cpumask(policy->cpu));
 
-		per_cpu(physical_cluster, policy->cpu) = cur_cluster;
+		for_each_cpu(cpu, policy->cpus)
+			per_cpu(physical_cluster, cpu) = cur_cluster;
 	} else {
 		/* Assumption: during init, we are always running on A15 */
 		per_cpu(physical_cluster, policy->cpu) = A15_CLUSTER;
-- 
1.7.12.rc2.18.g61b472e

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

* Re: [PATCH 1/2] cpufreq: arm_big_little: make vexpress driver dependent on bL core driver
  2014-03-14  6:40 [PATCH 1/2] cpufreq: arm_big_little: make vexpress driver dependent on bL core driver Viresh Kumar
  2014-03-14  6:40 ` [PATCH 2/2] cpufreq: arm_big_little: set 'physical_cluster' for each cpu Viresh Kumar
@ 2014-03-14 12:34 ` Rafael J. Wysocki
  1 sibling, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2014-03-14 12:34 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: linaro-kernel, cpufreq, linux-pm, linux-kernel, xin.wang,
	arvind.chauhan, Sudeep.Holla

On Friday, March 14, 2014 12:10:54 PM Viresh Kumar wrote:
> Currently vexpress big LITTLE driver selects ARM_BIG_LITTLE_CPUFREQ and so if
> CONFIG_BIG_LITTLE isn't enabled and CONFIG_ARM_VEXPRESS_SPC_CPUFREQ is enabled
> we get below warnings while compiling:
> 
> warning: (ARM_VEXPRESS_SPC_CPUFREQ) selects ARM_BIG_LITTLE_CPUFREQ which has
> unmet direct dependencies (ARCH_HAS_CPUFREQ && CPU_FREQ && (ARM || ARM64) && ARM
> && BIG_LITTLE && ARM_CPU_TOPOLOGY && HAVE_CLK)
> 
> To fix this make ARM_VEXPRESS_SPC_CPUFREQ dependent on ARM_BIG_LITTLE_CPUFREQ
> instead of selecting it.
> 
> This also moves entry for ARM_VEXPRESS_SPC_CPUFREQ along with other big LITTLE
> config entries.
> 
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
> Hi Rafael,

Hi,

> Both of these are fixes, please see if they can make it to 3.14 only.

Quite frankly, I'm afraid they won't make it.

I'm sending a pull request for -rc7 in a while and I won't add anything to it
without running it through linux-next at least for a day.

And since I'm expecting no -rc8 in this cycle, I have no plans for any pull
requests next week.  At least not for 3.14.

Also I'm going to travel during the last week of March, so probably I'll send
my first pull request for the 3.15 merge window before departure.

Thanks,
Rafael


>  drivers/cpufreq/Kconfig.arm | 17 +++++++++--------
>  1 file changed, 9 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm
> index 3129749..9fb6270 100644
> --- a/drivers/cpufreq/Kconfig.arm
> +++ b/drivers/cpufreq/Kconfig.arm
> @@ -2,6 +2,7 @@
>  # ARM CPU Frequency scaling drivers
>  #
>  
> +# big LITTLE core layer and glue drivers
>  config ARM_BIG_LITTLE_CPUFREQ
>  	tristate "Generic ARM big LITTLE CPUfreq driver"
>  	depends on ARM && BIG_LITTLE && ARM_CPU_TOPOLOGY && HAVE_CLK
> @@ -16,6 +17,14 @@ config ARM_DT_BL_CPUFREQ
>  	  This enables probing via DT for Generic CPUfreq driver for ARM
>  	  big.LITTLE platform. This gets frequency tables from DT.
>  
> +config ARM_VEXPRESS_SPC_CPUFREQ
> +        tristate "Versatile Express SPC based CPUfreq driver"
> +	depends on ARM_BIG_LITTLE_CPUFREQ && ARCH_VEXPRESS_SPC
> +        help
> +          This add the CPUfreq driver support for Versatile Express
> +	  big.LITTLE platforms using SPC for power management.
> +
> +
>  config ARM_EXYNOS_CPUFREQ
>  	bool
>  
> @@ -241,11 +250,3 @@ config ARM_TEGRA_CPUFREQ
>  	default y
>  	help
>  	  This adds the CPUFreq driver support for TEGRA SOCs.
> -
> -config ARM_VEXPRESS_SPC_CPUFREQ
> -        tristate "Versatile Express SPC based CPUfreq driver"
> -        select ARM_BIG_LITTLE_CPUFREQ
> -        depends on ARCH_VEXPRESS_SPC
> -        help
> -          This add the CPUfreq driver support for Versatile Express
> -	  big.LITTLE platforms using SPC for power management.
> 

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

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

end of thread, other threads:[~2014-03-14 12:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-14  6:40 [PATCH 1/2] cpufreq: arm_big_little: make vexpress driver dependent on bL core driver Viresh Kumar
2014-03-14  6:40 ` [PATCH 2/2] cpufreq: arm_big_little: set 'physical_cluster' for each cpu Viresh Kumar
2014-03-14 12:34 ` [PATCH 1/2] cpufreq: arm_big_little: make vexpress driver dependent on bL core driver Rafael J. Wysocki

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).