summaryrefslogtreecommitdiff
path: root/sound/core/memalloc.c
AgeCommit message (Collapse)Author
2017-06-16ALSA: core: Follow standard EXPORT_SYMBOL() declarationsTakashi Iwai
Just a tidy up to follow the standard EXPORT_SYMBOL*() declarations in order to improve grep-ability. - Move EXPORT_SYMBOL*() to the position right after its definition - Remove superfluous blank line before EXPORT_SYMBOL*() lines Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-06-30genalloc: rename of_get_named_gen_pool() to of_gen_pool_get()Vladimir Zapolskiy
To be consistent with other kernel interface namings, rename of_get_named_gen_pool() to of_gen_pool_get(). In the original function name "_named" suffix references to a device tree property, which contains a phandle to a device and the corresponding device driver is assumed to register a gen_pool object. Due to a weak relation and to avoid any confusion (e.g. in future possible scenario if gen_pool objects are named) the suffix is removed. [sfr@canb.auug.org.au: crypto/marvell/cesa - fix up for of_get_named_gen_pool() rename] Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com> Cc: Nicolas Ferre <nicolas.ferre@atmel.com> Cc: Philipp Zabel <p.zabel@pengutronix.de> Cc: Shawn Guo <shawn.guo@linaro.org> Cc: Sascha Hauer <kernel@pengutronix.de> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com> Cc: Russell King <linux@arm.linux.org.uk> Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Cc: Vinod Koul <vinod.koul@intel.com> Cc: Takashi Iwai <tiwai@suse.de> Cc: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Herbert Xu <herbert@gondor.apana.org.au> Cc: Boris BREZILLON <boris.brezillon@free-electrons.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-02-14ALSA: core: Use standard printk helpersTakashi Iwai
Use dev_err() & co as much as possible. If not available (no device assigned at the calling point), use pr_xxx() helpers instead. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-09ALSA: Merge memalloc code into snd-pcm moduleTakashi Iwai
Instead of keeping a separate snd-page-alloc module, merge into the core snd-pcm module, as we don't need to keep it as an individual module due to the drop of page reservation. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-09ALSA: Remove superfluous header inclusions in memalloc.cTakashi Iwai
After cutting off the proc and page reservation codes, we don't need many headers any longer. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-09ALSA: Remove memory reservation code from memalloc helperTakashi Iwai
Nowadays we have CMA for obtaining the contiguous memory pages efficiently. Let's kill the old kludge for reserving the memory pages for large buffers. It was rarely useful (only for preserving pages among module reloading or a little help by an early boot scripting), used only by a couple of drivers, and yet it gives too much ugliness than its benefit. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-09ALSA: Remove memory accounting in memalloc helperTakashi Iwai
It's almost superfluous, and doesn't help much for real uses. Let's reduce the layer size. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-15sound/core/memalloc.c: use gen_pool_dma_alloc() to allocate iram bufferNicolin Chen
Since gen_pool_dma_alloc() is introduced, we implement it to simplify code. Signed-off-by: Nicolin Chen <b42378@freescale.com> Acked-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-10-29ALSA: memalloc: NULL-initialize in snd_malloc_dev_iram()Takashi Iwai
dmab->area and addr fields should be cleared at the head of snd_malloc_dev_iram() as especially dmab->area is used to indicate the allocation failure / fallback. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-29ALSA: memalloc: Make snd_{malloc|free}_dev_iram() staticTakashi Iwai
These are used only locally. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-28ALSA: memalloc: Yet another ifdef CONFIG_GENERIC_ALLOCATOR protectionTakashi Iwai
I obviously forgot to merge the right version... Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-24ALSA: Add ifdef CONFIG_GENERIC_ALLOCATOR for SNDRV_DMA_TYPE_IRAM codeTakashi Iwai
It turned out that we can't use gen_pool_*() functions on archs without CONFIG_GENERIC_ALLOCATOR (resulting in missing symbols), since linux/genalloc.h doesn't provide dummy functions for all. We'd be able to fix linux/genalloc.h size, but I take an easier path for now... Reported-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-24ALSA: Add SoC on-chip internal ram support for DMA buffer allocationNicolin Chen
Now it's quite common that an SoC contains its on-chip internal RAM. By using this RAM space for DMA buffer during audio playback/record, we can shutdown the voltage for external RAM to save power. So add new DEV type with iram malloc()/free() and accordingly modify current default mmap() for the iram circumstance. Signed-off-by: Nicolin Chen <b42378@freescale.com> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-12ALSA: add/change some comments describing function return valuesYacine Belkadi
script/kernel-doc reports the following type of warnings (when run in verbose mode): Warning(sound/core/init.c:152): No description found for return value of 'snd_card_create' To fix that: - add missing descriptions of function return values - use "Return:" sections to describe those return values Along the way: - complete some descriptions - fix some typos Signed-off-by: Yacine Belkadi <yacine.belkadi.1@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-09-27treewide: Correct spelling of successfully in commentsJoe Perches
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-02-14ALSA: core: sparse cleanupsClemens Ladisch
Change the core code where sparse complains. In most cases, this means just adding annotations to confirm that we indeed want to do the dirty things we're doing. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-08ALSA: Fix SG-buffer DMA with non-coherent architecturesTakashi Iwai
Using SG-buffers with dma_alloc_coherent() is often very inefficient on non-coherent architectures because a tracking record could be allocated in addition for each dma_alloc_coherent() call. Instead, simply disable SG-buffers but just allocate normal continuous buffers on non-supported (currently all but x86) architectures. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-10-11Merge branch 'master' of ↵David S. Miller
master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6 Conflicts: sound/core/memalloc.c
2008-08-29alsa: Remove special SBUS dma support code.David S. Miller
No longer used. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29sparc: Convert all SBUS drivers to dma_*() interfaces.David S. Miller
And all the SBUS dma interfaces are deleted. A private implementation remains inside of the 32-bit sparc port which exists only for the sake of the implementation of dma_*(). Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29sparc: Make SBUS DMA interfaces take struct device.David S. Miller
This is the first step in converting all the SBUS drivers over to generic dma_*(). Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-25ALSA: Fix allocation size calculation in snd_dma_alloc_pages_fallback()Takashi Iwai
snd_dma_alloc_pages_fallback() always tries to reduce the size in a half, but it's not good when the given size isn't a power-of-two. Check it first then try to align. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-08-25ALSA: Clean up SG-buffer helper functions and macrosTakashi Iwai
Clean up SG-buffer helper functions and macros. Helpers take substream as arguments now. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-08-13ALSA: Kill snd_assert() in sound/core/*Takashi Iwai
Kill snd_assert() in sound/core/*, either removed or replaced with if () with snd_BUG_ON(). Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-05-19[ALSA] Remove unneeded ugly hack for i386 in memalloc.cTakashi Iwai
The hack for dma_alloc_coherent() is no longer needed on 2.6.26 since the base code was improved. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-04-29sound: use non-racy method for /proc/driver/snd-page-alloc creationDenis V. Lunev
Use proc_create() to make sure that ->proc_fops be setup before gluing PDE to main tree. Signed-off-by: Denis V. Lunev <den@openvz.org> Cc: Alexey Dobriyan <adobriyan@gmail.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Jaroslav Kysela <perex@suse.cz> Cc: Takashi Iwai <tiwai@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-01-31[ALSA] sound/core/memalloc.c: Add missing pci_dev_putJulia Lawall
There should be a pci_dev_put when breaking out of a loop that iterates over calls to pci_get_device and similar functions. In this case, the return under the initial if needs a pci_dev_put in the same way that the return under the subsequent for loop has a pci_dev_put. This was fixed using the following semantic patch. // <smpl> @@ type T; identifier d; expression e; @@ T *d; ... while ((d = \(pci_get_device\|pci_get_device_reverse\|pci_get_subsys\|pci_get_class\)(..., d)) != NULL) {... when != pci_dev_put(d) when != e = d ( return d; | + pci_dev_put(d); ? return ...; ) ...} // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2007-10-16[ALSA] Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.czJaroslav Kysela
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2007-10-16[ALSA] Fix build error without CONFIG_HAS_DMATakashi Iwai
The recent change of include/asm-generic/dma-mapping-broken.h breaks the build without CONFIG_HAS_DMA. This patch is an ad hoc fix. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-09-24Convert snd-page-alloc proc file to use seq_fileTakashi Iwai
Use seq_file for the proc file read/write of snd-page-alloc module. This automatically fixes bugs in the old proc code. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-02-09[ALSA] alsa core: convert to list_for_each_entry*Johannes Berg
This patch converts most uses of list_for_each to list_for_each_entry all across alsa. In some place apparently an item can be on a list with different pointers so of course that isn't compatible with list_for_each, I therefore didn't touch those places. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2006-06-30Remove obsolete #include <linux/config.h>Jörn Engel
Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de> Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-03-22[ALSA] Removed unneeded page-reserveTakashi Iwai
Modules: Memalloc module Removed unneeded page-reservation. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-03-22[ALSA] Use dma_alloc_coherent() hack on i386 onlyTakashi Iwai
Modules: Memalloc module Use dma_alloc_coherent() hack on i386 only (as a valid arch). Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-03-22[ALSA] semaphore -> mutex (core part)Ingo Molnar
Semaphore to mutex conversion. The conversion was generated via scripts, and the result was validated automatically via a script as well. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-01-03[ALSA] dynamic minors (6/6): increase maximum number of sound cardsClemens Ladisch
Modules: ALSA Core,Memalloc module,ALSA sequencer With dynamic minor numbers, we can increase the number of sound cards. This requires that the sequencer client numbers of some kernel drivers are allocated dynamically, too. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2005-11-22[PATCH] unpaged: fix sound Bad page statesHugh Dickins
Earlier I unifdefed PageCompound, so that snd_pcm_mmap_control_nopage and others can give out a 0-order component of a higher-order page, which won't be mistakenly freed when zap_pte_range unmaps it. But many Bad page states reported a PG_reserved was freed after all: I had missed that we need to say __GFP_COMP to get compound page behaviour. Some of these higher-order pages are allocated by snd_malloc_pages, some by snd_malloc_dev_pages; or if SBUS, by sbus_alloc_consistent - but that has no gfp arg, so add __GFP_COMP into its sparc32/64 implementations. I'm still rather puzzled that DRM seems not to need a similar change. Signed-off-by: Hugh Dickins <hugh@veritas.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-10-28[PATCH] gfp_t: soundAl Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-10-08[PATCH] gfp flags annotations - part 1Al Viro
- added typedef unsigned int __nocast gfp_t; - replaced __nocast uses for gfp flags with gfp_t - it gives exactly the same warnings as far as sparse is concerned, doesn't change generated code (from gcc point of view we replaced unsigned int with typedef) and documents what's going on far better. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-09-12[ALSA] pci_find_device removeJiri Slaby
Memalloc module,CS46xx driver,VIA82xx driver,ALI5451 driver au88x0 driver Replace pci_find_device() with pci_get_device() and pci_dev_put(). Signed-off-by: Jiri Slaby <xslaby@fi.muni.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2005-08-30[ALSA] Fix compilation without CONFIG_PROC_FSTakashi Iwai
Memalloc module Fix an error when built without CONFIG_PROC_FS. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2005-08-30[ALSA] make local objects staticClemens Ladisch
Memalloc module,PCM Midlevel,Timer Midlevel,GUS Library,AC97 Codec ALI5451 driver,RME9652 driver Make some functions/variables that are used in only one file static. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2005-07-28[ALSA] sound/core Fix the sparse warning 'implicit cast to nocast type'Victor Fusco
Memalloc module,ALSA Core,Instrument layer Fix the sparse warning 'implicit cast to nocast type' File/Subsystem:sound/core Signed-off-by: Victor Fusco <victor@cetuc.puc-rio.br> Signed-off-by: Domen Puncer <domen@coderock.org> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2005-06-22[ALSA] Add write support to snd-page-alloc proc fileTakashi Iwai
Documentation,Memalloc module,RME HDSP driver,RME9652 driver Add the write support to snd-page-alloc proc file for buffer pre-allocation. Removed the pre-allocation codes via module options. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2005-04-16Linux-2.6.12-rc2Linus Torvalds
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!