]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ARM: 7417/1: vfp: ensure preemption is disabled when enabling VFP access
authorWill Deacon <will.deacon@arm.com>
Fri, 11 May 2012 16:42:37 +0000 (17:42 +0100)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:35:56 +0000 (08:35 +0200)
commit6748e1aeab75d4306c15f05541f74fa1301590fa
tree265d5380a0c25c2684816f6a34c065cc36e5bcaa
parent2113d3c5625c9fc84c1c8f0162bc16c8ba493884
ARM: 7417/1: vfp: ensure preemption is disabled when enabling VFP access

The vfp_enable function enables access to the VFP co-processor register
space (cp10 and cp11) on the current CPU and must be called with
preemption disabled. Unfortunately, the vfp_init late initcall does not
disable preemption and can lead to an oops during boot if thread
migration occurs at the wrong time and we end up attempting to access
the FPSID on a CPU with VFP access disabled.

This patch fixes the initcall to call vfp_enable from a non-preemptible
context on each CPU and adds a BUG_ON(preemptible) to ensure that any
similar problems are easily spotted in the future.

Cc: stable@vger.kernel.org
Reported-by: Hyungwoo Yang <hwoo.yang@gmail.com>
Signed-off-by: Hyungwoo Yang <hyungwooy@nvidia.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
[Fix merge conflict]
Signed-off-by: Jason Liu <r64343@freescale.com>
arch/arm/vfp/vfpmodule.c