Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: smp-cps: Fix entry code cache flush for systems with coherent I/O

The dma_cache_wback_inv function performs exactly as is required here,
unless the system has coherent I/O in which case it's a no-op. Call the
underlying cache writeback functions directly, which is arguably clearer
anyway given that the code doesn't actually have anything to do with
DMA in a strict sense.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/7282/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Paul Burton and committed by
Ralf Baechle
0fc0708a c90e49f2

+7 -3
+7 -3
arch/mips/kernel/smp-cps.c
··· 14 14 #include <linux/smp.h> 15 15 #include <linux/types.h> 16 16 17 - #include <asm/cacheflush.h> 17 + #include <asm/bcache.h> 18 18 #include <asm/gic.h> 19 19 #include <asm/mips-cm.h> 20 20 #include <asm/mips-cpc.h> 21 21 #include <asm/mips_mt.h> 22 22 #include <asm/mipsregs.h> 23 23 #include <asm/pm-cps.h> 24 + #include <asm/r4kcache.h> 24 25 #include <asm/smp-cps.h> 25 26 #include <asm/time.h> 26 27 #include <asm/uasm.h> ··· 133 132 entry_code = (u32 *)&mips_cps_core_entry; 134 133 UASM_i_LA(&entry_code, 3, (long)mips_cm_base); 135 134 uasm_i_addiu(&entry_code, 16, 0, cca); 136 - dma_cache_wback_inv((unsigned long)&mips_cps_core_entry, 137 - (void *)entry_code - (void *)&mips_cps_core_entry); 135 + blast_dcache_range((unsigned long)&mips_cps_core_entry, 136 + (unsigned long)entry_code); 137 + bc_wback_inv((unsigned long)&mips_cps_core_entry, 138 + (void *)entry_code - (void *)&mips_cps_core_entry); 139 + __sync(); 138 140 139 141 /* Allocate core boot configuration structs */ 140 142 mips_cps_core_bootcfg = kcalloc(ncores, sizeof(*mips_cps_core_bootcfg),