From: elder@linaro.org (Alex Elder)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 05/10] ARM: bcm: don't special-case CPU 0 in bcm_kona_smc()
Date: Mon, 21 Apr 2014 16:53:06 -0500 [thread overview]
Message-ID: <1398117191-2433-6-git-send-email-elder@linaro.org> (raw)
In-Reply-To: <1398117191-2433-1-git-send-email-elder@linaro.org>
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>
---
arch/arm/mach-bcm/bcm_kona_smc.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/arch/arm/mach-bcm/bcm_kona_smc.c b/arch/arm/mach-bcm/bcm_kona_smc.c
index 47cf360..6fdcf96 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,
* Due to a limitation of the secure monitor, we must use the SMP
* infrastructure to forward all secure monitor calls to Core 0.
*/
- if (get_cpu() != 0)
- smp_call_function_single(0, __bcm_kona_smc, (void *)&data, 1);
- else
- __bcm_kona_smc(&data);
-
- put_cpu();
+ smp_call_function_single(0, __bcm_kona_smc, &data, 1);
return data.result;
}
--
1.9.1
next prev parent reply other threads:[~2014-04-21 21:53 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-21 21:53 [PATCH v2 00/10] ARM: bcm: SCM and L2 cache code cleanup Alex Elder
2014-04-21 21:53 ` [PATCH v2 01/10] ARM: bcm: use memory accessors for ioremapped area Alex Elder
2014-04-21 21:53 ` [PATCH v2 02/10] ARM: bcm: err, don't BUG() on SMC init failures Alex Elder
2014-04-21 21:53 ` [PATCH v2 03/10] ARM: bcm: clean up SMC code Alex Elder
2014-04-21 21:53 ` [PATCH v2 04/10] ARM: bcm: have bcm_kona_smc() return request result Alex Elder
2014-04-21 21:53 ` Alex Elder [this message]
2014-04-21 21:53 ` [PATCH v2 06/10] ARM: bcm: config option for l2 cache support Alex Elder
2014-04-21 21:53 ` [PATCH v2 07/10] ARM: bcm: tidy up a few includes Alex Elder
2014-04-21 21:53 ` [PATCH v2 08/10] ARM: bcm: use inline assembly for "smc" request Alex Elder
2014-04-21 21:53 ` [PATCH v2 09/10] ARM: bcm: rewrite commentary for bcm_kona_do_smc() Alex Elder
2014-04-21 21:53 ` [PATCH v2 10/10] ARM: bcm: rename "kona.h" and "kona.c" Alex Elder
2014-04-25 13:51 ` [PATCH v2 00/10] ARM: bcm: SCM and L2 cache code cleanup Matt Porter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1398117191-2433-6-git-send-email-elder@linaro.org \
--to=elder@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).