diff mbox

[3/3] ARM: mach-shmobile: add coherent DMA mask for SDHI devices

Message ID Pine.LNX.4.64.1105271243390.25265@axis700.grange (mailing list archive)
State New, archived
Headers show

Commit Message

Guennadi Liakhovetski May 27, 2011, 10:44 a.m. UTC
It is now required, because the SDHI / TMIO driver is using
dma_alloc_coherent() to allocate the DMA bounce buffer.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---
 arch/arm/mach-shmobile/board-ag5evm.c   |    6 ++++--
 arch/arm/mach-shmobile/board-ap4evb.c   |    6 ++++--
 arch/arm/mach-shmobile/board-mackerel.c |    9 ++++++---
 3 files changed, 14 insertions(+), 7 deletions(-)

Comments

Hartley Sweeten May 27, 2011, 4:27 p.m. UTC | #1
On Friday, May 27, 2011 3:45 AM, Guennadi Liakhovetski wrote:
>
> It is now required, because the SDHI / TMIO driver is using
> dma_alloc_coherent() to allocate the DMA bounce buffer.
>
> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> ---
>  arch/arm/mach-shmobile/board-ag5evm.c   |    6 ++++--
>  arch/arm/mach-shmobile/board-ap4evb.c   |    6 ++++--
>  arch/arm/mach-shmobile/board-mackerel.c |    9 ++++++---
>  3 files changed, 14 insertions(+), 7 deletions(-)
>
> diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
> index c95258c..a5a737c 100644
> --- a/arch/arm/mach-shmobile/board-ag5evm.c
> +++ b/arch/arm/mach-shmobile/board-ag5evm.c
> @@ -372,7 +372,8 @@ static struct platform_device sdhi0_device = {
>  	.num_resources	= ARRAY_SIZE(sdhi0_resources),
>  	.resource	= sdhi0_resources,
>  	.dev	= {
> -		.platform_data	= &sdhi0_info,
> +		.platform_data		= &sdhi0_info,
> +		.coherent_dma_mask	= 0xffffffff,

I think these should all be

		.coherent_dma_mask	= DMA_BIT_MASK(32),

Also, don't you need the .dma_mask also?

Regards,
Hartley
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Guennadi Liakhovetski May 27, 2011, 4:51 p.m. UTC | #2
On Fri, 27 May 2011, H Hartley Sweeten wrote:

> On Friday, May 27, 2011 3:45 AM, Guennadi Liakhovetski wrote:
> >
> > It is now required, because the SDHI / TMIO driver is using
> > dma_alloc_coherent() to allocate the DMA bounce buffer.
> >
> > Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> > ---
> >  arch/arm/mach-shmobile/board-ag5evm.c   |    6 ++++--
> >  arch/arm/mach-shmobile/board-ap4evb.c   |    6 ++++--
> >  arch/arm/mach-shmobile/board-mackerel.c |    9 ++++++---
> >  3 files changed, 14 insertions(+), 7 deletions(-)
> >
> > diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
> > index c95258c..a5a737c 100644
> > --- a/arch/arm/mach-shmobile/board-ag5evm.c
> > +++ b/arch/arm/mach-shmobile/board-ag5evm.c
> > @@ -372,7 +372,8 @@ static struct platform_device sdhi0_device = {
> >  	.num_resources	= ARRAY_SIZE(sdhi0_resources),
> >  	.resource	= sdhi0_resources,
> >  	.dev	= {
> > -		.platform_data	= &sdhi0_info,
> > +		.platform_data		= &sdhi0_info,
> > +		.coherent_dma_mask	= 0xffffffff,
> 
> I think these should all be
> 
> 		.coherent_dma_mask	= DMA_BIT_MASK(32),

Yes, you're right, I looked at a bad example:( Will post v2 next week. 
Thanks for spotting.

> Also, don't you need the .dma_mask also?

It works without it:) Not sure, if it's needed for some kind of academic 
correctness though.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
index c95258c..a5a737c 100644
--- a/arch/arm/mach-shmobile/board-ag5evm.c
+++ b/arch/arm/mach-shmobile/board-ag5evm.c
@@ -372,7 +372,8 @@  static struct platform_device sdhi0_device = {
 	.num_resources	= ARRAY_SIZE(sdhi0_resources),
 	.resource	= sdhi0_resources,
 	.dev	= {
-		.platform_data	= &sdhi0_info,
+		.platform_data		= &sdhi0_info,
+		.coherent_dma_mask	= 0xffffffff,
 	},
 };
 
@@ -415,7 +416,8 @@  static struct platform_device sdhi1_device = {
 	.name		= "sh_mobile_sdhi",
 	.id		= 1,
 	.dev		= {
-		.platform_data	= &sh_sdhi1_platdata,
+		.platform_data		= &sh_sdhi1_platdata,
+		.coherent_dma_mask	= 0xffffffff,
 	},
 	.num_resources	= ARRAY_SIZE(sdhi1_resources),
 	.resource	= sdhi1_resources,
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index 08acb6e..2b139bd 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -335,7 +335,8 @@  static struct platform_device sdhi0_device = {
 	.resource       = sdhi0_resources,
 	.id             = 0,
 	.dev	= {
-		.platform_data	= &sdhi0_info,
+		.platform_data		= &sdhi0_info,
+		.coherent_dma_mask	= 0xffffffff,
 	},
 };
 
@@ -376,7 +377,8 @@  static struct platform_device sdhi1_device = {
 	.resource       = sdhi1_resources,
 	.id             = 1,
 	.dev	= {
-		.platform_data	= &sdhi1_info,
+		.platform_data		= &sdhi1_info,
+		.coherent_dma_mask	= 0xffffffff,
 	},
 };
 
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index 888fd30..9ee66d1 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -901,7 +901,8 @@  static struct platform_device sdhi0_device = {
 	.resource	= sdhi0_resources,
 	.id		= 0,
 	.dev	= {
-		.platform_data	= &sdhi0_info,
+		.platform_data		= &sdhi0_info,
+		.coherent_dma_mask	= 0xffffffff,
 	},
 };
 
@@ -944,7 +945,8 @@  static struct platform_device sdhi1_device = {
 	.resource	= sdhi1_resources,
 	.id		= 1,
 	.dev	= {
-		.platform_data	= &sdhi1_info,
+		.platform_data		= &sdhi1_info,
+		.coherent_dma_mask	= 0xffffffff,
 	},
 };
 #endif
@@ -995,7 +997,8 @@  static struct platform_device sdhi2_device = {
 	.resource	= sdhi2_resources,
 	.id		= 2,
 	.dev	= {
-		.platform_data	= &sdhi2_info,
+		.platform_data		= &sdhi2_info,
+		.coherent_dma_mask	= 0xffffffff,
 	},
 };