提交 4a9a6bfe 编写于 作者: F FUJITA Tomonori 提交者: Benjamin Herrenschmidt

powerpc: Handle SWIOTLB mapping error properly

Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
上级 46bab4e4
...@@ -143,6 +143,11 @@ static inline void dma_free_coherent(struct device *dev, size_t size, ...@@ -143,6 +143,11 @@ static inline void dma_free_coherent(struct device *dev, size_t size,
static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
{ {
struct dma_map_ops *dma_ops = get_dma_ops(dev);
if (dma_ops->mapping_error)
return dma_ops->mapping_error(dev, dma_addr);
#ifdef CONFIG_PPC64 #ifdef CONFIG_PPC64
return (dma_addr == DMA_ERROR_CODE); return (dma_addr == DMA_ERROR_CODE);
#else #else
......
...@@ -42,7 +42,8 @@ struct dma_map_ops swiotlb_dma_ops = { ...@@ -42,7 +42,8 @@ struct dma_map_ops swiotlb_dma_ops = {
.sync_single_range_for_cpu = swiotlb_sync_single_range_for_cpu, .sync_single_range_for_cpu = swiotlb_sync_single_range_for_cpu,
.sync_single_range_for_device = swiotlb_sync_single_range_for_device, .sync_single_range_for_device = swiotlb_sync_single_range_for_device,
.sync_sg_for_cpu = swiotlb_sync_sg_for_cpu, .sync_sg_for_cpu = swiotlb_sync_sg_for_cpu,
.sync_sg_for_device = swiotlb_sync_sg_for_device .sync_sg_for_device = swiotlb_sync_sg_for_device,
.mapping_error = swiotlb_dma_mapping_error,
}; };
void pci_dma_dev_setup_swiotlb(struct pci_dev *pdev) void pci_dma_dev_setup_swiotlb(struct pci_dev *pdev)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册