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

Sui Jingfeng posted 1 patch 1 year, 3 months ago
drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
[PATCH] drm/msm: Check return value of of_dma_configure()
Posted by Sui Jingfeng 1 year, 3 months ago
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.

Signed-off-by: Sui Jingfeng <sui.jingfeng@linux.dev>
---
 drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
index 37927bdd6fbe..b26dfe0a76c5 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
@@ -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;
-- 
2.34.1
Re: [PATCH] drm/msm: Check return value of of_dma_configure()
Posted by Dmitry Baryshkov 1 year, 1 month ago
On Mon, 04 Nov 2024 17:07:38 +0800, Sui Jingfeng wrote:
> 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,
-- 
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Re: [PATCH] drm/msm: Check return value of of_dma_configure()
Posted by Markus Elfring 1 year, 2 months ago
> Because the of_dma_configure() will returns '-EPROBE_DEFER' if the probe

                                      return?


…
> 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

Regards,
Markus
Re: [PATCH] drm/msm: Check return value of of_dma_configure()
Posted by Sui Jingfeng 1 year, 2 months ago
Hi,


On 2024/11/30 22:51, Markus Elfring wrote:
>> Because the of_dma_configure() will returns '-EPROBE_DEFER' if the probe
>                                        return?
>
>
> …
>> 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.

> Regards,
> Markus

-- 
Best regards,
Sui

Re: [PATCH] drm/msm: Check return value of of_dma_configure()
Posted by Dmitry Baryshkov 1 year, 2 months ago
On Mon, Nov 04, 2024 at 05:07:38PM +0800, Sui Jingfeng wrote:
> 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.
> 
> Signed-off-by: Sui Jingfeng <sui.jingfeng@linux.dev>
> ---
>  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")

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>


> 
> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
> index 37927bdd6fbe..b26dfe0a76c5 100644
> --- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
> +++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
> @@ -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;
> -- 
> 2.34.1
> 

-- 
With best wishes
Dmitry
Re: [PATCH] drm/msm: Check return value of of_dma_configure()
Posted by Konrad Dybcio 1 year, 3 months ago
On 4.11.2024 10:07 AM, Sui Jingfeng wrote:
> 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.
> 
> Signed-off-by: Sui Jingfeng <sui.jingfeng@linux.dev>
> ---

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

Konrad