Skip to content

Commit 41e486f

Browse files
committed
MIPS: Remove struct mm_context_t fp_mode_switching field
The fp_mode_switching field in struct mm_context_t was left unused by commit 8c8d953 ("MIPS: Schedule on CPUs we need to lose FPU for a mode switch") in v4.19, with nothing modifying its value & nothing waiting on it having any particular value after that commit. Remove the unused field & the one remaining reference to it. Signed-off-by: Paul Burton <paul.burton@mips.com>
1 parent 99bf73e commit 41e486f

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

arch/mips/include/asm/mmu.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
typedef struct {
1010
u64 asid[NR_CPUS];
1111
void *vdso;
12-
atomic_t fp_mode_switching;
1312

1413
/* lock to be held whilst modifying fp_bd_emupage_allocmap */
1514
spinlock_t bd_emupage_lock;

arch/mips/kernel/process.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -737,10 +737,9 @@ static long prepare_for_fp_mode_switch(void *unused)
737737
/*
738738
* This is icky, but we use this to simply ensure that all CPUs have
739739
* context switched, regardless of whether they were previously running
740-
* kernel or user code. This ensures that no CPU currently has its FPU
741-
* enabled, or is about to attempt to enable it through any path other
742-
* than enable_restore_fp_context() which will wait appropriately for
743-
* fp_mode_switching to be zero.
740+
* kernel or user code. This ensures that no CPU that a mode-switching
741+
* program may execute on keeps its FPU enabled (& in the old mode)
742+
* throughout the mode switch.
744743
*/
745744
return 0;
746745
}
@@ -829,8 +828,6 @@ int mips_set_process_fp_mode(struct task_struct *task, unsigned int value)
829828
work_on_cpu(cpu, prepare_for_fp_mode_switch, NULL);
830829
put_online_cpus();
831830

832-
wake_up_var(&task->mm->context.fp_mode_switching);
833-
834831
return 0;
835832
}
836833

0 commit comments

Comments
 (0)