diff mbox

[3/3] ARM: Kirkwood: increase atomic coherent pool size

Message ID 1345459648-24263-4-git-send-email-m.szyprowski@samsung.com
State Accepted
Commit cb01b633eeb77ae7128cab0a3b5d3de56da6e913
Headers show

Commit Message

Marek Szyprowski Aug. 20, 2012, 10:47 a.m. UTC
The default 256 KiB coherent pool may be too small for some of the Kirkwood
devices, so increase it to make sure that devices will be able to allocate
their buffers with GFP_ATOMIC flag.

Suggested-by: Josh Coombs <josh.coombs@gmail.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 arch/arm/mach-kirkwood/common.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

Comments

Aaro Koskinen Aug. 20, 2012, 11:14 p.m. UTC | #1
On Mon, Aug 20, 2012 at 12:47:28PM +0200, Marek Szyprowski wrote:
> The default 256 KiB coherent pool may be too small for some of the Kirkwood
> devices, so increase it to make sure that devices will be able to allocate
> their buffers with GFP_ATOMIC flag.
[...]
> +	/*
> +	 * Some Kirkwood devices allocate their coherent buffers from atomic
> +	 * context. Increase size of atomic coherent pool to make sure such
> +	 * the allocations won't fail.
> +	 */
> +	init_dma_coherent_pool_size(SZ_1M);

Not sure if it's a valid use case, but what if some user wants to drop
e.g. SATA driver and and free up some memory. Would a smaller coherent
pool kernel parameter override this code in that case?

A.
Marek Szyprowski Aug. 21, 2012, 7:31 a.m. UTC | #2
Hello,

On Tuesday, August 21, 2012 1:14 AM Aaro Koskinen wrote:

> On Mon, Aug 20, 2012 at 12:47:28PM +0200, Marek Szyprowski wrote:
> > The default 256 KiB coherent pool may be too small for some of the Kirkwood
> > devices, so increase it to make sure that devices will be able to allocate
> > their buffers with GFP_ATOMIC flag.
> [...]
> > +	/*
> > +	 * Some Kirkwood devices allocate their coherent buffers from atomic
> > +	 * context. Increase size of atomic coherent pool to make sure such
> > +	 * the allocations won't fail.
> > +	 */
> > +	init_dma_coherent_pool_size(SZ_1M);
> 
> Not sure if it's a valid use case, but what if some user wants to drop
> e.g. SATA driver and and free up some memory. Would a smaller coherent
> pool kernel parameter override this code in that case?

Kernel command line parameter always overrides the value set by platform code
(or the default 256KiB).

Best regards
Jason Cooper Aug. 28, 2012, 6:25 p.m. UTC | #3
On Mon, Aug 20, 2012 at 12:47:28PM +0200, Marek Szyprowski wrote:
> The default 256 KiB coherent pool may be too small for some of the Kirkwood
> devices, so increase it to make sure that devices will be able to allocate
> their buffers with GFP_ATOMIC flag.
> 
> Suggested-by: Josh Coombs <josh.coombs@gmail.com>
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>

Acked-by: Jason Cooper <jason@lakedaemon.net>

I assume this will go through the dma tree.  Or, if they want to Ack it,
I'll take it through mine since I have boards depending on this.

thx,

Jason.

> ---
>  arch/arm/mach-kirkwood/common.c |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
> index c4b64ad..d748f50 100644
> --- a/arch/arm/mach-kirkwood/common.c
> +++ b/arch/arm/mach-kirkwood/common.c
> @@ -517,6 +517,13 @@ void __init kirkwood_wdt_init(void)
>  void __init kirkwood_init_early(void)
>  {
>  	orion_time_set_base(TIMER_VIRT_BASE);
> +
> +	/*
> +	 * Some Kirkwood devices allocate their coherent buffers from atomic
> +	 * context. Increase size of atomic coherent pool to make sure such
> +	 * the allocations won't fail.
> +	 */
> +	init_dma_coherent_pool_size(SZ_1M);
>  }
>  
>  int kirkwood_tclk;
> -- 
> 1.7.1.569.g6f426
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Marek Szyprowski Aug. 28, 2012, 6:37 p.m. UTC | #4
Hello Jason,

On 8/28/2012 8:25 PM, Jason Cooper wrote:
> On Mon, Aug 20, 2012 at 12:47:28PM +0200, Marek Szyprowski wrote:
>> The default 256 KiB coherent pool may be too small for some of the Kirkwood
>> devices, so increase it to make sure that devices will be able to allocate
>> their buffers with GFP_ATOMIC flag.
>>
>> Suggested-by: Josh Coombs <josh.coombs@gmail.com>
>> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
>
> Acked-by: Jason Cooper <jason@lakedaemon.net>
>
> I assume this will go through the dma tree.  Or, if they want to Ack it,
> I'll take it through mine since I have boards depending on this.

Thanks for the ack, I would like to push it via my dma-mapping tree
together with the patches which add init_dma_coherent_pool_size()
function. I've already added it to fixes-for-3.6 branch.

Best regards
Jason Cooper Aug. 28, 2012, 6:40 p.m. UTC | #5
On Tue, Aug 28, 2012 at 08:37:57PM +0200, Marek Szyprowski wrote:
> Hello Jason,
> 
> On 8/28/2012 8:25 PM, Jason Cooper wrote:
> >On Mon, Aug 20, 2012 at 12:47:28PM +0200, Marek Szyprowski wrote:
> >>The default 256 KiB coherent pool may be too small for some of the Kirkwood
> >>devices, so increase it to make sure that devices will be able to allocate
> >>their buffers with GFP_ATOMIC flag.
> >>
> >>Suggested-by: Josh Coombs <josh.coombs@gmail.com>
> >>Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> >
> >Acked-by: Jason Cooper <jason@lakedaemon.net>
> >
> >I assume this will go through the dma tree.  Or, if they want to Ack it,
> >I'll take it through mine since I have boards depending on this.
> 
> Thanks for the ack, I would like to push it via my dma-mapping tree
> together with the patches which add init_dma_coherent_pool_size()
> function. I've already added it to fixes-for-3.6 branch.

Great!

thx,

Jason.
diff mbox

Patch

diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index c4b64ad..d748f50 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -517,6 +517,13 @@  void __init kirkwood_wdt_init(void)
 void __init kirkwood_init_early(void)
 {
 	orion_time_set_base(TIMER_VIRT_BASE);
+
+	/*
+	 * Some Kirkwood devices allocate their coherent buffers from atomic
+	 * context. Increase size of atomic coherent pool to make sure such
+	 * the allocations won't fail.
+	 */
+	init_dma_coherent_pool_size(SZ_1M);
 }
 
 int kirkwood_tclk;