linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] soc: fsl: cpm1: qmc: Fix qmc_probe() warn missing error code ret
       [not found] <bac2dc94-1bf3-4dcf-b776-cd78ef992d28@suswa.mountain>
@ 2024-11-20  9:38 ` Pei Xiao
  2024-11-20 11:05   ` Herve Codina
  2024-11-20 11:05   ` Christophe Leroy
  0 siblings, 2 replies; 4+ messages in thread
From: Pei Xiao @ 2024-11-20  9:38 UTC (permalink / raw)
  To: herve.codina, qiang.zhao, christophe.leroy, linuxppc-dev,
	linux-kernel
  Cc: dan.carpenter, xiaopeitux, Pei Xiao

platform_get_irq() may failed,but ret still equals to 0,
will cacuse qmc_probe() return 0 but fail.

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/202411051350.KNy6ZIWA-lkp@intel.com/
Fixes: 3178d58e0b97 ("soc: fsl: cpm1: Add support for QMC")
Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn>
---
 drivers/soc/fsl/qe/qmc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/soc/fsl/qe/qmc.c b/drivers/soc/fsl/qe/qmc.c
index 19cc581b06d0..a78768cd6007 100644
--- a/drivers/soc/fsl/qe/qmc.c
+++ b/drivers/soc/fsl/qe/qmc.c
@@ -2004,8 +2004,10 @@ static int qmc_probe(struct platform_device *pdev)
 
 	/* Set the irq handler */
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0)
+	if (irq < 0) {
+		ret = -EINVAL;
 		goto err_exit_xcc;
+	}
 	ret = devm_request_irq(qmc->dev, irq, qmc_irq_handler, 0, "qmc", qmc);
 	if (ret < 0)
 		goto err_exit_xcc;
-- 
2.34.1



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

* Re: [PATCH] soc: fsl: cpm1: qmc: Fix qmc_probe() warn missing error code ret
  2024-11-20  9:38 ` [PATCH] soc: fsl: cpm1: qmc: Fix qmc_probe() warn missing error code ret Pei Xiao
@ 2024-11-20 11:05   ` Herve Codina
  2024-11-21  0:57     ` Pei Xiao
  2024-11-20 11:05   ` Christophe Leroy
  1 sibling, 1 reply; 4+ messages in thread
From: Herve Codina @ 2024-11-20 11:05 UTC (permalink / raw)
  To: Pei Xiao
  Cc: qiang.zhao, christophe.leroy, linuxppc-dev, linux-kernel,
	dan.carpenter, xiaopeitux

Hi Pei,

On Wed, 20 Nov 2024 17:38:20 +0800
Pei Xiao <xiaopei01@kylinos.cn> wrote:

> platform_get_irq() may failed,but ret still equals to 0,
> will cacuse qmc_probe() return 0 but fail.
> 
> Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> Closes: https://lore.kernel.org/r/202411051350.KNy6ZIWA-lkp@intel.com/
> Fixes: 3178d58e0b97 ("soc: fsl: cpm1: Add support for QMC")
> Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn>
> ---
>  drivers/soc/fsl/qe/qmc.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/soc/fsl/qe/qmc.c b/drivers/soc/fsl/qe/qmc.c
> index 19cc581b06d0..a78768cd6007 100644
> --- a/drivers/soc/fsl/qe/qmc.c
> +++ b/drivers/soc/fsl/qe/qmc.c
> @@ -2004,8 +2004,10 @@ static int qmc_probe(struct platform_device *pdev)
>  
>  	/* Set the irq handler */
>  	irq = platform_get_irq(pdev, 0);
> -	if (irq < 0)
> +	if (irq < 0) {
> +		ret = -EINVAL;
>  		goto err_exit_xcc;
> +	}
>  	ret = devm_request_irq(qmc->dev, irq, qmc_irq_handler, 0, "qmc", qmc);
>  	if (ret < 0)
>  		goto err_exit_xcc;

I already send a fix:
https://lore.kernel.org/all/20241105145623.401528-1-herve.codina@bootlin.com/

And it is available in the following PR done by Christophe:
https://lore.kernel.org/all/c3c4961b-fe2a-4fcc-a7a1-f8b5352e09a2@csgroup.eu/

Best regards,
Hervé


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

* Re: [PATCH] soc: fsl: cpm1: qmc: Fix qmc_probe() warn missing error code ret
  2024-11-20  9:38 ` [PATCH] soc: fsl: cpm1: qmc: Fix qmc_probe() warn missing error code ret Pei Xiao
  2024-11-20 11:05   ` Herve Codina
@ 2024-11-20 11:05   ` Christophe Leroy
  1 sibling, 0 replies; 4+ messages in thread
