Thread (30 messages) 30 messages, 5 authors, 2015-01-23

[PATCH v3 2/4] of: move of_dma_configure() to device, c to help re-use

From: arnd@arndb.de (Arnd Bergmann)
Date: 2015-01-08 08:40:32
Also in: linux-devicetree, linux-iommu, linux-pci, lkml

On Wednesday 07 January 2015 17:37:56 Rob Herring wrote:
On Wed, Jan 7, 2015 at 12:49 PM, Murali Karicheri [off-list ref] wrote:
quoted
+       ret = of_dma_get_range(np, &dma_addr, &paddr, &size);
+       if (ret < 0) {
+               dma_addr = offset = 0;
+               size = dev->coherent_dma_mask + 1;
If coherent_dma_mask is DMA_BIT_MASK(64), then you will overflow and
have a size of 0. There may also be a problem when the mask is only
32-bit type.
The mask is always a 64-bit type, it's not optional. But you are right,
the 64-bit mask case is broken, so I guess we have to fix it differently
by always passing the smaller value into arch_setup_dma_ops and
adapting that function instead.

	Arnd
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help