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

From: Christoph Hellwig
Date: Thu Oct 31 2019 - 13:01:31 EST


On Thu, Oct 31, 2019 at 04:18:17PM +0100, Thomas Bogendoerfer wrote:
> 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 ?

Or dma_alloc_coherent + check alignment + allocate larger and align
yourself. In practice you'll always get alignmened memory at the
moment, but there is no API gurantee.