]> err.no Git - linux-2.6/commitdiff
[ARM] 4567/1: Fix 'Oops - undefined instruction' when CONFIG_VFP=y on non VFP device
authorTzachi Perelstein <tzachi@marvell.com>
Sun, 9 Sep 2007 13:24:59 +0000 (14:24 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 13 Sep 2007 14:10:27 +0000 (15:10 +0100)
vfp_init() takes care of the condition when CONFIG_VFP=y but no real VFP
device exists. However, when this condition is true, a compiler might
misplace code lines in a way that will break this support. (To be more
specific - fmrx(FPSID) might be executed before vfp_testing_entry
assignment, which will end up with Oops - undefined instruction).
This patch adds a barrier() to guarantee the right execution ordering.

Signed-off-by: Assaf Hoffman
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/vfp/vfpmodule.c

index 04ddab2bd876e3485a0857a124a740fa8f0550be..eea3f50743d58b3076592969f5e0cf98b0ecedef 100644 (file)
@@ -323,6 +323,7 @@ static int __init vfp_init(void)
         * we just need to read the VFPSID register.
         */
        vfp_vector = vfp_testing_entry;
+       barrier();
        vfpsid = fmrx(FPSID);
        barrier();
        vfp_vector = vfp_null_entry;