Skip to contentSkip to conversation

arm: ep93xx: add dma_masks for the M2P and M2M DMA controllers

PATCH New H Hartley Sweeten 3 participants 7 messages Nov 21, 2014 – Dec 4, 2014

Subsystems (3)
lore
Share & tools
lore

H Hartley Sweeten

author maintainer
#0 lore raw

PATCH 1/1 arm: ep93xx: add dma_masks for the M2P and M2M DMA controllers

The dma_mask and coherent_dma_mask need to be set or DMA memory allocations will fail with error messages like this:

ep93xx-dma ep93xx-dma-m2p: coherent DMA mask is unset

ep93xx-dma ep93xx-dma-m2m: coherent DMA mask is unset

Add the missing information to the ep93xx-dma-m2p and ep93xx-dma-m2m devices.

---
This fixes a problem with the sound/soc/cirrus/edb93xx.c driver not loading and fixes the sound on these tested boards:

EDB9315A (like) - tested by Jeremy Moles
EDB9302 (like) - tested by Alexander Sverdlin
EDB9307A (stock) - tested by H Hartley Sweeten

 arch/arm/mach-ep93xx/dma.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
arch/arm/mach-ep93xx/dma.c +10 -2
index d8bfd02..88a4c9b 100644
@@ -66,11 +66,15 @@ static struct ep93xx_dma_platform_data ep93xx_dma_m2p_data = {
 	.num_channels		= ARRAY_SIZE(ep93xx_dma_m2p_channels),
 };
 
+static u64 ep93xx_dma_m2p_mask = DMA_BIT_MASK(32);
+
 static struct platform_device ep93xx_dma_m2p_device = {
 	.name			= "ep93xx-dma-m2p",
 	.id			= -1,
 	.dev			= {
-		.platform_data	= &ep93xx_dma_m2p_data,
+		.platform_data		= &ep93xx_dma_m2p_data,
+		.dma_mask		= &ep93xx_dma_m2p_mask,
+		.coherent_dma_mask	= DMA_BIT_MASK(32),
 	},
 };
 
@@ -93,11 +97,15 @@ static struct ep93xx_dma_platform_data ep93xx_dma_m2m_data = {
 	.num_channels		= ARRAY_SIZE(ep93xx_dma_m2m_channels),
 };
 
+static u64 ep93xx_dma_m2m_mask = DMA_BIT_MASK(32);
+
 static struct platform_device ep93xx_dma_m2m_device = {
 	.name			= "ep93xx-dma-m2m",
 	.id			= -1,
 	.dev			= {
-		.platform_data	= &ep93xx_dma_m2m_data,
+		.platform_data		= &ep93xx_dma_m2m_data,
+		.dma_mask		= &ep93xx_dma_m2m_mask,
+		.coherent_dma_mask	= DMA_BIT_MASK(32),
 	},
 };
 
Signature · 1 line
2.0.3
#1 lore raw

PATCH 1/1 arm: ep93xx: add dma_masks for the M2P and M2M DMA controllers

Quoted 7 lines · H Hartley Sweeten

The dma_mask and coherent_dma_mask need to be set or DMA memory allocations will fail with error messages like this:

ep93xx-dma ep93xx-dma-m2p: coherent DMA mask is unset

ep93xx-dma ep93xx-dma-m2m: coherent DMA mask is unset

Quoted 7 lines

Add the missing information to the ep93xx-dma-m2p and ep93xx-dma-m2m devices.

Applied to next/fixes-non-critical. I couldn't tell from your description whether you want this on 3.18 or even backported to older releases, which I guess would make sense.

If you want a backport, let me know.

Thanks,

Arnd

#2 lore raw

PATCH 1/1 arm: ep93xx: add dma_masks for the M2P and M2M DMA controllers

Quoted 16 lines · Arnd Bergmann
Quoted 7 lines · H Hartley Sweeten

The dma_mask and coherent_dma_mask need to be set or DMA memory allocations will fail with error messages like this:

ep93xx-dma ep93xx-dma-m2p: coherent DMA mask is unset

ep93xx-dma ep93xx-dma-m2m: coherent DMA mask is unset

Quoted 7 lines

Add the missing information to the ep93xx-dma-m2p and ep93xx-dma-m2m devices.

Quoted 5 lines

Applied to next/fixes-non-critical. I couldn't tell from your description whether you want this on 3.18 or even backported to older releases, which I guess would make sense.

If you want a backport, let me know.

Arnd,

This fixes the ep93xx sound driver. It should probably be backported and applied to 3.18.

The sound driver was broken when it was converted to the dmaengine API. I missed this when the driver was converted because my normal ep93xx boards do not have sound support.

I'll try to determine when the audio actually broke so we can figure out how far the backport needs to go,

