Skip to contentSkip to conversation

drm/msm: Check return value of of_dma_configure()

PATCH Applied Sui Jingfeng 4 participants 6 messages Nov 4, 2024 – Dec 24, 2024

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

PATCH 1/1 drm/msm: Check return value of of_dma_configure()

Because the of_dma_configure() will returns '-EPROBE_DEFER' if the probe procedure of the specific platform IOMMU driver is not finished yet. It can also return other error code for various reasons.

Stop pretending that it will always suceess, quit if it fail.

---
 drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/msm/adreno/a6xx_gmu.c +6 -2
index 37927bdd6fbe..b26dfe0a76c5 100644
@@ -1605,7 +1605,9 @@ int a6xx_gmu_wrapper_init(struct a6xx_gpu *a6xx_gpu, struct device_node *node)
 
 	gmu->dev = &pdev->dev;
 
-	of_dma_configure(gmu->dev, node, true);
+	ret = of_dma_configure(gmu->dev, node, true);
+	if (ret)
+		return ret;
 
 	pm_runtime_enable(gmu->dev);
 
@@ -1670,7 +1672,9 @@ int a6xx_gmu_init(struct a6xx_gpu *a6xx_gpu, struct device_node *node)
 
 	gmu->dev = &pdev->dev;
 
-	of_dma_configure(gmu->dev, node, true);
+	ret = of_dma_configure(gmu->dev, node, true);
+	if (ret)
+		return ret;
 
 	/* Fow now, don't do anything fancy until we get our feet under us */
 	gmu->idle_level = GMU_IDLE_STATE_ACTIVE;
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Sui Jingfeng

Because the of_dma_configure() will returns '-EPROBE_DEFER' if the probe procedure of the specific platform IOMMU driver is not finished yet. It can also return other error code for various reasons.

Stop pretending that it will always suceess, quit if it fail.

---

Konrad

Reviewed-by on v1 1/1
#2 lore raw
In reply to Sui Jingfeng
Quoted 10 lines · Sui Jingfeng

Because the of_dma_configure() will returns '-EPROBE_DEFER' if the probe procedure of the specific platform IOMMU driver is not finished yet. It can also return other error code for various reasons.

Stop pretending that it will always suceess, quit if it fail.

---
 drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
Fixes 29ac8979cdf7 ("drm/msm/a6xx: use msm_gem for GMU memory objects")
Fixes 5a903a44a984 ("drm/msm/a6xx: Introduce GMU wrapper support")
Quoted 30 lines
drivers/gpu/drm/msm/adreno/a6xx_gmu.c +6 -2
index 37927bdd6fbe..b26dfe0a76c5 100644
@@ -1605,7 +1605,9 @@ int a6xx_gmu_wrapper_init(struct a6xx_gpu *a6xx_gpu, struct device_node *node)
 
 	gmu->dev = &pdev->dev;
 
-	of_dma_configure(gmu->dev, node, true);
+	ret = of_dma_configure(gmu->dev, node, true);
+	if (ret)
+		return ret;
 
 	pm_runtime_enable(gmu->dev);
 
@@ -1670,7 +1672,9 @@ int a6xx_gmu_init(struct a6xx_gpu *a6xx_gpu, struct device_node *node)
 
 	gmu->dev = &pdev->dev;
 
-	of_dma_configure(gmu->dev, node, true);
+	ret = of_dma_configure(gmu->dev, node, true);
+	if (ret)
+		return ret;
 
 	/* Fow now, don't do anything fancy until we get our feet under us */
 	gmu->idle_level = GMU_IDLE_STATE_ACTIVE;
Signature · 1 line
2.34.1
Signature · 2 lines
With best wishes
Dmitry
#4 lore raw

Hi,

Quoted 11 lines · Markus Elfring
Quoted 1 line

Because the of_dma_configure() will returns '-EPROBE_DEFER' if the probe

return?

…

Quoted 1 line

Stop pretending that it will always suceess, quit if it fail.

succeed? failed?

How do you think about to add any tags (like “Fixes” and “Cc”) accordingly?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.12#n145

Thanks you for providing the grammar check, will be fixed at the next version.

Quoted 2 lines

Regards,
Markus

Signature · 2 lines
Best regards,
Sui
#5 lore raw
In reply to Sui Jingfeng
Quoted 8 lines · Sui Jingfeng

Because the of_dma_configure() will returns '-EPROBE_DEFER' if the probe procedure of the specific platform IOMMU driver is not finished yet. It can also return other error code for various reasons.

Stop pretending that it will always suceess, quit if it fail.

[...]

Applied, thanks!

[1/1] drm/msm: Check return value of of_dma_configure()

      https://gitlab.freedesktop.org/lumag/msm/-/commit/b34a7401ffae

Best regards,

Signature · 1 line
Dmitry Baryshkov <[email protected]>