diff options
author | Zhang Zhuoyu <Zhuoyu.Zhang@freescale.com> | 2014-11-07 08:19:25 (GMT) |
---|---|---|
committer | Matthew Weigel <Matthew.Weigel@freescale.com> | 2014-12-11 18:40:45 (GMT) |
commit | 848bd2ca142638debffb775b66b589709f5b9611 (patch) | |
tree | b3f926e71bc534f4b021cf9d1e6eb94ee77398f1 | |
parent | 1ab70dfe9a71fe0907ed13d88c33a47df4388473 (diff) | |
download | linux-fsl-qoriq-848bd2ca142638debffb775b66b589709f5b9611.tar.xz |
powerpc/rcpm: Fix cluster mask calculation issue on e6500
If all cores of a cluster are disabled in u-boot, the cluster mask
we calculate through cpu dts node is unreliable, this patch use
hard cored threads number per cluster to fix it.
Signed-off-by: Zhang Zhuoyu <Zhuoyu.Zhang@freescale.com>
Change-Id: I8c76b4c592bebdacf55dc6c9d50bd65ea0fce89f
Reviewed-on: http://git.am.freescale.net:8181/23340
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Yuantian Tang <yuantian.tang@freescale.com>
Reviewed-by: Hongtao Jia <hongtao.jia@freescale.com>
Reviewed-by: Matthew Weigel <Matthew.Weigel@freescale.com>
-rw-r--r-- | arch/powerpc/sysdev/fsl_rcpm.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/arch/powerpc/sysdev/fsl_rcpm.c b/arch/powerpc/sysdev/fsl_rcpm.c index 8af2e69..6621346 100644 --- a/arch/powerpc/sysdev/fsl_rcpm.c +++ b/arch/powerpc/sysdev/fsl_rcpm.c @@ -244,12 +244,11 @@ static void rcpm_v2_cpu_exit_state(int cpu, int state) static void rcpm_v2_cluster_enter_state(int cpu, int state) { - u32 cpu_on_cluster, cluster_mask; - const struct cpumask *cpumask; + int hw_cpu; + u32 cluster_mask; - cpumask = cpu_cluster_mask(cpu); - cpu_on_cluster = cpu / cpumask_weight(cpumask); - cluster_mask = 1 << cpu_on_cluster; + hw_cpu = get_hard_smp_processor_id(cpu); + cluster_mask = 1 << (hw_cpu / THREAD_IN_CLUSTER); switch (state) { case E500_PM_PCL10: @@ -264,12 +263,11 @@ static void rcpm_v2_cluster_enter_state(int cpu, int state) static void rcpm_v2_cluster_exit_state(int cpu, int state) { - u32 cpu_on_cluster, cluster_mask; - const struct cpumask *cpumask; + int hw_cpu; + u32 cluster_mask; - cpumask = cpu_cluster_mask(cpu); - cpu_on_cluster = cpu / cpumask_weight(cpumask); - cluster_mask = 1 << cpu_on_cluster; + hw_cpu = get_hard_smp_processor_id(cpu); + cluster_mask = 1 << (hw_cpu / THREAD_IN_CLUSTER); switch (state) { case E500_PM_PCL10: |