linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* MIPS74K dma coherence issue
@ 2016-11-07 19:41 Sven Schnelle
  2016-11-07 19:41 ` [PATCH] MIPS: MIPS74K needs post dma flush Sven Schnelle
  0 siblings, 1 reply; 4+ messages in thread
From: Sven Schnelle @ 2016-11-07 19:41 UTC (permalink / raw)
  To: linux-mips; +Cc: svens

Hi List,

i was debugging a nasty problem where DMA data was incorrect
after dma_unmap_single(). Reason was that cache wasn't flushed
after DMA. Attached patch fixes this.

Regards
Sven

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] MIPS: MIPS74K needs post dma flush
  2016-11-07 19:41 MIPS74K dma coherence issue Sven Schnelle
@ 2016-11-07 19:41 ` Sven Schnelle
  2016-11-07 20:06   ` Leonid Yegoshin
  0 siblings, 1 reply; 4+ messages in thread
From: Sven Schnelle @ 2016-11-07 19:41 UTC (permalink / raw)
  To: linux-mips; +Cc: svens

The manual states "A 74K processor contains no direct hardware
support for managing coherency with respect to its caches, so
it must be handled via the system design or software"

Signed-off-by: Sven Schnelle <svens@stackframe.org>
---
 arch/mips/mm/dma-default.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/mips/mm/dma-default.c b/arch/mips/mm/dma-default.c
index 46d5696..575b7b8 100644
--- a/arch/mips/mm/dma-default.c
+++ b/arch/mips/mm/dma-default.c
@@ -73,7 +73,8 @@ 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_BMIPS5000);
+		boot_cpu_type() == CPU_BMIPS5000 ||
+		boot_cpu_type() == CPU_74K);
 }
 
 static gfp_t massage_gfp_flags(const struct device *dev, gfp_t gfp)
-- 
2.10.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: MIPS: MIPS74K needs post dma flush
  2016-11-07 19:41 ` [PATCH] MIPS: MIPS74K needs post dma flush Sven Schnelle
@ 2016-11-07 20:06   ` Leonid Yegoshin
  2016-11-07 20:06     ` Leonid Yegoshin
  0 siblings, 1 reply; 4+ messages in thread
From: Leonid Yegoshin @ 2016-11-07 20:06 UTC (permalink / raw)
  To: Sven Schnelle, linux-mips

74K does NOT have an aggressive speculation, never for D-Cache, never 
for I-cache. D-Cache doesn't an advance speculation load at all, I-cache 
never does a wrong speculation.

So, post-DMA flush is not needed in any form.

- Leonid.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: MIPS: MIPS74K needs post dma flush
  2016-11-07 20:06   ` Leonid Yegoshin
@ 2016-11-07 20:06     ` Leonid Yegoshin
  0 siblings, 0 replies; 4+ messages in thread
From: Leonid Yegoshin @ 2016-11-07 20:06 UTC (permalink / raw)
  To: Sven Schnelle, linux-mips

74K does NOT have an aggressive speculation, never for D-Cache, never 
for I-cache. D-Cache doesn't an advance speculation load at all, I-cache 
never does a wrong speculation.

So, post-DMA flush is not needed in any form.

- Leonid.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-11-07 20:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-07 19:41 MIPS74K dma coherence issue Sven Schnelle
2016-11-07 19:41 ` [PATCH] MIPS: MIPS74K needs post dma flush Sven Schnelle
2016-11-07 20:06   ` Leonid Yegoshin
2016-11-07 20:06     ` Leonid Yegoshin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).