[PATCH 7/7] Minor compiling fix

carson bill bill4carson at gmail.com
Thu Mar 1 07:42:37 EST 2012


2012/3/1 Arnd Bergmann <arnd at arndb.de>
>
> On Thursday 01 March 2012, bill4carson wrote:
> > On 2012年02月29日 20:35, Arnd Bergmann wrote:
> > > On Monday 13 February 2012, Bill Carson wrote:
> > >> --- a/arch/arm/mm/dma-mapping.c
> > >> +++ b/arch/arm/mm/dma-mapping.c
> > >> @@ -152,9 +152,6 @@ static struct arm_vmregion_head consistent_head = {
> > >>          .vm_end         = CONSISTENT_END,
> > >>   };
> > >>
> > >> -#ifdef CONFIG_HUGETLB_PAGE
> > >> -#error ARM Coherent DMA allocator does not (yet) support huge TLB
> > >> -#endif
> > >
> > > This one needs an explanation, too. What has changed that now allows
> > > dma_alloc_coherent to work with CONFIG_HUGETLB_PAGE set that did not
> > > work before?
> > >
> >
> > AFAIK, __dma_alloc has the finest granularity at 4k page size even when
> > user requests 1M bytes memory.
> >
> > but current hugetlb low level set_hugepte_at *ONLY*/*MUST* support 2M
> > page mapping, so it can't be used to create huge dma mapping in a more
> > general way.
> >
> > comments this error out doesn't mean that it could support huge page dma
> > mapping now with this patch, just shut up gcc when compiling.
> >
> > Adding a single low level hook to create 1M page mapping can satisfy
> > the needs, but apparently that's out of hugetlb scope.
> > And it's on my TODO list :)
>
> Hmm, I'm still not sure I'm following. The coherent DMA area is currently
> limited to 2MB or a small multiple of that, so you would not be able
> to allocate coherent hugepages anyway.
>
>
> Further, I don't think there are any device drivers that call
> dma_alloc_coherent and expect to map the resulting page into
> user space, or that we even have an interface for that.
>

This "ifdef" is used to remind dma implementation should use hugetlb low
API to set up huge page mappings one day hugetlb is supported, just it!

For now, I don't see any direct relationship dma alloc has to do with hugetlb
in a more general way other than both could share low level page table
management.


> This entire chunk of code is also getting changed with the addition of CMA.
>
>        Arnd



More information about the linux-arm-kernel mailing list