diff options
author | David Daney <david.daney@cavium.com> | 2012-05-15 03:04:50 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2012-05-16 17:34:34 -0400 |
commit | 6650df3c380e0db558dbfec63ed860402c6afb2a (patch) | |
tree | e63f022dbb69c5920fd734aecb44cf8c7a225b51 | |
parent | 9cd9669bd60ee41d34d1b41d7a0b884806939d7b (diff) |
MIPS: Move cache setup to setup_arch().
commit 97ce2c88f9ad42e3c60a9beb9fca87abf3639faa (jump-label: initialize
jump-label subsystem much earlier) breaks MIPS. The jump_label_init()
call was moved before trap_init() which is where we initialize
flush_icache_range().
In order to be good citizens, we move cache initialization earlier so
that we don't jump through a null flush_icache_range function pointer
when doing the jump label initialization.
Signed-off-by: David Daney <david.daney@cavium.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/3822/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r-- | arch/mips/include/asm/setup.h | 3 | ||||
-rw-r--r-- | arch/mips/kernel/setup.c | 2 | ||||
-rw-r--r-- | arch/mips/kernel/smp.c | 2 | ||||
-rw-r--r-- | arch/mips/kernel/traps.c | 9 |
4 files changed, 10 insertions, 6 deletions
diff --git a/arch/mips/include/asm/setup.h b/arch/mips/include/asm/setup.h index 6dce6d8d09ab..2560b6b6a7d8 100644 --- a/arch/mips/include/asm/setup.h +++ b/arch/mips/include/asm/setup.h | |||
@@ -14,7 +14,8 @@ extern void *set_vi_handler(int n, vi_handler_t addr); | |||
14 | 14 | ||
15 | extern void *set_except_vector(int n, void *addr); | 15 | extern void *set_except_vector(int n, void *addr); |
16 | extern unsigned long ebase; | 16 | extern unsigned long ebase; |
17 | extern void per_cpu_trap_init(void); | 17 | extern void per_cpu_trap_init(bool); |
18 | extern void cpu_cache_init(void); | ||
18 | 19 | ||
19 | #endif /* __KERNEL__ */ | 20 | #endif /* __KERNEL__ */ |
20 | 21 | ||
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c index c504b212f8f3..a53f8ec37aac 100644 --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c | |||
@@ -605,6 +605,8 @@ void __init setup_arch(char **cmdline_p) | |||
605 | 605 | ||
606 | resource_init(); | 606 | resource_init(); |
607 | plat_smp_setup(); | 607 | plat_smp_setup(); |
608 | |||
609 | cpu_cache_init(); | ||
608 | } | 610 | } |
609 | 611 | ||
610 | unsigned long kernelsp[NR_CPUS]; | 612 | unsigned long kernelsp[NR_CPUS]; |
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c index ba9376bf52a1..dc019a1f128d 100644 --- a/arch/mips/kernel/smp.c +++ b/arch/mips/kernel/smp.c | |||
@@ -106,7 +106,7 @@ asmlinkage __cpuinit void start_secondary(void) | |||
106 | #endif /* CONFIG_MIPS_MT_SMTC */ | 106 | #endif /* CONFIG_MIPS_MT_SMTC */ |
107 | cpu_probe(); | 107 | cpu_probe(); |
108 | cpu_report(); | 108 | cpu_report(); |
109 | per_cpu_trap_init(); | 109 | per_cpu_trap_init(false); |
110 | mips_clockevent_init(); | 110 | mips_clockevent_init(); |
111 | mp_ops->init_secondary(); | 111 | mp_ops->init_secondary(); |
112 | 112 | ||
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index 24325780f831..8e3488afbcc1 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c | |||
@@ -1490,7 +1490,6 @@ void *set_vi_handler(int n, vi_handler_t addr) | |||
1490 | return set_vi_srs_handler(n, addr, 0); | 1490 | return set_vi_srs_handler(n, addr, 0); |
1491 | } | 1491 | } |
1492 | 1492 | ||
1493 | extern void cpu_cache_init(void); | ||
1494 | extern void tlb_init(void); | 1493 | extern void tlb_init(void); |
1495 | extern void flush_tlb_handlers(void); | 1494 | extern void flush_tlb_handlers(void); |
1496 | 1495 | ||
@@ -1517,7 +1516,7 @@ static int __init ulri_disable(char *s) | |||
1517 | } | 1516 | } |
1518 | __setup("noulri", ulri_disable); | 1517 | __setup("noulri", ulri_disable); |
1519 | 1518 | ||
1520 | void __cpuinit per_cpu_trap_init(void) | 1519 | void __cpuinit per_cpu_trap_init(bool is_boot_cpu) |
1521 | { | 1520 | { |
1522 | unsigned int cpu = smp_processor_id(); | 1521 | unsigned int cpu = smp_processor_id(); |
1523 | unsigned int status_set = ST0_CU0; | 1522 | unsigned int status_set = ST0_CU0; |
@@ -1616,7 +1615,9 @@ void __cpuinit per_cpu_trap_init(void) | |||
1616 | #ifdef CONFIG_MIPS_MT_SMTC | 1615 | #ifdef CONFIG_MIPS_MT_SMTC |
1617 | if (bootTC) { | 1616 | if (bootTC) { |
1618 | #endif /* CONFIG_MIPS_MT_SMTC */ | 1617 | #endif /* CONFIG_MIPS_MT_SMTC */ |
1619 | cpu_cache_init(); | 1618 | /* Boot CPU's cache setup in setup_arch(). */ |
1619 | if (!is_boot_cpu) | ||
1620 | cpu_cache_init(); | ||
1620 | tlb_init(); | 1621 | tlb_init(); |
1621 | #ifdef CONFIG_MIPS_MT_SMTC | 1622 | #ifdef CONFIG_MIPS_MT_SMTC |
1622 | } else if (!secondaryTC) { | 1623 | } else if (!secondaryTC) { |
@@ -1693,7 +1694,7 @@ void __init trap_init(void) | |||
1693 | 1694 | ||
1694 | if (board_ebase_setup) | 1695 | if (board_ebase_setup) |
1695 | board_ebase_setup(); | 1696 | board_ebase_setup(); |
1696 | per_cpu_trap_init(); | 1697 | per_cpu_trap_init(true); |
1697 | 1698 | ||
1698 | /* | 1699 | /* |
1699 | * Copy the generic exception handlers to their final destination. | 1700 | * Copy the generic exception handlers to their final destination. |