Re: [PATCH 4/9] dma-mapping: move the arm64 ncoherent alloc/free support to common code

From: Christoph Hellwig
Date: Sat Dec 01 2018 - 12:03:29 EST


On Fri, Nov 30, 2018 at 07:05:23PM +0000, Robin Murphy wrote:
> It's a bit yuck that we now end up with arch_* hooks being a mix of arch
> code and not-actually-arch-code, but I guess there's some hope of coming
> back and streamlining things in future once all the big moves are done.

Yes, I hope we can use some form of common code here for most
architectures eventually. But that will some time.

> I can't really be bothered to nitpick the typos above and the slight
> inconsistencies in some of the cosmetic code changes, but one worthwhile
> thing stands out...

I'm usually fine picking up nitpicks. For now I'll apply the series
with the pointed out fixups, but if you want to send the fixups
I'd be glad.

>> + val = gen_pool_alloc(atomic_pool, size);
>> + if (val) {
>> + phys_addr_t phys = gen_pool_virt_to_phys(atomic_pool, val);
>> +
>> + *ret_page = phys_to_page(phys);
>
> Looks like phys_to_page() isn't particularly portable, so we probably want
> an explicit pfn_to_page(__phys_to_pfn(phys)) here. Otherwise, the
> fundamental refactoring looks OK.

Ok, I'll updated it.