提交 ffa56e55 编写于 作者: N Nishanth Aravamudan 提交者: Benjamin Herrenschmidt

powerpc/dma: Fix check for direct DMA support

The current check is wrong because it does not take the DMA offset intot
account, and in the case of a driver which doesn't actually support
64bits would falsely report that device as working.
Signed-off-by: NMilton Miller <miltonm@bga.com>
Signed-off-by: NNishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
上级 1cb8e85a
...@@ -90,7 +90,7 @@ static int dma_direct_dma_supported(struct device *dev, u64 mask) ...@@ -90,7 +90,7 @@ static int dma_direct_dma_supported(struct device *dev, u64 mask)
/* Could be improved so platforms can set the limit in case /* Could be improved so platforms can set the limit in case
* they have limited DMA windows * they have limited DMA windows
*/ */
return mask >= (memblock_end_of_DRAM() - 1); return mask >= get_dma_offset(dev) + (memblock_end_of_DRAM() - 1);
#else #else
return 1; return 1;
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册