Thanks,
Hartley

#3 lore raw

PATCH 1/1 arm: ep93xx: add dma_masks for the M2P and M2M DMA controllers

In reply to Arnd Bergmann
Quoted 16 lines · Arnd Bergmann
Quoted 7 lines · H Hartley Sweeten

The dma_mask and coherent_dma_mask need to be set or DMA memory allocations will fail with error messages like this:

ep93xx-dma ep93xx-dma-m2p: coherent DMA mask is unset

ep93xx-dma ep93xx-dma-m2m: coherent DMA mask is unset

Quoted 7 lines

Add the missing information to the ep93xx-dma-m2p and ep93xx-dma-m2m devices.

Quoted 5 lines

Applied to next/fixes-non-critical. I couldn't tell from your description whether you want this on 3.18 or even backported to older releases, which I guess would make sense.

If you want a backport, let me know.

Arnd,

I think the ep93xx audio got broken around this commit:

commit e27e8a60cb4ca8e3b047c5d6ee9afff9c4c5b61a

Author: Lars-Peter Clausen <[email protected]>
Date:   Sat Apr 20 19:29:05 2013 +0200

ASoC: ep93xx: Use generic dmaengine PCM

But I'm not sure exactly where. I will try to narrow it down.

There appear to be a number of ep93xx users still out there but they are mostly still using 2.6 kernels. It might be ok to just get this fix in for 3.18 and then wait to see if anyone complains about the sound not working in older kernels.

Thanks,
Hartley

#4 lore raw

PATCH 1/1 arm: ep93xx: add dma_masks for the M2P and M2M DMA controllers

Quoted 31 lines · On Monday 01 December 2014 17:16:18 Hartley Sweeten wrote:
Quoted 16 lines · Arnd Bergmann
Quoted 7 lines · H Hartley Sweeten

The dma_mask and coherent_dma_mask need to be set or DMA memory allocations will fail with error messages like this:

ep93xx-dma ep93xx-dma-m2p: coherent DMA mask is unset

ep93xx-dma ep93xx-dma-m2m: coherent DMA mask is unset

Quoted 7 lines

Add the missing information to the ep93xx-dma-m2p and ep93xx-dma-m2m devices.

Quoted 5 lines

Applied to next/fixes-non-critical. I couldn't tell from your description whether you want this on 3.18 or even backported to older releases, which I guess would make sense.

If you want a backport, let me know.

Arnd,

I think the ep93xx audio got broken around this commit:

commit e27e8a60cb4ca8e3b047c5d6ee9afff9c4c5b61a

Author: Lars-Peter Clausen <[email protected]>
Date:   Sat Apr 20 19:29:05 2013 +0200
Quoted 8 lines

ASoC: ep93xx: Use generic dmaengine PCM

But I'm not sure exactly where. I will try to narrow it down.

There appear to be a number of ep93xx users still out there but they are mostly still using 2.6 kernels. It might be ok to just get this fix in for 3.18 and then wait to see if anyone complains about the sound not working in older kernels.

Is there any harm in applying the fix on older kernels? If not, I'd just mark it as stable for 3.11, which will cause it to get backported to 3.17, 3.14 and 3.12 but not 3.10 or older longerm releases.

Arnd

#5 lore raw

PATCH 1/1 arm: ep93xx: add dma_masks for the M2P and M2M DMA controllers

Quoted 3 lines · Arnd Bergmann

Is there any harm in applying the fix on older kernels? If not, I'd just mark it as stable for 3.11, which will cause it to get backported to 3.17, 3.14 and 3.12 but not 3.10 or older longerm releases.

I don't see any harm with it. It just adds the dma_mask data that should have been there anyway.

Thanks,
Hartley

#6 lore raw

PATCH 1/1 arm: ep93xx: add dma_masks for the M2P and M2M DMA controllers

Quoted 8 lines · On Monday 01 December 2014 21:14:36 Hartley Sweeten wrote:
Quoted 3 lines · Arnd Bergmann

Is there any harm in applying the fix on older kernels? If not, I'd just mark it as stable for 3.11, which will cause it to get backported to 3.17, 3.14 and 3.12 but not 3.10 or older longerm releases.

I don't see any harm with it. It just adds the dma_mask data that should have been there anyway.

Ok, I've applied it to the fixes branch now as a reminder, with the

Cc <[email protected]> # v3.11+

line added. It's already in next/fixes-non-critical, so the patch will make it into 3.19, but if this is the only patch left for 3.18, we probably won't send it. If not, I'll send an email to the stable list so it gets backported.

I just noticed that we didn't have arm at kernel.org on Cc and you had just sent the patch to me personally. To ensure that something gets picked up, please send it to the arm at kernel.org alias so it doesn't accidentally get lost, thanks!

Arnd