lkml.org 
[lkml]   [2015]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH V3 3/4] dmaselftest: add memcpy selftest support functions
Date
On Monday 09 November 2015 23:49:54 Sinan Kaya wrote:
> On 11/9/2015 8:48 AM, Timur Tabi wrote:
> > Sinan Kaya wrote:
> >>>
> >>> And why kmalloc anyway? Why not leave it on the stack?
> >>>
> >>> char src[] = "hello world";
> >>>
> >>> ?
> >>
> >> I need to call dma_map_single on this address to convert it to a DMA
> >> address. That's why.
> >
> > And you can't do that with an object that's on the stack?
> >
>
> no, pasting from here.
>
> https://www.kernel.org/doc/Documentation/DMA-API-HOWTO.txt
>
> under 'What memory is DMA'able?'
>
> This rule also means that you may use neither kernel image addresses
> (items in data/text/bss segments), nor module image addresses, nor
> stack addresses for DMA.

Correct. I think this is just because of cache line alignment that
is guaranteed for kmalloc but not for anything on the stack.

Arnd


\
 
 \ /
  Last update: 2015-11-10 11:41    [W:0.068 / U:0.488 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site