All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/lima: Handle dma_set_coherent_mask error codes
@ 2021-12-06  2:35 ` Jiasheng Jiang
  0 siblings, 0 replies; 2+ messages in thread
From: Jiasheng Jiang @ 2021-12-06  2:35 UTC (permalink / raw)
  To: yuq825, airlied, daniel, p.zabel, lgirdwood, broonie
  Cc: dri-devel, lima, linux-kernel, Jiasheng Jiang

The return value of dma_set_coherent_mask() is not always 0.
To catch the exception in case that dma is not support the mask.

Fixes: a1d2a6339961 ("drm/lima: driver for ARM Mali4xx GPUs")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
---
 drivers/gpu/drm/lima/lima_device.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/lima/lima_device.c b/drivers/gpu/drm/lima/lima_device.c
index 65fdca366e41..75e9a2060b47 100644
--- a/drivers/gpu/drm/lima/lima_device.c
+++ b/drivers/gpu/drm/lima/lima_device.c
@@ -356,7 +356,9 @@ int lima_device_init(struct lima_device *ldev)
 	struct platform_device *pdev = to_platform_device(ldev->dev);
 	int err, i;
 
-	dma_set_coherent_mask(ldev->dev, DMA_BIT_MASK(32));
+	err = dma_set_coherent_mask(ldev->dev, DMA_BIT_MASK(32));
+	if (err)
+		return err;
 
 	err = lima_clk_init(ldev);
 	if (err)
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] drm/lima: Handle dma_set_coherent_mask error codes
@ 2021-12-06  2:35 ` Jiasheng Jiang
  0 siblings, 0 replies; 2+ messages in thread
From: Jiasheng Jiang @ 2021-12-06  2:35 UTC (permalink / raw)
  To: yuq825, airlied, daniel, p.zabel, lgirdwood, broonie
  Cc: Jiasheng Jiang, lima, dri-devel, linux-kernel

The return value of dma_set_coherent_mask() is not always 0.
To catch the exception in case that dma is not support the mask.

Fixes: a1d2a6339961 ("drm/lima: driver for ARM Mali4xx GPUs")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
---
 drivers/gpu/drm/lima/lima_device.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/lima/lima_device.c b/drivers/gpu/drm/lima/lima_device.c
index 65fdca366e41..75e9a2060b47 100644
--- a/drivers/gpu/drm/lima/lima_device.c
+++ b/drivers/gpu/drm/lima/lima_device.c
@@ -356,7 +356,9 @@ int lima_device_init(struct lima_device *ldev)
 	struct platform_device *pdev = to_platform_device(ldev->dev);
 	int err, i;
 
-	dma_set_coherent_mask(ldev->dev, DMA_BIT_MASK(32));
+	err = dma_set_coherent_mask(ldev->dev, DMA_BIT_MASK(32));
+	if (err)
+		return err;
 
 	err = lima_clk_init(ldev);
 	if (err)
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-06 10:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-06  2:35 [PATCH] drm/lima: Handle dma_set_coherent_mask error codes Jiasheng Jiang
2021-12-06  2:35 ` Jiasheng Jiang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.