Thread (89 messages) 89 messages, 20 authors, 2013-11-15

[PATCH 28/51] DMA-API: sound: fix dma mask handling in a lot of drivers

From: Russell King - ARM Linux <hidden>
Date: 2013-09-26 07:54:25
Also in: alsa-devel, dri-devel, linux-crypto, linux-devicetree, linux-ide, linux-mmc, linux-omap, linux-samsung-soc, linux-scsi, linux-tegra, linuxppc-dev, netdev

On Thu, Sep 26, 2013 at 09:51:23AM +0200, Takashi Iwai wrote:
Hi,

sorry for the lat response, as I've been traveling in the last weeks.

At Thu, 19 Sep 2013 22:53:02 +0100,
Russell King wrote:
quoted
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.

Signed-off-by: Russell King <redacted>
Applied with Mark's ack now.
Which is a very stupid thing to do because you won't have
dma_coerce_coherent_and_mask() in your tree, so all these drivers
will fail to build for you.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help