diff options
Diffstat (limited to 'arch/x86/kernel/pci-gart_64.c')
-rw-r--r-- | arch/x86/kernel/pci-gart_64.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/arch/x86/kernel/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c index 0b99d4a06f74..1b0c412566e5 100644 --- a/arch/x86/kernel/pci-gart_64.c +++ b/arch/x86/kernel/pci-gart_64.c | |||
@@ -214,24 +214,14 @@ static void iommu_full(struct device *dev, size_t size, int dir) | |||
214 | static inline int | 214 | static inline int |
215 | need_iommu(struct device *dev, unsigned long addr, size_t size) | 215 | need_iommu(struct device *dev, unsigned long addr, size_t size) |
216 | { | 216 | { |
217 | u64 mask = *dev->dma_mask; | 217 | return force_iommu || |
218 | int high = addr + size > mask; | 218 | !is_buffer_dma_capable(*dev->dma_mask, addr, size); |
219 | int mmu = high; | ||
220 | |||
221 | if (force_iommu) | ||
222 | mmu = 1; | ||
223 | |||
224 | return mmu; | ||
225 | } | 219 | } |
226 | 220 | ||
227 | static inline int | 221 | static inline int |
228 | nonforced_iommu(struct device *dev, unsigned long addr, size_t size) | 222 | nonforced_iommu(struct device *dev, unsigned long addr, size_t size) |
229 | { | 223 | { |
230 | u64 mask = *dev->dma_mask; | 224 | return !is_buffer_dma_capable(*dev->dma_mask, addr, size); |
231 | int high = addr + size > mask; | ||
232 | int mmu = high; | ||
233 | |||
234 | return mmu; | ||
235 | } | 225 | } |
236 | 226 | ||
237 | /* Map a single continuous physical area into the IOMMU. | 227 | /* Map a single continuous physical area into the IOMMU. |