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

Christoph Hellwig
2019-10-31T17:01:31Z

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@lst.de> 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.