aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-11-14 03:23:07 -0500
committerScott Wood <oss@buserror.net>2018-12-21 21:09:24 -0500
commitc6e5485e0cb509292a14e880e1944143f99758c7 (patch)
treebb47b8947a6d5ad49f74373a15dd063a368b7888 /arch/powerpc
parent7811eade247cdf90b26dd0951613e77614192771 (diff)
powerpc/fsl_pci: simplify fsl_pci_dma_set_mask
swiotlb will only bounce buffer when the effective dma address for the device is smaller than the actual DMA range. Instead of flipping between the swiotlb and nommu ops for FSL SOCs that have the second outbound window just don't set the bus dma_mask in this case. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Scott Wood <oss@buserror.net>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/sysdev/fsl_pci.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index 918be816b097..f82d274fc91d 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -135,7 +135,7 @@ static int fsl_pci_dma_set_mask(struct device *dev, u64 dma_mask)
135 * mapping that allows addressing any RAM address from across PCI. 135 * mapping that allows addressing any RAM address from across PCI.
136 */ 136 */
137 if (dev_is_pci(dev) && dma_mask >= pci64_dma_offset * 2 - 1) { 137 if (dev_is_pci(dev) && dma_mask >= pci64_dma_offset * 2 - 1) {
138 set_dma_ops(dev, &dma_nommu_ops); 138 dev->bus_dma_mask = 0;
139 set_dma_offset(dev, pci64_dma_offset); 139 set_dma_offset(dev, pci64_dma_offset);
140 } 140 }
141 141
@@ -395,10 +395,6 @@ static void setup_pci_atmu(struct pci_controller *hose)
395 out_be32(&pci->piw[win_idx].piwar, piwar); 395 out_be32(&pci->piw[win_idx].piwar, piwar);
396 } 396 }
397 397
398 /*
399 * install our own dma_set_mask handler to fixup dma_ops
400 * and dma_offset
401 */
402 ppc_md.dma_set_mask = fsl_pci_dma_set_mask; 398 ppc_md.dma_set_mask = fsl_pci_dma_set_mask;
403 399
404 pr_info("%pOF: Setup 64-bit PCI DMA window\n", hose->dn); 400 pr_info("%pOF: Setup 64-bit PCI DMA window\n", hose->dn);