Linux MIPS Architecture development
 help / color / mirror / Atom feed
* Patch to make c-mips32.c compile when HW coherency is used
@ 2003-04-01 12:37 Hartvig Ekner
  2003-04-01 17:27 ` Ralf Baechle
  0 siblings, 1 reply; 2+ messages in thread
From: Hartvig Ekner @ 2003-04-01 12:37 UTC (permalink / raw)
  To: Linux MIPS mailing list

[-- Attachment #1: Type: text/plain, Size: 355 bytes --]

The patch totally removes the dma_cache functions and the function pointers when the kernel is
compiled for HW coherency. Previously it didn't compile at all since the function pointers are non-
existant in this case.

The same problem exists in all the other c-*.c files in arch/mips/mm, so maybe there is something
which I don't understand?

/Hartvig



[-- Attachment #2: noncoh_patch --]
[-- Type: text/plain, Size: 1505 bytes --]

Index: c-mips32.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/mm/c-mips32.c,v
retrieving revision 1.3.2.17
diff -u -r1.3.2.17 c-mips32.c
--- c-mips32.c	31 Mar 2003 23:29:06 -0000	1.3.2.17
+++ c-mips32.c	1 Apr 2003 12:17:14 -0000
@@ -293,6 +293,9 @@
 /*
  * Writeback and invalidate the primary cache dcache before DMA.
  */
+
+#ifdef	CONFIG_NONCOHERENT_IO
+
 static void
 mips32_dma_cache_wback_inv_pc(unsigned long addr, unsigned long size)
 {
@@ -379,9 +382,12 @@
 static void
 mips32_dma_cache_wback(unsigned long addr, unsigned long size)
 {
-	panic("mips32_dma_cache called - should not happen.");
+	panic("mips32_dma_cache_wback called - should not happen.");
 }
 
+#endif
+
+
 /*
  * While we're protected against bad userland addresses we don't care
  * very much about what happens in that case.  Usually a segmentation
@@ -596,9 +602,11 @@
 
 	_flush_icache_page = mips32_flush_icache_page;
 
+#ifdef	CONFIG_NONCOHERENT_IO
 	_dma_cache_wback_inv = mips32_dma_cache_wback_inv_pc;
 	_dma_cache_wback = mips32_dma_cache_wback;
 	_dma_cache_inv = mips32_dma_cache_inv_pc;
+#endif
 }
 
 static void __init setup_scache_funcs(void)
@@ -613,9 +621,11 @@
 
 	_flush_icache_page = mips32_flush_icache_page_s;
 
+#ifdef	CONFIG_NONCOHERENT_IO
 	_dma_cache_wback_inv = mips32_dma_cache_wback_inv_sc;
 	_dma_cache_wback = mips32_dma_cache_wback;
 	_dma_cache_inv = mips32_dma_cache_inv_sc;
+#endif
 }
 
 typedef int (*probe_func_t)(unsigned long);

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

* Re: Patch to make c-mips32.c compile when HW coherency is used
  2003-04-01 12:37 Patch to make c-mips32.c compile when HW coherency is used Hartvig Ekner
@ 2003-04-01 17:27 ` Ralf Baechle
  0 siblings, 0 replies; 2+ messages in thread
From: Ralf Baechle @ 2003-04-01 17:27 UTC (permalink / raw)
  To: Hartvig Ekner; +Cc: Linux MIPS mailing list

On Tue, Apr 01, 2003 at 02:37:20PM +0200, Hartvig Ekner wrote:

> The patch totally removes the dma_cache functions and the function
> pointers when the kernel is compiled for HW coherency. Previously it
> didn't compile at all since the function pointers are non-existant in
> this case.
> 
> The same problem exists in all the other c-*.c files in arch/mips/mm,
> so maybe there is something which I don't understand?

The reason is trivial - to this date only two platforms do support hw
coherency for I/O, the R10000-based Origin 200/2000 aka SGI IP27 and
Sibyte SB1-based platforms.

Fortunately the number of coherent platforms is increasing.  The
extra hardware costs very little these days but it dramatically helping
to guarantee system performance and correctness of system software.

  Ralf

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

end of thread, other threads:[~2003-04-01 17:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-01 12:37 Patch to make c-mips32.c compile when HW coherency is used Hartvig Ekner
2003-04-01 17:27 ` Ralf Baechle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox