MIPS: DMA: For BMIPS5000 cores flush region just like non-coherent R10000
authorJim Quinlan <jim2101024@gmail.com>
Tue, 27 Aug 2013 20:57:51 +0000 (16:57 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Dec 2013 15:45:06 +0000 (07:45 -0800)
commitf8d29bed8aecf9b0cfe56c5740855b31c2ea0390
tree3c21ef93d3b2fa8800bbd43b26e5fb92d8e06c92
parent05bcf8f867f4af11c93395d4a6dd1dd52d8904ea
MIPS: DMA: For BMIPS5000 cores flush region just like non-coherent R10000

commit f86f55d3ad21b21b736bdeb29bee0f0937b77138 upstream.

The BMIPS5000 (Zephyr) processor utilizes instruction speculation. A
stale misprediction address in either the JTB or the CRS may trigger
a prefetch inside a region that is currently being used by a DMA engine,
which is not IO-coherent.  This prefetch will fetch a line into the
scache, and that line will soon become stale (ie wrong) during/after the
DMA.  Mayhem ensues.

In dma-default.c, the r10000 is handled as a special case in the same way
that we want to handle Zephyr.  So we generalize the exception cases into
a function, and include Zephyr as one of the processors that needs this
special care.

Signed-off-by: Jim Quinlan <jim2101024@gmail.com>
Cc: linux-mips@linux-mips.org
Cc: cernekee@gmail.com
Patchwork: https://patchwork.linux-mips.org/patch/5776/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Cc: John Ulvr <julvr@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/mips/mm/dma-default.c