2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-28 23:23:55 +08:00
linux-next/sound/soc/jz4740
Russell King c9bd5e690a DMA-API: sound: fix dma mask handling in a lot of drivers
This code sequence is unsafe in modules:

static u64 mask = DMA_BIT_MASK(something);
...
	if (!dev->dma_mask)
		dev->dma_mask = &mask;

as if a module is reloaded, the mask will be pointing at the original
module's mask address, and this can lead to oopses.  Moreover, they
all follow this with:

	if (!dev->coherent_dma_mask)
		dev->coherent_dma_mask = mask;

where 'mask' is the same value as the statically defined mask, and this
bypasses the architecture's check on whether the DMA mask is possible.

Fix these issues by using the new dma_coerce_coherent_and_mask()
function.

Acked-by: Mark Brown <broonie@linaro.org>
Acked-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2013-10-31 14:48:47 +00:00
..
jz4740-i2s.c ASoC: jz4740-i2s: Use clk_prepare_enable/clk_disable_unprepare 2013-05-12 22:09:03 +04:00
jz4740-i2s.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
jz4740-pcm.c DMA-API: sound: fix dma mask handling in a lot of drivers 2013-10-31 14:48:47 +00:00
jz4740-pcm.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
Kconfig ASoC: JZ4740: Add qi_lb60 board driver 2010-06-23 00:10:57 +01:00
Makefile ASoC: JZ4740: Add qi_lb60 board driver 2010-06-23 00:10:57 +01:00
qi_lb60.c ASoC: jz4740: remove __dev* attributes 2012-12-10 00:31:12 +09:00