Skip to contentSkip to conversation

MIPS: R14000: Add missing CPU_R14000 reference in cpu_needs_post_dma_flush()

PATCH In review Joshua Kinard 2 participants 3 messages Oct 8, 2014 – Nov 12, 2014 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MIPS: R14000: Add missing CPU_R14000 reference in cpu_needs_post_dma_flush()

cpu_needs_post_dma_flush() in arch/mips/mm/dma-default.c is missing a check for CPU_R14000, where it already has checks for CPU_R10000 and CPU_R12000. This patch adds the missing CPU_R14000 check.

---
 arch/mips/mm/dma-default.c |    1 +
 1 file changed, 1 insertion(+)
arch/mips/mm/dma-default.c +1 -0
index 44b6dff..3693c91 100644
@@ -66,6 +66,7 @@ static inline int cpu_needs_post_dma_flush(struct device *dev)
 	return !plat_device_is_coherent(dev) &&
 	       (boot_cpu_type() == CPU_R10000 ||
 		boot_cpu_type() == CPU_R12000 ||
+		boot_cpu_type() == CPU_R14000 ||
 		boot_cpu_type() == CPU_BMIPS5000);
 }
#1 lore raw
Quoted 3 lines · Joshua Kinard

cpu_needs_post_dma_flush() in arch/mips/mm/dma-default.c is missing a check for CPU_R14000, where it already has checks for CPU_R10000 and CPU_R12000. This patch adds the missing CPU_R14000 check.

Patch is entirely correct. Except.

This is only used on systems which don't have DMA cache coherency. Those systems are the IP28 and IP22 which featured an R10000 rsp. R10000 or R12000 processor which is why the R14000 is intentionally not listed in this if(). Saves a few bytes and cycles. And probably deserves a comment in the code!

Ralf

#2 lore raw
Quoted 8 lines · Ralf Baechle
Quoted 3 lines · Joshua Kinard

cpu_needs_post_dma_flush() in arch/mips/mm/dma-default.c is missing a check for CPU_R14000, where it already has checks for CPU_R10000 and CPU_R12000. This patch adds the missing CPU_R14000 check.

Patch is entirely correct. Except.

Quoted 7 lines

This is only used on systems which don't have DMA cache coherency. Those systems are the IP28 and IP22 which featured an R10000 rsp. R10000 or R12000 processor which is why the R14000 is intentionally not listed in this if(). Saves a few bytes and cycles. And probably deserves a comment in the code!

Ralf

A comment in the code sounds great in that case then! I'll drop this locally, then. Thanks!

Signature · 9 lines
Joshua Kinard
Gentoo/MIPS
[email protected]
4096R/D25D95E3 2011-03-28

"The past tempts us, the present confuses us, the future frightens us.  And our
lives slip away, moment by moment, lost in that vast, terrible in-between."

--Emperor Turhan, Centauri Republic