From: [email protected]
> Sent: 01 August 2019 23:02
>
> On architectures that are not (or are optionally) DMA coherent,
> dma_alloc_coherent() returns an address into the vmalloc space,
> and calling virt_to_phys() on this address returns an unusable
> physical address.
So? what is the code trying to use the return value of virt_to_phys() for?
The 'cpu physical address' isn't (usually) a very interesting number.
The value you normally want is the address the hardware should use
in order to access the memory - this isn't (in general) the same value.
(It might be different for different devices.)
ISTR that dma_alloc_coherent() returns this value to the caller.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT,
UK
Registration No: 1397386 (Wales)