linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/msm/hdm: Fix the error handling path of msm_hdmi_dev_probe()
@ 2022-12-11  6:50 Christophe JAILLET
  2022-12-13  1:34 ` Abhinav Kumar
  0 siblings, 1 reply; 3+ messages in thread
From: Christophe JAILLET @ 2022-12-11  6:50 UTC (permalink / raw)
  To: Rob Clark, Abhinav Kumar, Dmitry Baryshkov, Sean Paul,
	David Airlie, Daniel Vetter
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-arm-msm,
	dri-devel, freedreno

If an error occurs after a successful msm_hdmi_get_phy() call, it must be
undone by a corresponding msm_hdmi_put_phy(), as already done in the
remove function.

Fixes: 437365464043 ("drm/msm/hdmi: move msm_hdmi_get_phy() to msm_hdmi_dev_probe()")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Not sure if the Fixes tag is correct. At least it is when the probe needs
to be fixed but the issue was maybe there elsewhere before.
---
 drivers/gpu/drm/msm/hdmi/hdmi.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
index 4d3fdc806bef..97372bb241d8 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi.c
+++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
@@ -532,11 +532,19 @@ static int msm_hdmi_dev_probe(struct platform_device *pdev)
 
 	ret = devm_pm_runtime_enable(&pdev->dev);
 	if (ret)
-		return ret;
+		goto err_put_phy;
 
 	platform_set_drvdata(pdev, hdmi);
 
-	return component_add(&pdev->dev, &msm_hdmi_ops);
+	ret = component_add(&pdev->dev, &msm_hdmi_ops);
+	if (ret)
+		goto err_put_phy;
+
+	return 0;
+
+err_put_phy:
+	msm_hdmi_put_phy(hdmi);
+	return ret;
 }
 
 static int msm_hdmi_dev_remove(struct platform_device *pdev)
-- 
2.34.1


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

* Re: [PATCH] drm/msm/hdm: Fix the error handling path of msm_hdmi_dev_probe()
  2022-12-11  6:50 [PATCH] drm/msm/hdm: Fix the error handling path of msm_hdmi_dev_probe() Christophe JAILLET
@ 2022-12-13  1:34 ` Abhinav Kumar
  2022-12-13  1:35   ` [Freedreno] " Abhinav Kumar
  0 siblings, 1 reply; 3+ messages in thread
From: Abhinav Kumar @ 2022-12-13  1:34 UTC (permalink / raw)
  To: Christophe JAILLET, Rob Clark, Dmitry Baryshkov, Sean Paul,
	David Airlie, Daniel Vetter
  Cc: linux-kernel, kernel-janitors, linux-arm-msm, dri-devel, freedreno



On 12/10/2022 10:50 PM, Christophe JAILLET wrote:
> If an error occurs after a successful msm_hdmi_get_phy() call, it must be
> undone by a corresponding msm_hdmi_put_phy(), as already done in the
> remove function.
> 
> Fixes: 437365464043 ("drm/msm/hdmi: move msm_hdmi_get_phy() to msm_hdmi_dev_probe()")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>

> ---
> Not sure if the Fixes tag is correct. At least it is when the probe needs
> to be fixed but the issue was maybe there elsewhere before.

Seems right to me.

> ---
>   drivers/gpu/drm/msm/hdmi/hdmi.c | 12 ++++++++++--
>   1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
> index 4d3fdc806bef..97372bb241d8 100644
> --- a/drivers/gpu/drm/msm/hdmi/hdmi.c
> +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
> @@ -532,11 +532,19 @@ static int msm_hdmi_dev_probe(struct platform_device *pdev)
>   
>   	ret = devm_pm_runtime_enable(&pdev->dev);
>   	if (ret)
> -		return ret;
> +		goto err_put_phy;
>   
>   	platform_set_drvdata(pdev, hdmi);
>   
> -	return component_add(&pdev->dev, &msm_hdmi_ops);
> +	ret = component_add(&pdev->dev, &msm_hdmi_ops);
> +	if (ret)
> +		goto err_put_phy;
> +
> +	return 0;
> +
> +err_put_phy:
> +	msm_hdmi_put_phy(hdmi);
> +	return ret;
>   }
>   
>   static int msm_hdmi_dev_remove(struct platform_device *pdev)

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

* Re: [Freedreno] [PATCH] drm/msm/hdm: Fix the error handling path of msm_hdmi_dev_probe()
  2022-12-13  1:34 ` Abhinav Kumar
@ 2022-12-13  1:35   ` Abhinav Kumar
  0 siblings, 0 replies; 3+ messages in thread
From: Abhinav Kumar @ 2022-12-13  1:35 UTC (permalink / raw)
  To: Christophe JAILLET, Rob Clark, Dmitry Baryshkov, Sean Paul,
	David Airlie, Daniel Vetter
  Cc: linux-arm-msm, freedreno, kernel-janitors, linux-kernel, dri-devel



On 12/12/2022 5:34 PM, Abhinav Kumar wrote:
> 
> 
> On 12/10/2022 10:50 PM, Christophe JAILLET wrote:
>> If an error occurs after a successful msm_hdmi_get_phy() call, it must be
>> undone by a corresponding msm_hdmi_put_phy(), as already done in the
>> remove function.
>>
>> Fixes: 437365464043 ("drm/msm/hdmi: move msm_hdmi_get_phy() to 
>> msm_hdmi_dev_probe()")
>> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> 
> Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>

Actually, i missed one nit

In the subject line, it should be "drm/msm/hdmi"

The "i" is missing.

Please fix that and post it.

> 
>> ---
>> Not sure if the Fixes tag is correct. At least it is when the probe needs
>> to be fixed but the issue was maybe there elsewhere before.
> 
> Seems right to me.
> 
>> ---
>>   drivers/gpu/drm/msm/hdmi/hdmi.c | 12 ++++++++++--
>>   1 file changed, 10 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c 
>> b/drivers/gpu/drm/msm/hdmi/hdmi.c
>> index 4d3fdc806bef..97372bb241d8 100644
>> --- a/drivers/gpu/drm/msm/hdmi/hdmi.c
>> +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
>> @@ -532,11 +532,19 @@ static int msm_hdmi_dev_probe(struct 
>> platform_device *pdev)
>>       ret = devm_pm_runtime_enable(&pdev->dev);
>>       if (ret)
>> -        return ret;
>> +        goto err_put_phy;
>>       platform_set_drvdata(pdev, hdmi);
>> -    return component_add(&pdev->dev, &msm_hdmi_ops);
>> +    ret = component_add(&pdev->dev, &msm_hdmi_ops);
>> +    if (ret)
>> +        goto err_put_phy;
>> +
>> +    return 0;
>> +
>> +err_put_phy:
>> +    msm_hdmi_put_phy(hdmi);
>> +    return ret;
>>   }
>>   static int msm_hdmi_dev_remove(struct platform_device *pdev)

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

end of thread, other threads:[~2022-12-13  1:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-11  6:50 [PATCH] drm/msm/hdm: Fix the error handling path of msm_hdmi_dev_probe() Christophe JAILLET
2022-12-13  1:34 ` Abhinav Kumar
2022-12-13  1:35   ` [Freedreno] " Abhinav Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).