core, dma-direct: add a flag 32-bit dma limits

Various PCI bridges (VIA PCI, Xilinx PCIe) limit DMA to only 32-bits
even if the device itself supports more.  Add a single bit flag to
struct device (to be moved into the dma extension once we get to it)
to flag such devices and reject larger DMA to them.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
这个提交包含在:
Christoph Hellwig
2018-04-27 09:02:55 +02:00
父节点 884571f0de
当前提交 f068fe3170
修改 2 个文件,包含 9 行新增0 行删除

查看文件

@@ -172,6 +172,12 @@ int dma_direct_supported(struct device *dev, u64 mask)
if (mask < DMA_BIT_MASK(32))
return 0;
#endif
/*
* Various PCI/PCIe bridges have broken support for > 32bit DMA even
* if the device itself might support it.
*/
if (dev->dma_32bit_limit && mask > DMA_BIT_MASK(32))
return 0;
return 1;
}