diff options
author | Christoph Hellwig <hch@lst.de> | 2019-02-15 09:06:31 +0100 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2019-02-20 15:28:53 +0100 |
commit | c54fc984dae5fb0007ddfc46dabde6631735689d (patch) | |
tree | 405f8c2a91ab37bbb46d8255ca8378870eac4bdb /arch/sparc/kernel/pci_sun4v.c | |
parent | ccio: allow large DMA masks (diff) | |
download | linux-c54fc984dae5fb0007ddfc46dabde6631735689d.tar.xz linux-c54fc984dae5fb0007ddfc46dabde6631735689d.zip |
sparc64: refactor the ali DMA quirk
Do the quirk first in the dma_supported routines, as we don't need
any of the other checks for it, and remove the duplicate mask checking
that is already done by the callers.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel/pci_sun4v.c')
-rw-r--r-- | arch/sparc/kernel/pci_sun4v.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/sparc/kernel/pci_sun4v.c b/arch/sparc/kernel/pci_sun4v.c index fa0e42b4cbfb..d30eb22b6e11 100644 --- a/arch/sparc/kernel/pci_sun4v.c +++ b/arch/sparc/kernel/pci_sun4v.c @@ -676,6 +676,9 @@ static int dma_4v_supported(struct device *dev, u64 device_mask) struct iommu *iommu = dev->archdata.iommu; u64 dma_addr_mask = iommu->dma_addr_mask; + if (ali_sound_dma_hack(dev, device_mask)) + return 1; + if (device_mask > DMA_BIT_MASK(32)) { if (iommu->atu) dma_addr_mask = iommu->atu->dma_addr_mask; @@ -685,7 +688,7 @@ static int dma_4v_supported(struct device *dev, u64 device_mask) if ((device_mask & dma_addr_mask) == dma_addr_mask) return 1; - return pci64_dma_supported(to_pci_dev(dev), device_mask); + return 0; } static const struct dma_map_ops sun4v_dma_ops = { |