From: Ralf Baechle Date: Thu, 20 Oct 2005 21:55:26 +0000 (+0100) Subject: Hack to resolve longstanding prefetch issue X-Git-Tag: upstream/snapshot3+hdmi~45543^2~1^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e5adb8770e12169a6595a3ad5682541441bd1052;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git Hack to resolve longstanding prefetch issue Prefetching may be fatal on some systems if we're prefetching beyond the end of memory on some systems. It's also a seriously bad idea on non dma-coherent systems. Signed-off-by: Ralf Baechle --- diff --git a/arch/mips/lib/memcpy.S b/arch/mips/lib/memcpy.S index a78865f..7f9aafa 100644 --- a/arch/mips/lib/memcpy.S +++ b/arch/mips/lib/memcpy.S @@ -13,6 +13,21 @@ * Mnemonic names for arguments to memcpy/__copy_user */ #include + +/* + * Hack to resolve longstanding prefetch issue + * + * Prefetching may be fatal on some systems if we're prefetching beyond the + * end of memory on some systems. It's also a seriously bad idea on non + * dma-coherent systems. + */ +#if !defined(CONFIG_DMA_COHERENT) || !defined(CONFIG_DMA_IP27) +#undef CONFIG_CPU_HAS_PREFETCH +#endif +#ifdef CONFIG_MIPS_MALTA +#undef CONFIG_CPU_HAS_PREFETCH +#endif + #include #include #include