diff options
author | Alex Elder <elder@linaro.org> | 2014-04-21 17:53:06 -0400 |
---|---|---|
committer | Matt Porter <mporter@linaro.org> | 2014-04-25 08:51:34 -0400 |
commit | 35138d52f18c3f757f12d54c0962a755bcf218f3 (patch) | |
tree | 9f54b9de887b4dfb54d89c68899db79c4eb2d193 | |
parent | 6c90f10864d1f7492ebe4c90465a9c9797ce649e (diff) |
ARM: bcm: don't special-case CPU 0 in bcm_kona_smc()
There's logic in bcm_kona_smc() to ensure __bcm_kona_smc() gets
called on CPU 0; if already executing on CPU 0, that function is
called directly. The direct call is not protected from interrupts,
however, which is not safe.
Note that smp_call_function_single() is designed to handle the case
where the target cpu is the current one. It also gets a reference
to the CPU and disables IRQs across the call.
So we can simplify things and at the same time be protected against
interrupts by calling smp_call_function_single() unconditionally.
Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Tim Kryger <tim.kryger@linaro.org>
Reviewed-by: Markus Mayer <markus.mayer@linaro.org>
Reviewed-by: Matt Porter <mporter@linaro.org>
Signed-off-by: Matt Porter <mporter@linaro.org>
-rw-r--r-- | arch/arm/mach-bcm/bcm_kona_smc.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/arch/arm/mach-bcm/bcm_kona_smc.c b/arch/arm/mach-bcm/bcm_kona_smc.c index 47cf360f985b..6fdcf96ca54e 100644 --- a/arch/arm/mach-bcm/bcm_kona_smc.c +++ b/arch/arm/mach-bcm/bcm_kona_smc.c | |||
@@ -114,12 +114,7 @@ unsigned bcm_kona_smc(unsigned service_id, unsigned arg0, unsigned arg1, | |||
114 | * Due to a limitation of the secure monitor, we must use the SMP | 114 | * Due to a limitation of the secure monitor, we must use the SMP |
115 | * infrastructure to forward all secure monitor calls to Core 0. | 115 | * infrastructure to forward all secure monitor calls to Core 0. |
116 | */ | 116 | */ |
117 | if (get_cpu() != 0) | 117 | smp_call_function_single(0, __bcm_kona_smc, &data, 1); |
118 | smp_call_function_single(0, __bcm_kona_smc, (void *)&data, 1); | ||
119 | else | ||
120 | __bcm_kona_smc(&data); | ||
121 | |||
122 | put_cpu(); | ||
123 | 118 | ||
124 | return data.result; | 119 | return data.result; |
125 | } | 120 | } |