|author||Bjorn Helgaas <email@example.com>||2014-05-20 16:54:22 -0600|
|committer||Bjorn Helgaas <firstname.lastname@example.org>||2014-05-20 16:55:23 -0600|
DMA-API: Change dma_declare_coherent_memory() CPU address to phys_addr_t
dma_declare_coherent_memory() takes two addresses for a region of memory: a "bus_addr" and a "device_addr". I think the intent is that "bus_addr" is the physical address a *CPU* would use to access the region, and "device_addr" is the bus address the *device* would use to address the region. Rename "bus_addr" to "phys_addr" and change its type to phys_addr_t. Most callers already supply a phys_addr_t for this argument. The others supply a 32-bit integer (a constant, unsigned int, or __u32) and need no change. Use "unsigned long", not phys_addr_t, to hold PFNs. No functional change (this could theoretically fix a truncation in a config with 32-bit dma_addr_t and 64-bit phys_addr_t, but I don't think there are any such cases involving this code). Signed-off-by: Bjorn Helgaas <email@example.com> Acked-by: Arnd Bergmann <firstname.lastname@example.org> Acked-by: Greg Kroah-Hartman <email@example.com> Acked-by: James Bottomley <jbottomley@Parallels.com> Acked-by: Randy Dunlap <firstname.lastname@example.org>
Diffstat (limited to 'Documentation/DMA-API.txt')
1 files changed, 4 insertions, 5 deletions
diff --git a/Documentation/DMA-API.txt b/Documentation/DMA-API.txt
index 1147eba4312..4f1cdc5febd 100644
@@ -497,19 +497,18 @@ continuing on for size. Again, you *must* observe the cache line
boundaries when doing this.
-dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
+dma_declare_coherent_memory(struct device *dev, phys_addr_t phys_addr,
dma_addr_t device_addr, size_t size, int
Declare region of memory to be handed out by dma_alloc_coherent() when
it's asked for coherent memory for this device.
-bus_addr is the physical address to which the memory is currently
-assigned in the bus responding region (this will be used by the
-platform to perform the mapping).
+phys_addr is the cpu physical address to which the memory is currently
+assigned (this will be ioremapped so the cpu can access the region).
device_addr is the bus address the device needs to be programmed
-with actually to address this memory (this will be handed out as the
+with to actually address this memory (this will be handed out as the
dma_addr_t in dma_alloc_coherent()).
size is the size of the area (must be multiples of PAGE_SIZE).