summaryrefslogtreecommitdiff
path: root/arch/arm
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2024-10-02 17:16:33 +0100
committerRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2024-11-12 16:41:47 +0000
commitb54cdbad4a39bb3abc85ac151f4882b3d92c5d79 (patch)
tree694982cbbb63ba97da68b090dbc86f72a6399404 /arch/arm
parentf26bdbe1fa9f79fa8cb0d0bf39303c3573c60552 (diff)
downloadlwn-b54cdbad4a39bb3abc85ac151f4882b3d92c5d79.tar.gz
lwn-b54cdbad4a39bb3abc85ac151f4882b3d92c5d79.zip
ARM: 9424/1: vfp: Use vfp_state_hold() in vfp_sync_hwstate().
vfp_sync_hwstate() uses preempt_disable() followed by local_bh_disable() to ensure that it won't get interrupted while checking the VFP state. This harms PREEMPT_RT because softirq handling can get preempted and local_bh_disable() synchronizes the related section with a sleeping lock which does not work with disabled preemption. Use the vfp_state_hold() to synchronize the access. Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/vfp/vfpmodule.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index 63de164c7fc7..1726db050076 100644
--- a/arch/arm/vfp/vfpmodule.c
+++ b/arch/arm/vfp/vfpmodule.c
@@ -540,11 +540,9 @@ static inline void vfp_pm_init(void) { }
*/
void vfp_sync_hwstate(struct thread_info *thread)
{
- unsigned int cpu = get_cpu();
-
- local_bh_disable();
+ vfp_state_hold();
- if (vfp_state_in_hw(cpu, thread)) {
+ if (vfp_state_in_hw(raw_smp_processor_id(), thread)) {
u32 fpexc = fmrx(FPEXC);
/*
@@ -555,8 +553,7 @@ void vfp_sync_hwstate(struct thread_info *thread)
fmxr(FPEXC, fpexc);
}
- local_bh_enable();
- put_cpu();
+ vfp_state_release();
}
/* Ensure that the thread reloads the hardware VFP state on the next use. */