Re: [PATCH 1/4] net: sgi: ioc3-eth: don't abuse dma_direct_* calls

From: David Miller
Date: Thu Oct 31 2019 - 15:15:50 EST


From: Thomas Bogendoerfer <tbogendoerfer@xxxxxxx>
Date: Thu, 31 Oct 2019 16:18:17 +0100

> On Thu, 31 Oct 2019 14:15:01 +0100
> Christoph Hellwig <hch@xxxxxx> wrote:
>
>> On Thu, Oct 31, 2019 at 09:54:30AM +0100, Thomas Bogendoerfer wrote:
>> > I didn't want to argue about that. What I'm interested in is a way how
>> > to allocate dma memory, which is 16kB aligned, via the DMA API ?
>>
>> You can't.
>
> So then __get_free_pages() and dma_map_page() is the only way ?
>
> BTW I've successful tested your patches on an 8 CPU Origin 2k.

Nope, it is not the only way.

Allocate a (SIZE*2)-1 sized piece of DMA memory and align the
resulting CPU pointer and DMA address as needed.