]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
zynqmp-secure: Fix for crash seen with secure image loading
authorKalyani Akula <kalyani.akula@xilinx.com>
Wed, 27 Mar 2019 07:38:11 +0000 (13:08 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 28 Mar 2019 14:32:18 +0000 (15:32 +0100)
This patch resolves the crash/backtrace seen with secure load.
arch_setup_dma_ops is not setting coherent mask due to which
we see a warning (added recently in dma_mapping.h) and backtrace
along with it.

So, instead of using arch_setup_dma_ops we used of_dma_configure.

Signed-off-by: Kalyani Akula <kalyani.akula@xilinx.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/firmware/xilinx/zynqmp-secure.c

index 419786323ff1d7a30ded26360398b36db2f988e6..1d105e04239f8b6501f1a6644b857fe0e7d63d5f 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
+#include <linux/of_device.h>
 
 #define ZYNQMP_AES_KEY_SIZE    64
 
@@ -135,8 +136,15 @@ static int securefw_probe(struct platform_device *pdev)
                return PTR_ERR(eemi_ops);
 
        securefw_pdev = pdev;
-       arch_setup_dma_ops(&securefw_pdev->dev, 0, DMA_BIT_MASK(32),
-                          NULL, true);
+
+       securefw_pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+
+       ret = of_dma_configure(&securefw_pdev->dev, NULL, true);
+       if (ret < 0) {
+               dev_info(&securefw_pdev->dev, "Cannot setup DMA ops\r\n");
+               return ret;
+       }
+
        ret = sysfs_create_groups(&securefw_pdev->dev.kobj, securefw_groups);
        if (ret)
                return ret;