returned dma address value of dma_alloc_coherent, is it always in the lower 4GB range?

Valdis Kl=?utf-8?Q?=c4=93?=tnieks valdis.kletnieks at vt.edu
Tue Mar 14 01:14:50 EDT 2023


On Mon, 13 Mar 2023 21:28:28 +0900, "Chan Kim" said:

> which is 32-bit addressable.  Even if the device indicates (via the DMA
> mask)
> that it may address the upper 32-bits, consistent allocation will only
> return > 32-bit addresses for DMA if the consistent DMA mask has been
> explicitly changed via dma_set_coherent_mask().  This is true of the
> dma_pool interface as well.
> ------------------------------

> By context I guess it returns the address in lower 32bit address range even
> it the coherent_dma_mask is set to some bigger value.

No, you have that backwards.   It's not "even if".  It wil give you a 32-bit
address *UNLESS* the driver has called dma_set_coherent_mask() to set a wider
mask *and* the device indicates it supports more than 32 bit addresses...

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 494 bytes
Desc: not available
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20230314/33b763ea/attachment.sig>


More information about the Kernelnewbies mailing list