sh: Pre-allocate a reasonable number of DMA debug entries.
authorPaul Mundt <lethal@linux-sh.org>
Tue, 14 Apr 2009 06:22:15 +0000 (15:22 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Tue, 14 Apr 2009 06:22:15 +0000 (15:22 +0900)
This prevents the DMA API debugging from running out of entries right
away on boot. Defines 4096 entries by default, which while a bit on the
heavy side, ought to leave enough breathing room for some time.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
arch/sh/mm/consistent.c

index 8c9ee855328a99af7392a55ff9478160c9d3dd90..e098ec158ddb160be002ce51995d79e7a1c5c665 100644 (file)
  * for more details.
  */
 #include <linux/mm.h>
+#include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/dma-mapping.h>
 #include <linux/dma-debug.h>
+#include <linux/io.h>
 #include <asm/cacheflush.h>
 #include <asm/addrspace.h>
-#include <asm/io.h>
+
+#define PREALLOC_DMA_DEBUG_ENTRIES     4096
+
+static int __init dma_init(void)
+{
+       dma_debug_init(PREALLOC_DMA_DEBUG_ENTRIES);
+       return 0;
+}
+fs_initcall(dma_init);
 
 void *dma_alloc_coherent(struct device *dev, size_t size,
                           dma_addr_t *dma_handle, gfp_t gfp)