Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ffa56e55 authored by Nishanth Aravamudan's avatar Nishanth Aravamudan Committed by Benjamin Herrenschmidt
Browse files

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: default avatarMilton Miller <miltonm@bga.com>
Signed-off-by: default avatarNishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 1cb8e85a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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
	 * they have limited DMA windows
	 */
	return mask >= (memblock_end_of_DRAM() - 1);
	return mask >= get_dma_offset(dev) + (memblock_end_of_DRAM() - 1);
#else
	return 1;
#endif