From: Christophe Leroy @ 2024-11-20 11:05 UTC (permalink / raw)
  To: Pei Xiao, herve.codina, qiang.zhao, linuxppc-dev, linux-kernel
  Cc: dan.carpenter, xiaopeitux



Le 20/11/2024 à 10:38, Pei Xiao a écrit :
> [Vous ne recevez pas souvent de courriers de xiaopei01@kylinos.cn. Découvrez pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ]
> 
> platform_get_irq() may failed,but ret still equals to 0,
> will cacuse qmc_probe() return 0 but fail.
> 
> Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> Closes: https://lore.kernel.org/r/202411051350.KNy6ZIWA-lkp@intel.com/
> Fixes: 3178d58e0b97 ("soc: fsl: cpm1: Add support for QMC")
> Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn>
> ---
>   drivers/soc/fsl/qe/qmc.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/soc/fsl/qe/qmc.c b/drivers/soc/fsl/qe/qmc.c
> index 19cc581b06d0..a78768cd6007 100644
> --- a/drivers/soc/fsl/qe/qmc.c
> +++ b/drivers/soc/fsl/qe/qmc.c
> @@ -2004,8 +2004,10 @@ static int qmc_probe(struct platform_device *pdev)
> 
>          /* Set the irq handler */
>          irq = platform_get_irq(pdev, 0);
> -       if (irq < 0)
> +       if (irq < 0) {
> +               ret = -EINVAL;

Why force -EINVAL ?

What if platform_get_irq() returns -EPROBE_DEFER ?

Anyway, this problem is already fixed by 
https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20241105145623.401528-1-herve.codina@bootlin.com/ 
which is on its way to mainline.

>                  goto err_exit_xcc;
> +       }
>          ret = devm_request_irq(qmc->dev, irq, qmc_irq_handler, 0, "qmc", qmc);
>          if (ret < 0)
>                  goto err_exit_xcc;
> --
> 2.34.1
> 


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

* Re: [PATCH] soc: fsl: cpm1: qmc: Fix qmc_probe() warn missing error code ret
  2024-11-20 11:05   ` Herve Codina
@ 2024-11-21  0:57     ` Pei Xiao
  0 siblings, 0 replies; 4+ messages in thread
From: Pei Xiao @ 2024-11-21  0:57 UTC (permalink / raw)
  To: Herve Codina
  Cc: qiang.zhao, christophe.leroy, linuxppc-dev, linux-kernel,
	dan.carpenter, xiaopeitux



在 2024/11/20 19:05, Herve Codina 写道:
> Hi Pei,
> 
> On Wed, 20 Nov 2024 17:38:20 +0800
> Pei Xiao <xiaopei01@kylinos.cn> wrote:
> 
>> platform_get_irq() may failed,but ret still equals to 0,
>> will cacuse qmc_probe() return 0 but fail.
>>
>> Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
>> Closes: https://lore.kernel.org/r/202411051350.KNy6ZIWA-lkp@intel.com/
>> Fixes: 3178d58e0b97 ("soc: fsl: cpm1: Add support for QMC")
>> Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn>
>> ---
>>   drivers/soc/fsl/qe/qmc.c | 4 +++-
>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/soc/fsl/qe/qmc.c b/drivers/soc/fsl/qe/qmc.c
>> index 19cc581b06d0..a78768cd6007 100644
>> --- a/drivers/soc/fsl/qe/qmc.c
>> +++ b/drivers/soc/fsl/qe/qmc.c
>> @@ -2004,8 +2004,10 @@ static int qmc_probe(struct platform_device *pdev)
>>   
>>   	/* Set the irq handler */
>>   	irq = platform_get_irq(pdev, 0);
>> -	if (irq < 0)
>> +	if (irq < 0) {
>> +		ret = -EINVAL;
>>   		goto err_exit_xcc;
>> +	}
>>   	ret = devm_request_irq(qmc->dev, irq, qmc_irq_handler, 0, "qmc", qmc);
>>   	if (ret < 0)
>>   		goto err_exit_xcc;
> 
> I already send a fix:
> https://lore.kernel.org/all/20241105145623.401528-1-herve.codina@bootlin.com/
> 

ok, I'm so sorry for send repeated patch.

Tnanks!
Pei.
> And it is available in the following PR done by Christophe:
> https://lore.kernel.org/all/c3c4961b-fe2a-4fcc-a7a1-f8b5352e09a2@csgroup.eu/
> 
> Best regards,
> Hervé


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

end of thread, other threads:[~2024-11-21  1:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <bac2dc94-1bf3-4dcf-b776-cd78ef992d28@suswa.mountain>
2024-11-20  9:38 ` [PATCH] soc: fsl: cpm1: qmc: Fix qmc_probe() warn missing error code ret Pei Xiao
2024-11-20 11:05   ` Herve Codina
2024-11-21  0:57     ` Pei Xiao
2024-11-20 11:05   ` Christophe Leroy

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).