Skip to contentSkip to conversation

etnaviv: Make sure DMA is setup

PATCH In review Guido Günther 2 participants 3 messages Sep 12, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 etnaviv: Make sure DMA is setup

Since we don't want to setup up DMA via device tree we end up with arm64's dummy_dma_ops otherwise.

Links: https://lists.freedesktop.org/archives/etnaviv/2018-August/001925.html

---
 drivers/gpu/drm/etnaviv/etnaviv_drv.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/gpu/drm/etnaviv/etnaviv_drv.c +12 -1
index 9b2720b41571..e488c07f333c 100644
@@ -591,8 +591,19 @@ static int etnaviv_pdev_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	struct component_match *match = NULL;
+	int ret;
+
+	ret = of_dma_configure(dev, NULL, true);
+	if (ret) {
+		dev_err(&pdev->dev, "Setting up dma ops failed\n");
+		return ret;
+	};
 
-	dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
+	ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
+	if (ret) {
+		dev_err(&pdev->dev, "dma_coerce_mask_and_coherent failed\n");
+		return ret;
+	};
 
 	if (!dev->platform_data) {
 		struct device_node *core_node;
Signature · 5 lines
2.18.0
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer
#1 lore raw

Hi Guido,

I've just sent out a patch which should hopefully also fix this issue, in a (slightly) more correct way. I don't have my MX8M system up right now, so would appreciate if you could test drive this patch.

Regards,
Lucas

Am Mittwoch, den 12.09.2018, 17:44 +0200 schrieb Guido Günther:

Quoted 25 lines

Since we don't want to setup up DMA via device tree we end up with arm64's dummy_dma_ops otherwise.

Links: https://lists.freedesktop.org/archives/etnaviv/2018-August/001925.html

Quoted 1 line

---
 drivers/gpu/drm/etnaviv/etnaviv_drv.c | 13 ++++++++++++-

 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/gpu/drm/etnaviv/etnaviv_drv.c +1 -0
index 9b2720b41571..e488c07f333c 100644
@@ -591,8 +591,19 @@ static int etnaviv_pdev_probe(struct platform_device *pdev)
  {
 >  	struct device *dev = &pdev->dev;
 >  	struct component_match *match = NULL;
 > +	int ret;
+
 > +	ret = of_dma_configure(dev, NULL, true);
 > +	if (ret) {
 > +		dev_err(&pdev->dev, "Setting up dma ops failed\n");
 > +		return ret;

Review

Quoted 1 line
(quoted diff) +1 -0
+	};

Quoted 9 lines

drivers/gpu/drm/etnaviv/etnaviv_drv.c static int etnaviv_pdev_probe(struct platform_device *pdev) · line 606

Quoted 6 lines
drivers/gpu/drm/etnaviv/etnaviv_drv.c +5 -1
-	dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
+	ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
+	if (ret) {
+		dev_err(&pdev->dev, "dma_coerce_mask_and_coherent failed\n");
+		return ret;
+	};

Quoted 2 lines

  if (!dev->platform_data) {
  struct device_node *core_node;

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

maintainer
#2 lore raw

Am Mittwoch, den 12.09.2018, 17:50 +0200 schrieb Lucas Stach:

Quoted 5 lines

Hi Guido,

I've just sent out a patch which should hopefully also fix this issue, in a (slightly) more correct way. I don't have my MX8M system up right now, so would appreciate if you could test drive this patch.

And I just realized that sharing the DT node has it's own set of issues, so please don't bother with this patch, I'll send a follow-up tomorrow.

Quoted 40 lines

Regards,
Lucas

Am Mittwoch, den 12.09.2018, 17:44 +0200 schrieb Guido Günther:

Quoted 36 lines

Since we don't want to setup up DMA via device tree we end up with arm64's dummy_dma_ops otherwise.

Links: https://lists.freedesktop.org/archives/etnaviv/2018-August/001925.html

Quoted 1 line

---
 drivers/gpu/drm/etnaviv/etnaviv_drv.c | 13 ++++++++++++-

 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/gpu/drm/etnaviv/etnaviv_drv.c +1 -0
index 9b2720b41571..e488c07f333c 100644
@@ -591,8 +591,19 @@ static int etnaviv_pdev_probe(struct platform_device *pdev)
  {
 > > > >  	struct device *dev = &pdev->dev;
 > > > >  	struct component_match *match = NULL;
 > +	int ret;
 
+
 > > > > +	ret = of_dma_configure(dev, NULL, true);
 > > > > +	if (ret) {
 > > > > +		dev_err(&pdev->dev, "Setting up dma ops failed\n");

Review

Quoted 2 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
(quoted diff) +1 -0
+		return ret;
(quoted diff) +1 -0
+	};

Review

Quoted 6 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
drivers/gpu/drm/etnaviv/etnaviv_drv.c +4 -1
-	dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
+	ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
+	if (ret) {
+		dev_err(&pdev->dev, "dma_coerce_mask_and_coherent failed\n");
+		return ret;
(quoted diff) +1 -0
+	};

Quoted 7 lines
Quoted 2 lines
Quoted 2 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

  if (!dev->platform_data) {

  struct device_node *core_node;

_______________________________________________
etnaviv mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/etnaviv

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel