@@ -11,11 +11,6 @@ void arch_sync_dma_for_cpu_all(void)
{
u32 cfg;
- if (boot_cpu_type() != CPU_BMIPS3300 &&
- boot_cpu_type() != CPU_BMIPS4350 &&
- boot_cpu_type() != CPU_BMIPS4380)
- return;
-
if (unlikely(bmips_rac_flush_disable))
return;
@@ -40,7 +40,6 @@
* with "mips-cbr-reg" in the "cpus" node.
*/
void __iomem *bmips_cbr_addr;
-extern bool bmips_rac_flush_disable;
static const unsigned long kbase = VMLINUX_LOAD_ADDRESS & 0xfff00000;
@@ -82,6 +82,7 @@ extern char bmips_smp_int_vec[];
extern char bmips_smp_int_vec_end[];
extern void __iomem *bmips_cbr_addr;
+extern bool bmips_rac_flush_disable;
extern int bmips_smp_enabled;
extern int bmips_cpu_offset;
extern cpumask_t bmips_booted_mask;
@@ -681,6 +681,13 @@ void bmips_cpu_setup(void)
" or $8, $9\n"
" .word 0x4088b008\n" /* mtc0 $8, $22, 8 */
: : : "$8", "$9");
+
+ /* Disable RAC flush as not supported */
+ bmips_rac_flush_disable = true;
break;
+
+ default:
+ /* Disable RAC flush as not supported */
+ bmips_rac_flush_disable = true;
}
}
Drop redundant boot_cpu_type in arch_sync_dma_for_cpu_all. These needs to be parsed only once and we can make use of bmips_rac_flush_disable to disable RAC flush on unsupported CPU. Set this value in bmips_cpu_setup for unsupported CPU to skip this redundant check every time DMA needs to be synced. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> --- arch/mips/bmips/dma.c | 5 ----- arch/mips/bmips/setup.c | 1 - arch/mips/include/asm/bmips.h | 1 + arch/mips/kernel/smp-bmips.c | 7 +++++++ 4 files changed, 8 insertions(+), 6 deletions(-)