[PATCH] iommu/io-pgtable-arm: Don't use dma_to_phys()
Robin Murphy
robin.murphy at arm.com
Thu Sep 17 08:53:08 PDT 2015
On 17/09/15 15:52, Will Deacon wrote:
[...]
>> -static dma_addr_t __arm_lpae_dma_addr(struct device *dev, void *pages)
>> -{
>> - return phys_to_dma(dev, virt_to_phys(pages));
>> -}
>
> Can we keep this helper kicking around, at least to contain the ugliness
> of the virt_to_phys + cast?
Can do for the sync and unmap cases - the alloc_pages one needs to avoid
truncation in the comparison if dma_addr_t and phys_addr_t are different
sizes, so can't safely cast one to the other either way. I can at least
get rid of the u64 casts there though, as they seem superfluous after a
bit of experimentation and another read of the good old "Usual
arithmetic conversions". I'll fix up and repost.
Robin.
>
> Will
>
More information about the linux-arm-kernel
mailing list