Skip to content

Commit 1d40cfc

Browse files
committed
Avoid SMP cacheflushes. This is a minor optimization of startup but
will also avoid smp_call_function from doing stupid things when called from a CPU that is not yet marked online. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
1 parent bdf21b1 commit 1d40cfc

5 files changed

Lines changed: 15 additions & 29 deletions

File tree

‎arch/mips/kernel/traps.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,6 +1150,7 @@ static inline void signal32_init(void)
11501150

11511151
extern void cpu_cache_init(void);
11521152
extern void tlb_init(void);
1153+
extern void flush_tlb_handlers(void);
11531154

11541155
void __init per_cpu_trap_init(void)
11551156
{
@@ -1348,4 +1349,5 @@ void __init trap_init(void)
13481349
#endif
13491350

13501351
flush_icache_range(ebase, ebase + 0x400);
1352+
flush_tlb_handlers();
13511353
}

‎arch/mips/mm/c-r4k.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,9 +1270,8 @@ void __init ld_mmu_r4xx0(void)
12701270
_dma_cache_inv = r4k_dma_cache_inv;
12711271
#endif
12721272

1273-
__flush_cache_all();
1274-
coherency_setup();
1275-
12761273
build_clear_page();
12771274
build_copy_page();
1275+
local_r4k___flush_cache_all(NULL);
1276+
coherency_setup();
12781277
}

‎arch/mips/mm/c-tx39.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,4 +492,5 @@ void __init ld_mmu_tx39(void)
492492

493493
build_clear_page();
494494
build_copy_page();
495+
tx39h_flush_icache_all();
495496
}

‎arch/mips/mm/pg-r4k.c‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -404,9 +404,6 @@ dest = label();
404404

405405
build_jr_ra();
406406

407-
flush_icache_range((unsigned long)&clear_page_array,
408-
(unsigned long) epc);
409-
410407
BUG_ON(epc > clear_page_array + ARRAY_SIZE(clear_page_array));
411408
}
412409

@@ -482,8 +479,5 @@ dest = label();
482479

483480
build_jr_ra();
484481

485-
flush_icache_range((unsigned long)&copy_page_array,
486-
(unsigned long) epc);
487-
488482
BUG_ON(epc > copy_page_array + ARRAY_SIZE(copy_page_array));
489483
}

‎arch/mips/mm/tlbex.c‎

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,6 @@ static void __init build_r3000_tlb_refill_handler(void)
743743
#endif
744744

745745
memcpy((void *)CAC_BASE, tlb_handler, 0x80);
746-
flush_icache_range(CAC_BASE, CAC_BASE + 0x80);
747746
}
748747

749748
/*
@@ -1258,7 +1257,6 @@ static void __init build_r4000_tlb_refill_handler(void)
12581257
#endif
12591258

12601259
memcpy((void *)CAC_BASE, final_handler, 0x100);
1261-
flush_icache_range(CAC_BASE, CAC_BASE + 0x100);
12621260
}
12631261

12641262
/*
@@ -1519,9 +1517,6 @@ static void __init build_r3000_tlb_load_handler(void)
15191517
printk("%08x\n", handle_tlbl[i]);
15201518
}
15211519
#endif
1522-
1523-
flush_icache_range((unsigned long)handle_tlbl,
1524-
(unsigned long)handle_tlbl + FASTPATH_SIZE * sizeof(u32));
15251520
}
15261521

15271522
static void __init build_r3000_tlb_store_handler(void)
@@ -1559,9 +1554,6 @@ static void __init build_r3000_tlb_store_handler(void)
15591554
printk("%08x\n", handle_tlbs[i]);
15601555
}
15611556
#endif
1562-
1563-
flush_icache_range((unsigned long)handle_tlbs,
1564-
(unsigned long)handle_tlbs + FASTPATH_SIZE * sizeof(u32));
15651557
}
15661558

15671559
static void __init build_r3000_tlb_modify_handler(void)
@@ -1599,9 +1591,6 @@ static void __init build_r3000_tlb_modify_handler(void)
15991591
printk("%08x\n", handle_tlbm[i]);
16001592
}
16011593
#endif
1602-
1603-
flush_icache_range((unsigned long)handle_tlbm,
1604-
(unsigned long)handle_tlbm + FASTPATH_SIZE * sizeof(u32));
16051594
}
16061595

16071596
/*
@@ -1691,9 +1680,6 @@ static void __init build_r4000_tlb_load_handler(void)
16911680
printk("%08x\n", handle_tlbl[i]);
16921681
}
16931682
#endif
1694-
1695-
flush_icache_range((unsigned long)handle_tlbl,
1696-
(unsigned long)handle_tlbl + FASTPATH_SIZE * sizeof(u32));
16971683
}
16981684

16991685
static void __init build_r4000_tlb_store_handler(void)
@@ -1730,9 +1716,6 @@ static void __init build_r4000_tlb_store_handler(void)
17301716
printk("%08x\n", handle_tlbs[i]);
17311717
}
17321718
#endif
1733-
1734-
flush_icache_range((unsigned long)handle_tlbs,
1735-
(unsigned long)handle_tlbs + FASTPATH_SIZE * sizeof(u32));
17361719
}
17371720

17381721
static void __init build_r4000_tlb_modify_handler(void)
@@ -1770,9 +1753,6 @@ static void __init build_r4000_tlb_modify_handler(void)
17701753
printk("%08x\n", handle_tlbm[i]);
17711754
}
17721755
#endif
1773-
1774-
flush_icache_range((unsigned long)handle_tlbm,
1775-
(unsigned long)handle_tlbm + FASTPATH_SIZE * sizeof(u32));
17761756
}
17771757

17781758
void __init build_tlb_refill_handler(void)
@@ -1820,3 +1800,13 @@ void __init build_tlb_refill_handler(void)
18201800
}
18211801
}
18221802
}
1803+
1804+
void __init flush_tlb_handlers(void)
1805+
{
1806+
flush_icache_range((unsigned long)handle_tlbl,
1807+
(unsigned long)handle_tlbl + sizeof(handle_tlbl));
1808+
flush_icache_range((unsigned long)handle_tlbs,
1809+
(unsigned long)handle_tlbs + sizeof(handle_tlbs));
1810+
flush_icache_range((unsigned long)handle_tlbm,
1811+
(unsigned long)handle_tlbm + sizeof(handle_tlbm));
1812+
}

0 commit comments

Comments
 (0)