summaryrefslogtreecommitdiffstats
path: root/sound/core/memalloc.c
Commit message (Collapse)AuthorAgeFilesLines
* genalloc: rename of_get_named_gen_pool() to of_gen_pool_get()Vladimir Zapolskiy2015-06-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* ALSA: core: Use standard printk helpersTakashi Iwai2014-02-141-2/+2
| | | | | | | 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>
* ALSA: Merge memalloc code into snd-pcm moduleTakashi Iwai2014-01-091-10/+0
| | | | | | | | 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>
* ALSA: Remove superfluous header inclusions in memalloc.cTakashi Iwai2014-01-091-4/+0
| | | | | | | 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>
* ALSA: Remove memory reservation code from memalloc helperTakashi Iwai2014-01-091-264/+0
| | | | | | | | | | | 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>
* ALSA: Remove memory accounting in memalloc helperTakashi Iwai2014-01-091-29/+2
| | | | | | | 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>
* sound/core/memalloc.c: use gen_pool_dma_alloc() to allocate iram bufferNicolin Chen2013-11-151-5/+1
| | | | | | | | | 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>
* ALSA: memalloc: NULL-initialize in snd_malloc_dev_iram()Takashi Iwai2013-10-291-0/+3
| | | | | | | | 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>
* ALSA: memalloc: Make snd_{malloc|free}_dev_iram() staticTakashi Iwai2013-10-291-2/+2
| | | | | | These are used only locally. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: memalloc: Yet another ifdef CONFIG_GENERIC_ALLOCATOR protectionTakashi Iwai2013-10-281-0/+2
| | | | | | | 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>
* ALSA: Add ifdef CONFIG_GENERIC_ALLOCATOR for SNDRV_DMA_TYPE_IRAM codeTakashi Iwai2013-10-241-0/+4
| | | | | | | | | | | 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>
* ALSA: Add SoC on-chip internal ram support for DMA buffer allocationNicolin Chen2013-10-241-0/+52
| | | | | | | | | | | | | 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>
* ALSA: add/change some comments describing function return valuesYacine Belkadi2013-03-121-10/+10
| | | | | | | | | | | | | | | | | | | 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>
* treewide: Correct spelling of successfully in commentsJoe Perches2011-09-271-2/+2
| | | | | Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* ALSA: core: sparse cleanupsClemens Ladisch2011-02-141-1/+2
| | | | | | | | | 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>
* ALSA: Fix SG-buffer DMA with non-coherent architecturesTakashi Iwai2009-07-081-0/+4
| | | | | | | | | | 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>
* Merge branch 'master' of ↵David S. Miller2008-10-111-32/+20
|\ | | | | | | | | | | | | | | master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6 Conflicts: sound/core/memalloc.c
| * ALSA: Fix allocation size calculation in snd_dma_alloc_pages_fallback()Takashi Iwai2008-08-251-1/+6
| | | | | | | | | | | | | | | | | | 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>
| * ALSA: Clean up SG-buffer helper functions and macrosTakashi Iwai2008-08-251-8/+0
| | | | | | | | | | | | | | | | 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>
| * ALSA: Kill snd_assert() in sound/core/*Takashi Iwai2008-08-131-25/+16
| | | | | | | | | | | | | | | | 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>
* | alsa: Remove special SBUS dma support code.David S. Miller2008-08-291-49/+1
| | | | | | | | | | | | No longer used. Signed-off-by: David S. Miller <davem@davemloft.net>
* | sparc: Convert all SBUS drivers to dma_*() interfaces.David S. Miller2008-08-291-4/+4
| | | | | | | | | | | | | | | | | | 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>
* | sparc: Make SBUS DMA interfaces take struct device.David S. Miller2008-08-291-2/+4
|/ | | | | | | This is the first step in converting all the SBUS drivers over to generic dma_*(). Signed-off-by: David S. Miller <davem@davemloft.net>
* [ALSA] Remove unneeded ugly hack for i386 in memalloc.cTakashi Iwai2008-05-191-62/+0
| | | | | | | | 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>
* sound: use non-racy method for /proc/driver/snd-page-alloc creationDenis V. Lunev2008-04-291-3/+2
| | | | | | | | | | | | | 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>
* [ALSA] sound/core/memalloc.c: Add missing pci_dev_putJulia Lawall2008-01-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* [ALSA] Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.czJaroslav Kysela2007-10-161-2/+2
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* [ALSA] Fix build error without CONFIG_HAS_DMATakashi Iwai2007-10-161-0/+6
| | | | | | | | 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>
* Convert snd-page-alloc proc file to use seq_fileTakashi Iwai2007-09-241-29/+39
| | | | | | | | 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>
* [ALSA] alsa core: convert to list_for_each_entry*Johannes Berg2007-02-091-7/+3
| | | | | | | | | | | 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>
* Remove obsolete #include <linux/config.h>Jörn Engel2006-06-301-1/+0
| | | | | Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de> Signed-off-by: Adrian Bunk <bunk@stusta.de>
* [ALSA] Removed unneeded page-reserveTakashi Iwai2006-03-221-30/+2
| | | | | | | | Modules: Memalloc module Removed unneeded page-reservation. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* [ALSA] Use dma_alloc_coherent() hack on i386 onlyTakashi Iwai2006-03-221-1/+1
| | | | | | | | Modules: Memalloc module Use dma_alloc_coherent() hack on i386 only (as a valid arch). Signed-off-by: Takashi Iwai <tiwai@suse.de>
* [ALSA] semaphore -> mutex (core part)Ingo Molnar2006-03-221-11/+11
| | | | | | | | | | | 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>
* [ALSA] dynamic minors (6/6): increase maximum number of sound cardsClemens Ladisch2006-01-031-4/+0
| | | | | | | | | | | 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>
* [PATCH] unpaged: fix sound Bad page statesHugh Dickins2005-11-221-0/+2
| | | | | | | | | | | | | | | | | | 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>
* [PATCH] gfp_t: soundAl Viro2005-10-281-2/+2
| | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] gfp flags annotations - part 1Al Viro2005-10-081-1/+1
| | | | | | | | | | | | - 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>
* [ALSA] pci_find_device removeJiri Slaby2005-09-121-1/+2
| | | | | | | | | 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>
* [ALSA] Fix compilation without CONFIG_PROC_FSTakashi Iwai2005-08-301-2/+1
| | | | | | | Memalloc module Fix an error when built without CONFIG_PROC_FS. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* [ALSA] make local objects staticClemens Ladisch2005-08-301-1/+1
| | | | | | | | 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>
* [ALSA] sound/core Fix the sparse warning 'implicit cast to nocast type'Victor Fusco2005-07-281-1/+2
| | | | | | | | | | | 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>
* [ALSA] Add write support to snd-page-alloc proc fileTakashi Iwai2005-06-221-92/+109
| | | | | | | | 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>
* Linux-2.6.12-rc2v2.6.12-rc2Linus Torvalds2005-04-161-0/+663
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!
OpenPOWER on IntegriCloud