linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V3] of: Set the DMA mask to 64 bits when dma_addr_t is 64-bits
@ 2013-04-26 20:31 Laura Abbott
  2013-04-26 20:52 ` Catalin Marinas
  2013-04-26 21:32 ` Rob Herring
  0 siblings, 2 replies; 12+ messages in thread
From: Laura Abbott @ 2013-04-26 20:31 UTC (permalink / raw)
  To: linux-arm-kernel

Currently, of_platform_device_create_pdata always sets the
coherent DMA mask to 32 bits. On ARM systems without CONFIG_ZONE_DMA,
arm_dma_limit gets set to ~0 or 0xFFFFFFFFFFFFFFFF on LPAE based
systems. Since arm_dma_limit represents the smallest dma_mask
on the system, the default of 32 bits prevents any dma_coherent
allocation from succeeding unless clients manually set the
dma mask first. Rather than make every client on an LPAE system set
the mask manually, account for the size of dma_addr_t when setting
the coherent mask.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
---
 drivers/of/platform.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index 0970505..5f0ba94 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -214,7 +214,7 @@ struct platform_device *of_platform_device_create_pdata(
 #if defined(CONFIG_MICROBLAZE)
 	dev->archdata.dma_mask = 0xffffffffUL;
 #endif
-	dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+	dev->dev.coherent_dma_mask = DMA_BIT_MASK(sizeof(dma_addr_t) * 8);
 	dev->dev.bus = &platform_bus_type;
 	dev->dev.platform_data = platform_data;
 
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-07-09  2:38 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-26 20:31 [PATCH V3] of: Set the DMA mask to 64 bits when dma_addr_t is 64-bits Laura Abbott
2013-04-26 20:52 ` Catalin Marinas
2013-04-26 21:32 ` Rob Herring
2013-07-03 14:15   ` Ming Lei
2013-07-05 19:33     ` Laura Abbott
2013-07-06  2:21       ` Ming Lei
2013-07-06  9:15         ` Russell King - ARM Linux
2013-07-08 10:03           ` Ming Lei
2013-07-08 10:44             ` Russell King - ARM Linux
2013-07-08 10:42       ` Russell King - ARM Linux
2013-07-09  2:38         ` Laura Abbott
2013-07-05 22:19     ` Russell King - ARM Linux

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).