Skip to content

Commit 7d7d7a4

Browse files
committed
ARM: vfp: Add vfp_disable for problematic platforms
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>
1 parent e7f0f37 commit 7d7d7a4

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

‎arch/arm/include/asm/vfp.h‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,8 @@
9191
#define VFPOPDESC_UNUSED_MASK (0xFF << VFPOPDESC_UNUSED_BIT)
9292
#define VFPOPDESC_OPDESC_MASK (~(VFPOPDESC_LENGTH_MASK | VFPOPDESC_UNUSED_MASK))
9393

94+
#ifndef __ASSEMBLY__
95+
void vfp_disable(void);
96+
#endif
97+
9498
#endif /* __ASM_VFP_H */

‎arch/arm/vfp/vfpmodule.c‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,19 @@ static void vfp_enable(void *unused)
445445
set_copro_access(access | CPACC_FULL(10) | CPACC_FULL(11));
446446
}
447447

448+
/* Called by platforms on which we want to disable VFP because it may not be
449+
* present on all CPUs within a SMP complex. Needs to be called prior to
450+
* vfp_init().
451+
*/
452+
void vfp_disable(void)
453+
{
454+
if (VFP_arch) {
455+
pr_debug("%s: should be called prior to vfp_init\n", __func__);
456+
return;
457+
}
458+
VFP_arch = 1;
459+
}
460+
448461
#ifdef CONFIG_CPU_PM
449462
static int vfp_pm_suspend(void)
450463
{

0 commit comments

Comments
 (0)