layerscape: add ls1088ardb device support
[openwrt/staging/lynxis/omap.git] / target / linux / layerscape / patches-4.4 / 7144-dpaa-call-arch_setup_dma_ops-before-using-dma_ops.patch
1 From 0ac69de37277aec31d18a8c7b9d9a3a65b629526 Mon Sep 17 00:00:00 2001
2 From: Yangbo Lu <yangbo.lu@nxp.com>
3 Date: Wed, 12 Oct 2016 16:30:57 +0800
4 Subject: [PATCH 144/226] dpaa: call arch_setup_dma_ops before using dma_ops
5
6 A previous patch caused dpaa call trace. This patch provides
7 a temporary workaround for this until this is fixed by upstream.
8
9 Fixes: 1dccb598df54 ("arm64: simplify dma_get_ops")
10 Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
11 ---
12 .../ethernet/freescale/sdk_dpaa/dpaa_eth_common.c | 12 ++++++------
13 drivers/staging/fsl_qbman/qman_high.c | 1 +
14 2 files changed, 7 insertions(+), 6 deletions(-)
15
16 --- a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.c
17 +++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.c
18 @@ -754,6 +754,12 @@ dpa_bp_alloc(struct dpa_bp *dpa_bp)
19 goto pdev_register_failed;
20 }
21
22 +#ifdef CONFIG_FMAN_ARM
23 + /* force coherency */
24 + pdev->dev.archdata.dma_coherent = true;
25 + arch_setup_dma_ops(&pdev->dev, 0, 0, NULL, true);
26 +#endif
27 +
28 err = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(40));
29 if (err)
30 goto pdev_mask_failed;
31 @@ -765,12 +771,6 @@ dpa_bp_alloc(struct dpa_bp *dpa_bp)
32 goto pdev_mask_failed;
33 }
34
35 -#ifdef CONFIG_FMAN_ARM
36 - /* force coherency */
37 - pdev->dev.archdata.dma_coherent = true;
38 - arch_setup_dma_ops(&pdev->dev, 0, 0, NULL, true);
39 -#endif
40 -
41 dpa_bp->dev = &pdev->dev;
42
43 if (dpa_bp->seed_cb) {
44 --- a/drivers/staging/fsl_qbman/qman_high.c
45 +++ b/drivers/staging/fsl_qbman/qman_high.c
46 @@ -662,6 +662,7 @@ struct qman_portal *qman_create_portal(
47 portal->pdev->dev.coherent_dma_mask = DMA_BIT_MASK(40);
48 portal->pdev->dev.dma_mask = &portal->pdev->dev.coherent_dma_mask;
49 #else
50 + arch_setup_dma_ops(&portal->pdev->dev, 0, 0, NULL, false);
51 if (dma_set_mask(&portal->pdev->dev, DMA_BIT_MASK(40))) {
52 pr_err("qman_portal - dma_set_mask() failed\n");
53 goto fail_devadd;