Skip to content

Commit

Permalink
[ARM] 4567/1: Fix 'Oops - undefined instruction' when CONFIG_VFP=y on…
Browse files Browse the repository at this point in the history
… non VFP device

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>
  • Loading branch information
Tzachi Perelstein authored and Russell King committed Sep 13, 2007
1 parent a53d6fb commit b9338a7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arch/arm/vfp/vfpmodule.c
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit b9338a7

Please sign in to comment.