From: f.fainelli@gmail.com (Florian Fainelli)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 8/9] ARM: vfp: Add vfp_disable for problematic platforms
Date: Thu, 23 Apr 2015 16:10:01 -0700 [thread overview]
Message-ID: <1429830602-10988-9-git-send-email-f.fainelli@gmail.com> (raw)
In-Reply-To: <1429830602-10988-1-git-send-email-f.fainelli@gmail.com>
Some platforms might not be able to fully utilize VFP when e.g: one CPU
out of two in a SMP complex lacks a VFP unit. Adding code to migrate
task to the CPU which has a VFP unit would be cumbersome and not
performant, instead, just add the ability to disable VFP.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
arch/arm/include/asm/vfp.h | 4 ++++
arch/arm/vfp/vfpmodule.c | 13 +++++++++++++
2 files changed, 17 insertions(+)
diff --git a/arch/arm/include/asm/vfp.h b/arch/arm/include/asm/vfp.h
index 03f9ca3cdfa4..22e414056a8c 100644
--- a/arch/arm/include/asm/vfp.h
+++ b/arch/arm/include/asm/vfp.h
@@ -91,4 +91,8 @@
#define VFPOPDESC_UNUSED_MASK (0xFF << VFPOPDESC_UNUSED_BIT)
#define VFPOPDESC_OPDESC_MASK (~(VFPOPDESC_LENGTH_MASK | VFPOPDESC_UNUSED_MASK))
+#ifndef __ASSEMBLY__
+void vfp_disable(void);
+#endif
+
#endif /* __ASM_VFP_H */
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index f6e4d56eda00..2a61e4b04600 100644
--- a/arch/arm/vfp/vfpmodule.c
+++ b/arch/arm/vfp/vfpmodule.c
@@ -445,6 +445,19 @@ static void vfp_enable(void *unused)
set_copro_access(access | CPACC_FULL(10) | CPACC_FULL(11));
}
+/* Called by platforms on which we want to disable VFP because it may not be
+ * present on all CPUs within a SMP complex. Needs to be called prior to
+ * vfp_init().
+ */
+void vfp_disable(void)
+{
+ if (VFP_arch) {
+ pr_debug("%s: should be called prior to vfp_init\n", __func__);
+ return;
+ }
+ VFP_arch = 1;
+}
+
#ifdef CONFIG_CPU_PM
static int vfp_pm_suspend(void)
{
--
2.1.0
next prev parent reply other threads:[~2015-04-23 23:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-23 23:09 [PATCH v2 0/9] ARM: BCM63xx: SMP support (v2) Florian Fainelli
2015-04-23 23:09 ` [PATCH v2 1/9] Documentation: DT: Add Broadcom BCM63138 PMB binding Florian Fainelli
2015-04-23 23:09 ` [PATCH v2 2/9] ARM: dts: BCM63xx: Add PMB busses nodes Florian Fainelli
2015-04-23 23:09 ` [PATCH v2 3/9] Documentation: DT: Document SMP DT nodes and properties for BCM63138 Florian Fainelli
2015-04-23 23:09 ` [PATCH v2 4/9] ARM: dts: BCM63xx: Add SMP nodes and required properties Florian Fainelli
2015-04-23 23:09 ` [PATCH v2 5/9] ARM: BCM63xx: Add Broadcom BCM63xx PMB controller helpers Florian Fainelli
2015-04-23 23:09 ` [PATCH v2 6/9] ARM: BCM63xx: Add secondary CPU PMB initialization sequence Florian Fainelli
2015-04-23 23:10 ` [PATCH v2 7/9] ARM: vfp: Add include guards Florian Fainelli
2015-04-23 23:10 ` Florian Fainelli [this message]
2015-04-23 23:10 ` [PATCH v2 9/9] ARM: BCM63xx: Add SMP support for BCM63138 Florian Fainelli
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=1429830602-10988-9-git-send-email-f.fainelli@gmail.com \
--to=f.fainelli@gmail.com \
--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).