Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+17
+4
arch/arm/include/asm/vfp.h
··· 91 91 #define VFPOPDESC_UNUSED_MASK (0xFF << VFPOPDESC_UNUSED_BIT) 92 92 #define VFPOPDESC_OPDESC_MASK (~(VFPOPDESC_LENGTH_MASK | VFPOPDESC_UNUSED_MASK)) 93 93 94 + #ifndef __ASSEMBLY__ 95 + void vfp_disable(void); 96 + #endif 97 + 94 98 #endif /* __ASM_VFP_H */
+13
arch/arm/vfp/vfpmodule.c
··· 445 445 set_copro_access(access | CPACC_FULL(10) | CPACC_FULL(11)); 446 446 } 447 447 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 + 448 461 #ifdef CONFIG_CPU_PM 449 462 static int vfp_pm_suspend(void) 450 463 {