summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-10-29 12:03:05 +0100
committerTakashi Iwai <tiwai@suse.de>2013-10-29 12:03:05 +0100
commit9a64f2142ded03cb87eda75149a4d5336612fbe2 (patch)
tree817b76e400847daaadec8490ec3dff3e6b7b8f7c
parent7df754e2b50e92567a760c947caeb3748a1c6bc0 (diff)
downloadalsa-driver-build-unstable-9a64f2142ded03cb87eda75149a4d5336612fbe2.tar.gz
Refresh acore/memalloc.patch
For fixing the build errors with 3.9 and older kernels that have no OF gen_pool support. Also refreshed the fuzz. Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--alsa/acore/memalloc.patch53
1 files changed, 41 insertions, 12 deletions
diff --git a/alsa/acore/memalloc.patch b/alsa/acore/memalloc.patch
index 55bc0d8c4..00faf2349 100644
--- a/alsa/acore/memalloc.patch
+++ b/alsa/acore/memalloc.patch
@@ -1,11 +1,11 @@
---- ../alsa-kernel/core/memalloc.c 2009-09-21 15:57:35.000000000 +0200
-+++ memalloc.c 2009-12-15 22:17:50.000000000 +0100
+--- ../alsa-kernel/core/memalloc.c 2013-10-29 12:01:07.687030626 +0100
++++ memalloc.c 2013-10-29 12:02:03.024035743 +0100
@@ -1,3 +1,4 @@
+#include "memalloc.inc"
/*
* Copyright (c) by Jaroslav Kysela <perex@perex.cz>
* Takashi Iwai <tiwai@suse.de>
-@@ -57,6 +58,138 @@
+@@ -58,6 +59,138 @@
#define SNDRV_DMA_DEVICE_UNUSED (unsigned int)-1
/*
@@ -144,7 +144,7 @@
*
* Generic memory allocators
*
-@@ -74,6 +207,24 @@
+@@ -75,6 +208,24 @@
snd_allocated_pages -= 1 << order;
}
@@ -169,7 +169,7 @@
/**
* snd_malloc_pages - allocate pages with the given size
* @size: the size to allocate in bytes
-@@ -94,8 +245,10 @@
+@@ -95,8 +246,10 @@
return NULL;
gfp_flags |= __GFP_COMP; /* compound page lets parts be mapped */
pg = get_order(size);
@@ -181,7 +181,7 @@
return res;
}
-@@ -114,6 +267,7 @@
+@@ -115,6 +268,7 @@
return;
pg = get_order(size);
dec_snd_pages(pg);
@@ -189,7 +189,7 @@
free_pages((unsigned long) ptr, pg);
}
-@@ -139,8 +293,10 @@
+@@ -140,8 +294,10 @@
| __GFP_NORETRY /* don't trigger OOM-killer */
| __GFP_NOWARN; /* no stack trace print - this call is non-critical */
res = dma_alloc_coherent(dev, PAGE_SIZE << pg, dma, gfp_flags);
@@ -201,15 +201,44 @@
return res;
}
-@@ -155,6 +311,7 @@
+@@ -156,6 +312,7 @@
return;
pg = get_order(size);
dec_snd_pages(pg);
+ unmark_pages(virt_to_page(ptr), pg);
dma_free_coherent(dev, PAGE_SIZE << pg, ptr, dma);
}
+
+@@ -175,6 +332,7 @@
+ dmab->area = NULL;
+ dmab->addr = 0;
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
+ if (dev->of_node)
+ pool = of_get_named_gen_pool(dev->of_node, "iram", 0);
+
+@@ -189,6 +347,7 @@
+ return;
+
+ dmab->addr = gen_pool_virt_to_phys(pool, (unsigned long)dmab->area);
++#endif
+ }
+
+ /**
+@@ -197,10 +356,12 @@
+ */
+ static void snd_free_dev_iram(struct snd_dma_buffer *dmab)
+ {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
+ struct gen_pool *pool = dmab->private_data;
+
+ if (pool && dmab->area)
+ gen_pool_free(pool, (unsigned long)dmab->area, dmab->bytes);
++#endif
+ }
+ #endif /* CONFIG_GENERIC_ALLOCATOR */
#endif /* CONFIG_HAS_DMA */
-@@ -366,6 +523,7 @@
+@@ -428,6 +589,7 @@
#ifdef CONFIG_PROC_FS
@@ -217,7 +246,7 @@
/*
* proc file interface
*/
-@@ -504,6 +662,7 @@
+@@ -566,6 +728,7 @@
.release = single_release,
};
@@ -225,7 +254,7 @@
#endif /* CONFIG_PROC_FS */
/*
-@@ -513,15 +672,23 @@
+@@ -575,15 +738,23 @@
static int __init snd_mem_init(void)
{
#ifdef CONFIG_PROC_FS
@@ -249,7 +278,7 @@
free_all_reserved_pages();
if (snd_allocated_pages > 0)
printk(KERN_ERR "snd-malloc: Memory leak? pages not freed = %li\n", snd_allocated_pages);
-@@ -544,3 +711,5 @@
+@@ -606,3 +777,5 @@
EXPORT_SYMBOL(snd_malloc_pages);
EXPORT_SYMBOL(snd_free_pages);