Merge remote-tracking branch 'lsk/linux-linaro-lsk-v4.4-android' into linux-linaro...
[firefly-linux-kernel-4.4.55.git] / arch / arm64 / mm / dma-mapping.c
index 7963aa4b5d2869b70dfd9a2f3d0ef501a033480b..ddfb97a299f2bf1e1e248bc2ded0779d644ce944 100644 (file)
@@ -170,7 +170,7 @@ static void *__dma_alloc(struct device *dev, size_t size,
        /* create a coherent mapping */
        page = virt_to_page(ptr);
        coherent_ptr = dma_common_contiguous_remap(page, size, VM_USERMAP,
-                                                  prot, NULL);
+                                                  prot, __builtin_return_address(0));
        if (!coherent_ptr)
                goto no_map;
 
@@ -933,6 +933,10 @@ static int __init __iommu_dma_init(void)
                ret = register_iommu_dma_ops_notifier(&platform_bus_type);
        if (!ret)
                ret = register_iommu_dma_ops_notifier(&amba_bustype);
+
+       /* handle devices queued before this arch_initcall */
+       if (!ret)
+               __iommu_attach_notifier(NULL, BUS_NOTIFY_ADD_DEVICE, NULL);
        return ret;
 }
 arch_initcall(__iommu_dma_init);