diff options
Diffstat (limited to 'driver/gator_iks.c')
-rw-r--r-- | driver/gator_iks.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/driver/gator_iks.c b/driver/gator_iks.c index 6f45c54..ed2c6dd 100644 --- a/driver/gator_iks.c +++ b/driver/gator_iks.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /** | 1 | /** |
2 | * Copyright (C) ARM Limited 2010-2013. All rights reserved. | 2 | * Copyright (C) ARM Limited 2013. All rights reserved. |
3 | * | 3 | * |
4 | * This program is free software; you can redistribute it and/or modify | 4 | * This program is free software; you can redistribute it and/or modify |
5 | * it under the terms of the GNU General Public License version 2 as | 5 | * it under the terms of the GNU General Public License version 2 as |
@@ -14,6 +14,7 @@ | |||
14 | #include <asm/smp_plat.h> | 14 | #include <asm/smp_plat.h> |
15 | #include <trace/events/power_cpu_migrate.h> | 15 | #include <trace/events/power_cpu_migrate.h> |
16 | 16 | ||
17 | static bool map_cpuids; | ||
17 | static int mpidr_cpuids[NR_CPUS]; | 18 | static int mpidr_cpuids[NR_CPUS]; |
18 | static int __lcpu_to_pcpu[NR_CPUS]; | 19 | static int __lcpu_to_pcpu[NR_CPUS]; |
19 | 20 | ||
@@ -40,7 +41,7 @@ static void calc_first_cluster_size(void) | |||
40 | ++mpidr_cpuids_count; | 41 | ++mpidr_cpuids_count; |
41 | } | 42 | } |
42 | 43 | ||
43 | BUG_ON(mpidr_cpuids_count != nr_cpu_ids); | 44 | map_cpuids = (mpidr_cpuids_count == nr_cpu_ids); |
44 | } | 45 | } |
45 | 46 | ||
46 | static int linearize_mpidr(int mpidr) | 47 | static int linearize_mpidr(int mpidr) |
@@ -58,6 +59,10 @@ static int linearize_mpidr(int mpidr) | |||
58 | int lcpu_to_pcpu(const int lcpu) | 59 | int lcpu_to_pcpu(const int lcpu) |
59 | { | 60 | { |
60 | int pcpu; | 61 | int pcpu; |
62 | |||
63 | if (!map_cpuids) | ||
64 | return lcpu; | ||
65 | |||
61 | BUG_ON(lcpu >= nr_cpu_ids || lcpu < 0); | 66 | BUG_ON(lcpu >= nr_cpu_ids || lcpu < 0); |
62 | pcpu = __lcpu_to_pcpu[lcpu]; | 67 | pcpu = __lcpu_to_pcpu[lcpu]; |
63 | BUG_ON(pcpu >= nr_cpu_ids || pcpu < 0); | 68 | BUG_ON(pcpu >= nr_cpu_ids || pcpu < 0); |
@@ -67,6 +72,10 @@ int lcpu_to_pcpu(const int lcpu) | |||
67 | int pcpu_to_lcpu(const int pcpu) | 72 | int pcpu_to_lcpu(const int pcpu) |
68 | { | 73 | { |
69 | int lcpu; | 74 | int lcpu; |
75 | |||
76 | if (!map_cpuids) | ||
77 | return pcpu; | ||
78 | |||
70 | BUG_ON(pcpu >= nr_cpu_ids || pcpu < 0); | 79 | BUG_ON(pcpu >= nr_cpu_ids || pcpu < 0); |
71 | for (lcpu = 0; lcpu < nr_cpu_ids; ++lcpu) { | 80 | for (lcpu = 0; lcpu < nr_cpu_ids; ++lcpu) { |
72 | if (__lcpu_to_pcpu[lcpu] == pcpu) { | 81 | if (__lcpu_to_pcpu[lcpu] == pcpu) { |
@@ -114,6 +123,10 @@ GATOR_DEFINE_PROBE(cpu_migrate_current, TP_PROTO(u64 timestamp, u32 cpu_hwid)) | |||
114 | static int gator_migrate_start(void) | 123 | static int gator_migrate_start(void) |
115 | { | 124 | { |
116 | int retval = 0; | 125 | int retval = 0; |
126 | |||
127 | if (!map_cpuids) | ||
128 | return retval; | ||
129 | |||
117 | if (retval == 0) | 130 | if (retval == 0) |
118 | retval = GATOR_REGISTER_TRACE(cpu_migrate_begin); | 131 | retval = GATOR_REGISTER_TRACE(cpu_migrate_begin); |
119 | if (retval == 0) | 132 | if (retval == 0) |
@@ -130,6 +143,9 @@ static int gator_migrate_start(void) | |||
130 | 143 | ||
131 | static void gator_migrate_stop(void) | 144 | static void gator_migrate_stop(void) |
132 | { | 145 | { |
146 | if (!map_cpuids) | ||
147 | return; | ||
148 | |||
133 | GATOR_UNREGISTER_TRACE(cpu_migrate_current); | 149 | GATOR_UNREGISTER_TRACE(cpu_migrate_current); |
134 | GATOR_UNREGISTER_TRACE(cpu_migrate_finish); | 150 | GATOR_UNREGISTER_TRACE(cpu_migrate_finish); |
135 | GATOR_UNREGISTER_TRACE(cpu_migrate_begin); | 151 | GATOR_UNREGISTER_TRACE(cpu_migrate_begin); |