Commit 7ca6d1cf authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull powerpc fix from Madhavan Srinivasan:

 - fix iommu incorrectly bypassing DMA APIs

Thanks to Dan Horak, Gaurav Batra, and Ritesh Harjani (IBM).

* tag 'powerpc-7.0-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
  powerpc/powernv/iommu: iommu incorrectly bypass DMA APIs
parents 37191140 328335a7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ bool arch_dma_unmap_sg_direct(struct device *dev, struct scatterlist *sg,
}
bool arch_dma_alloc_direct(struct device *dev)
{
	if (dev->dma_ops_bypass)
	if (dev->dma_ops_bypass && dev->bus_dma_limit)
		return true;

	return false;
@@ -75,7 +75,7 @@ bool arch_dma_alloc_direct(struct device *dev)

bool arch_dma_free_direct(struct device *dev, dma_addr_t dma_handle)
{
	if (!dev->dma_ops_bypass)
	if (!dev->dma_ops_bypass || !dev->bus_dma_limit)
		return false;

	return is_direct_handle(dev, dma_handle);