All of lore.kernel.org
 help / color / mirror / Atom feed
* some question about __dma_alloc in arch/arm/mm/dma-mapping.c
@ 2015-07-04 15:06 vichy
  2015-07-04 15:08 ` vichy
  0 siblings, 1 reply; 4+ messages in thread
From: vichy @ 2015-07-04 15:06 UTC (permalink / raw)
  To: linux-arm-kernel

hi all:
in __dma_alloc of arch/arm/mm/dma-mapping.c, if the size of allocation
is PAGE_SIZE

if (is_coherent || nommu())
                addr = __alloc_simple_buffer(dev, size, gfp, &page);
        else if (!(gfp & __GFP_WAIT))
                addr = __alloc_from_pool(size, &page);
        else if (size == PAGE_SIZE || !CMA_DEFAULT_REGION)
                addr = __alloc_remap_buffer(dev, size, gfp, prot,
&page, caller);
        else
                addr = __alloc_from_contiguous(dev, size, prot, &page, caller);

^ permalink raw reply	[flat|nested] 4+ messages in thread

* some question about __dma_alloc in arch/arm/mm/dma-mapping.c
  2015-07-04 15:06 some question about __dma_alloc in arch/arm/mm/dma-mapping.c vichy
@ 2015-07-04 15:08 ` vichy
  2015-07-06 10:11   ` Catalin Marinas
  0 siblings, 1 reply; 4+ messages in thread
From: vichy @ 2015-07-04 15:08 UTC (permalink / raw)
  To: linux-arm-kernel

hi all:
in __dma_alloc of arch/arm/mm/dma-mapping.c, if the size of allocation
is PAGE_SIZE, we will use __alloc_remap_buffer instead of
__alloc_from_contiguous like below excerpted from __dma_alloc.

Is any special reason for PAGE_SIZE allocation NOT getting from continuous pool?
Appreciate your kind help in advance,

         ..............
         if (is_coherent || nommu())
                 addr = __alloc_simple_buffer(dev, size, gfp, &page);
         else if (!(gfp & __GFP_WAIT))
                 addr = __alloc_from_pool(size, &page);
         else if (size == PAGE_SIZE || !CMA_DEFAULT_REGION)
                 addr = __alloc_remap_buffer(dev, size, gfp, prot,
&page, caller);
         else
                 addr = __alloc_from_contiguous(dev, size, prot, &page, caller);

^ permalink raw reply	[flat|nested] 4+ messages in thread

* some question about __dma_alloc in arch/arm/mm/dma-mapping.c
  2015-07-04 15:08 ` vichy
@ 2015-07-06 10:11   ` Catalin Marinas
  2015-07-10  9:49     ` vichy
  0 siblings, 1 reply; 4+ messages in thread
From: Catalin Marinas @ 2015-07-06 10:11 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Jul 04, 2015 at 11:08:52PM +0800, vichy wrote:
> in __dma_alloc of arch/arm/mm/dma-mapping.c, if the size of allocation
> is PAGE_SIZE, we will use __alloc_remap_buffer instead of
> __alloc_from_contiguous like below excerpted from __dma_alloc.
> 
> Is any special reason for PAGE_SIZE allocation NOT getting from continuous pool?
> Appreciate your kind help in advance,
> 
>          ..............
>          if (is_coherent || nommu())
>                  addr = __alloc_simple_buffer(dev, size, gfp, &page);
>          else if (!(gfp & __GFP_WAIT))
>                  addr = __alloc_from_pool(size, &page);
>          else if (size == PAGE_SIZE || !CMA_DEFAULT_REGION)
>                  addr = __alloc_remap_buffer(dev, size, gfp, prot, &page, caller);
>          else
>                  addr = __alloc_from_contiguous(dev, size, prot, &page, caller);

You should probably ask whoever gave you this kernel as I can't find the
code above in mainline.

-- 
Catalin

^ permalink raw reply	[flat|nested] 4+ messages in thread

* some question about __dma_alloc in arch/arm/mm/dma-mapping.c
  2015-07-06 10:11   ` Catalin Marinas
@ 2015-07-10  9:49     ` vichy
  0 siblings, 0 replies; 4+ messages in thread
From: vichy @ 2015-07-10  9:49 UTC (permalink / raw)
  To: linux-arm-kernel

hi Catalin:

2015-07-06 18:11 GMT+08:00 Catalin Marinas <catalin.marinas@arm.com>:
> On Sat, Jul 04, 2015 at 11:08:52PM +0800, vichy wrote:
>> in __dma_alloc of arch/arm/mm/dma-mapping.c, if the size of allocation
>> is PAGE_SIZE, we will use __alloc_remap_buffer instead of
>> __alloc_from_contiguous like below excerpted from __dma_alloc.
>>
>> Is any special reason for PAGE_SIZE allocation NOT getting from continuous pool?
>> Appreciate your kind help in advance,
>>
>>          ..............
>>          if (is_coherent || nommu())
>>                  addr = __alloc_simple_buffer(dev, size, gfp, &page);
>>          else if (!(gfp & __GFP_WAIT))
>>                  addr = __alloc_from_pool(size, &page);
>>          else if (size == PAGE_SIZE || !CMA_DEFAULT_REGION)
>>                  addr = __alloc_remap_buffer(dev, size, gfp, prot, &page, caller);
>>          else
>>                  addr = __alloc_from_contiguous(dev, size, prot, &page, caller);
>
> You should probably ask whoever gave you this kernel as I can't find the
> code above in mainline.
It is my mistake for not cross-checking the src code on my hand
between the mainline.
You are right, this part of code is not the mainline.

Sorry for making you confused,

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-07-10  9:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-04 15:06 some question about __dma_alloc in arch/arm/mm/dma-mapping.c vichy
2015-07-04 15:08 ` vichy
2015-07-06 10:11   ` Catalin Marinas
2015-07-10  9:49     ` vichy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.