Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64...
[linux-2.6-block.git] / arch / arm64 / mm / dma-mapping.c
index 5992eb9a9a08e6f315ea77db0b7fe7c2aa0e0781..1d17dbeafe7605f6c5efe63ae192b35e27046faf 100644 (file)
@@ -80,10 +80,6 @@ static int __swiotlb_mmap_pfn(struct vm_area_struct *vma,
 
 static int __init arm64_dma_init(void)
 {
-       WARN_TAINT(ARCH_DMA_MINALIGN < cache_line_size(),
-                  TAINT_CPU_OUT_OF_SPEC,
-                  "ARCH_DMA_MINALIGN smaller than CTR_EL0.CWG (%d < %d)",
-                  ARCH_DMA_MINALIGN, cache_line_size());
        return dma_atomic_pool_init(GFP_DMA32, __pgprot(PROT_NORMAL_NC));
 }
 arch_initcall(arm64_dma_init);
@@ -461,6 +457,14 @@ static void __iommu_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
 void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
                        const struct iommu_ops *iommu, bool coherent)
 {
+       int cls = cache_line_size_of_cpu();
+
+       WARN_TAINT(!coherent && cls > ARCH_DMA_MINALIGN,
+                  TAINT_CPU_OUT_OF_SPEC,
+                  "%s %s: ARCH_DMA_MINALIGN smaller than CTR_EL0.CWG (%d < %d)",
+                  dev_driver_string(dev), dev_name(dev),
+                  ARCH_DMA_MINALIGN, cls);
+
        dev->dma_coherent = coherent;
        __iommu_setup_dma_ops(dev, dma_base, size, iommu);