All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] dw_dmac: apply default dma_mask if needed
@ 2013-02-14  8:41 Andy Shevchenko
  2013-02-14  9:45 ` Vinod Koul
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2013-02-14  8:41 UTC (permalink / raw)
  To: Vinod Koul, linux-kernel, spear-devel, Viresh Kumar; +Cc: Andy Shevchenko

In some cases we got the device without dma_mask configured. We have to apply
the default value to avoid crashes during memory mapping.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
---
Since v1:
- rebased on top of recent next branch from Vinod
 drivers/dma/dw_dmac.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c
index 6694676..4c83f18 100644
--- a/drivers/dma/dw_dmac.c
+++ b/drivers/dma/dw_dmac.c
@@ -1661,6 +1661,12 @@ static int dw_probe(struct platform_device *pdev)
 	if (!regs)
 		return -EBUSY;
 
+	/* Apply default dma_mask if needed */
+	if (!pdev->dev.dma_mask) {
+		pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
+		pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+	}
+
 	dw_params = dma_read_byaddr(regs, DW_PARAMS);
 	autocfg = dw_params >> DW_PARAMS_EN & 0x1;
 
-- 
1.7.10.4


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

end of thread, other threads:[~2013-02-14  9:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-14  8:41 [PATCH v2] dw_dmac: apply default dma_mask if needed Andy Shevchenko
2013-02-14  9:45 ` Vinod Koul

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.