aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/layerscape/patches-4.4/7144-dpaa-call-arch_setup_dma_ops-before-using-dma_ops.patch
blob: ef8cf01b47df331919d95292a0688080091c35d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
From 0ac69de37277aec31d18a8c7b9d9a3a65b629526 Mon Sep 17 00:00:00 2001
From: Yangbo Lu <yangbo.lu@nxp.com>
Date: Wed, 12 Oct 2016 16:30:57 +0800
Subject: [PATCH 144/226] dpaa: call arch_setup_dma_ops before using dma_ops

A previous patch caused dpaa call trace. This patch provides
a temporary workaround for this until this is fixed by upstream.

Fixes: 1dccb598df54 ("arm64: simplify dma_get_ops")
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
---
 .../ethernet/freescale/sdk_dpaa/dpaa_eth_common.c  |   12 ++++++------
 drivers/staging/fsl_qbman/qman_high.c              |    1 +
 2 files changed, 7 insertions(+), 6 deletions(-)

--- a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.c
+++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.c
@@ -754,6 +754,12 @@ dpa_bp_alloc(struct dpa_bp *dpa_bp)
 		goto pdev_register_failed;
 	}
 
+#ifdef CONFIG_FMAN_ARM
+	/* force coherency */
+	pdev->dev.archdata.dma_coherent = true;
+	arch_setup_dma_ops(&pdev->dev, 0, 0, NULL, true);
+#endif
+
 	err = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(40));
 	if (err)
 		goto pdev_mask_failed;
@@ -765,12 +771,6 @@ dpa_bp_alloc(struct dpa_bp *dpa_bp)
 			goto pdev_mask_failed;
 	}
 
-#ifdef CONFIG_FMAN_ARM
-	/* force coherency */
-	pdev->dev.archdata.dma_coherent = true;
-	arch_setup_dma_ops(&pdev->dev, 0, 0, NULL, true);
-#endif
-
 	dpa_bp->dev = &pdev->dev;
 
 	if (dpa_bp->seed_cb) {
--- a/drivers/staging/fsl_qbman/qman_high.c
+++ b/drivers/staging/fsl_qbman/qman_high.c
@@ -662,6 +662,7 @@ struct qman_portal *qman_create_portal(
 	portal->pdev->dev.coherent_dma_mask = DMA_BIT_MASK(40);
 	portal->pdev->dev.dma_mask = &portal->pdev->dev.coherent_dma_mask;
 #else
+	arch_setup_dma_ops(&portal->pdev->dev, 0, 0, NULL, false);
 	if (dma_set_mask(&portal->pdev->dev, DMA_BIT_MASK(40))) {
 		pr_err("qman_portal - dma_set_mask() failed\n");
 		goto fail_devadd;