Skip to content

Commit b54cdba

Browse files
Sebastian Andrzej SiewiorRussell King (Oracle)
authored andcommitted
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 <[email protected]> Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Russell King (Oracle) <[email protected]>
1 parent f26bdbe commit b54cdba

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

arch/arm/vfp/vfpmodule.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -540,11 +540,9 @@ static inline void vfp_pm_init(void) { }
540540
*/
541541
void vfp_sync_hwstate(struct thread_info *thread)
542542
{
543-
unsigned int cpu = get_cpu();
544-
545-
local_bh_disable();
543+
vfp_state_hold();
546544

547-
if (vfp_state_in_hw(cpu, thread)) {
545+
if (vfp_state_in_hw(raw_smp_processor_id(), thread)) {
548546
u32 fpexc = fmrx(FPEXC);
549547

550548
/*
@@ -555,8 +553,7 @@ void vfp_sync_hwstate(struct thread_info *thread)
555553
fmxr(FPEXC, fpexc);
556554
}
557555

558-
local_bh_enable();
559-
put_cpu();
556+
vfp_state_release();
560557
}
561558

562559
/* Ensure that the thread reloads the hardware VFP state on the next use. */

0 commit comments

Comments
 (0)