Skip to content

Commit 7f066a2

Browse files
committed
mips/cpu: Switch to arch_cpu_finalize_init()
check_bugs() is about to be phased out. Switch over to the new arch_cpu_finalize_init() implementation. No functional change. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/20230613224545.312438573@linutronix.de
1 parent 9ceecc2 commit 7f066a2

File tree

3 files changed

+14
-17
lines changed

3 files changed

+14
-17
lines changed

arch/mips/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ config MIPS
44
default y
55
select ARCH_32BIT_OFF_T if !64BIT
66
select ARCH_BINFMT_ELF_STATE if MIPS_FP_SUPPORT
7+
select ARCH_HAS_CPU_FINALIZE_INIT
78
select ARCH_HAS_CURRENT_STACK_POINTER if !CC_IS_CLANG || CLANG_VERSION >= 140000
89
select ARCH_HAS_DEBUG_VIRTUAL if !64BIT
910
select ARCH_HAS_FORTIFY_SOURCE

arch/mips/include/asm/bugs.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
/* SPDX-License-Identifier: GPL-2.0 */
22
/*
3-
* This is included by init/main.c to check for architecture-dependent bugs.
4-
*
53
* Copyright (C) 2007 Maciej W. Rozycki
6-
*
7-
* Needs:
8-
* void check_bugs(void);
94
*/
105
#ifndef _ASM_BUGS_H
116
#define _ASM_BUGS_H
127

138
#include <linux/bug.h>
14-
#include <linux/delay.h>
159
#include <linux/smp.h>
1610

1711
#include <asm/cpu.h>
@@ -24,17 +18,6 @@ extern void check_bugs64_early(void);
2418
extern void check_bugs32(void);
2519
extern void check_bugs64(void);
2620

27-
static inline void __init check_bugs(void)
28-
{
29-
unsigned int cpu = smp_processor_id();
30-
31-
cpu_data[cpu].udelay_val = loops_per_jiffy;
32-
check_bugs32();
33-
34-
if (IS_ENABLED(CONFIG_CPU_R4X00_BUGS64))
35-
check_bugs64();
36-
}
37-
3821
static inline int r4k_daddiu_bug(void)
3922
{
4023
if (!IS_ENABLED(CONFIG_CPU_R4X00_BUGS64))

arch/mips/kernel/setup.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
* Copyright (C) 2000, 2001, 2002, 2007 Maciej W. Rozycki
1212
*/
1313
#include <linux/init.h>
14+
#include <linux/cpu.h>
15+
#include <linux/delay.h>
1416
#include <linux/ioport.h>
1517
#include <linux/export.h>
1618
#include <linux/screen_info.h>
@@ -840,3 +842,14 @@ static int __init setnocoherentio(char *str)
840842
}
841843
early_param("nocoherentio", setnocoherentio);
842844
#endif
845+
846+
void __init arch_cpu_finalize_init(void)
847+
{
848+
unsigned int cpu = smp_processor_id();
849+
850+
cpu_data[cpu].udelay_val = loops_per_jiffy;
851+
check_bugs32();
852+
853+
if (IS_ENABLED(CONFIG_CPU_R4X00_BUGS64))
854+
check_bugs64();
855+
}

0 commit comments

Comments
 (0)