On Monday 19 May 2014 10:16:57 Alan Stern wrote: > On Mon, 19 May 2014, Arnd Bergmann wrote: > > > > dma_alloc_coherent() on arm64 should return 32-bit addresses if the > > > coherent_dma_mask is set to 32-bit. Which kernel version is this? > > > > The more important question is what happens to high buffers allocated elsewhere > > that get passed into dma_map_sg by a device driver. > > I disagree. That is, the question about dma_map_sg is not more > important (for ehci-hcd) than the question about dma_alloc_coherent. > > In this case it is particularly tricky. The driver calls > dma_pool_create() several times in addition to calling > dma_alloc_coherent(), and the hardware requires that all of those > pools plus the coherent buffer have DMA addresses with the same upper > 32 bits. > > As far as I know, the only way to enforce that is by requiring all > those items either to be allocated in or to be mapped to the first 4 GB > of memory. But that part is easy to enforce by using a 32-bit dma mask. For dma_map_*, the problem is that we can't possibly enforce the location of the buffer, you have to go back to swiotlb bounce buffers for those. In a lot of cases, tests don't even run into the problem because the block layer and the network layer both have their own way to deal with bounce buffers, at least on 32-bit systems, but you still run into the issue with less common drivers. Arnd -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html