On Monday 22 September 2014 17:15:06 Boris BREZILLON wrote:so I think we can use dma_set_mask_and_coherent(...) to set dma_mask and dma_coherent_mark
We used to get this wrong in the of_platform code, but it shouldBy "This is the default mask" do you mean it shouldn't be called at+This is the default coherent mask. If you call this function, you
+ /* TODO(djkurtz): fetch the mapping start/size from somewhere */
+ mapping = arm_iommu_create_mapping(&platform_bus_type, 0x10000000,
+ SZ_1G);
+ if (IS_ERR(mapping)) {
+ ret = PTR_ERR(mapping);
+ goto err_config_cleanup;
+ }
+
+ dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
should normally check the return value, or call dma_set_mask first,
which you apparently don't do here, and in another place in this
patch.
all ? Cause I ran into some trouble when not calling this in my
atmel-hlcdc driver.
work now.
Actually, in my case the platform device is created by the MFD coreThat may well be different, but it seems like a good idea to allow
which seems to let the coherent_dma_mask uninitialized.
the MFD core to set this up as well.
In general, we expect that devices that are capable of doing DMA
start with a 32-bit mask for both dma_mask and dma_coherent_mask,
and a driver that requires a smaller masks or wants a larger mask
has to call the appropriate interface to set these, and check the
return value.
Arnd