mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] soc: qcom: llcc-qcom: Handle errors from optional IRQ lookup
@ 2026-08-10  5:10 phucduc.bui
  2026-08-18  9:22 ` Konrad Dybcio
  0 siblings, 1 reply; 3+ messages in thread
From: phucduc.bui @ 2026-08-10  5:10 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio; +Cc: linux-arm-msm, linux-kernel, bui duc phuc

From: bui duc phuc <phucduc.bui@gmail.com>

platform_get_irq_optional() can return errors such as -EPROBE_DEFER,
but the driver currently stores the return value directly in
drv_data->ecc_irq and continues probing.

Propagate negative errors other than -ENXIO using dev_err_probe(), and
only assign the IRQ to drv_data->ecc_irq when a valid IRQ number is
returned.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
 drivers/soc/qcom/llcc-qcom.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/soc/qcom/llcc-qcom.c b/drivers/soc/qcom/llcc-qcom.c
index 8948b5fd42d2..e42946810b50 100644
--- a/drivers/soc/qcom/llcc-qcom.c
+++ b/drivers/soc/qcom/llcc-qcom.c
@@ -5587,7 +5587,12 @@ static int qcom_llcc_probe(struct platform_device *pdev)
 			goto err;
 	}
 
-	drv_data->ecc_irq = platform_get_irq_optional(pdev, 0);
+	ret = platform_get_irq_optional(pdev, 0);
+	if (ret < 0 && ret != -ENXIO)
+		return dev_err_probe(&pdev->dev, ret, "failed to get IRQ resource\n");
+	if (ret > 0)
+		drv_data->ecc_irq = ret;
+
 	drv_data->edac_reg_offset = cfg->edac_reg_offset;
 	drv_data->ecc_irq_configured = cfg->irq_configured;
 	drv_data->dev = dev;
-- 
2.43.0


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

* Re: [PATCH] soc: qcom: llcc-qcom: Handle errors from optional IRQ lookup
  2026-08-10  5:10 [PATCH] soc: qcom: llcc-qcom: Handle errors from optional IRQ lookup phucduc.bui
@ 2026-08-18  9:22 ` Konrad Dybcio
  2026-08-18 10:34   ` Bui Duc Phuc
  0 siblings, 1 reply; 3+ messages in thread
From: Konrad Dybcio @ 2026-08-18  9:22 UTC (permalink / raw)
  To: phucduc.bui, Bjorn Andersson, Konrad Dybcio; +Cc: linux-arm-msm, linux-kernel

On 8/10/26 7:10 AM, phucduc.bui@gmail.com wrote:
> From: bui duc phuc <phucduc.bui@gmail.com>
> 
> platform_get_irq_optional() can return errors such as -EPROBE_DEFER,
> but the driver currently stores the return value directly in
> drv_data->ecc_irq and continues probing.
> 
> Propagate negative errors other than -ENXIO using dev_err_probe(), and
> only assign the IRQ to drv_data->ecc_irq when a valid IRQ number is
> returned.
> 
> Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
> ---
>  drivers/soc/qcom/llcc-qcom.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/soc/qcom/llcc-qcom.c b/drivers/soc/qcom/llcc-qcom.c
> index 8948b5fd42d2..e42946810b50 100644
> --- a/drivers/soc/qcom/llcc-qcom.c
> +++ b/drivers/soc/qcom/llcc-qcom.c
> @@ -5587,7 +5587,12 @@ static int qcom_llcc_probe(struct platform_device *pdev)
>  			goto err;
>  	}
>  
> -	drv_data->ecc_irq = platform_get_irq_optional(pdev, 0);
> +	ret = platform_get_irq_optional(pdev, 0);
> +	if (ret < 0 && ret != -ENXIO)
> +		return dev_err_probe(&pdev->dev, ret, "failed to get IRQ resource\n");
> +	if (ret > 0)
> +		drv_data->ecc_irq = ret;

Techinically you can drop the second if-statement

Konrad

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

* Re: [PATCH] soc: qcom: llcc-qcom: Handle errors from optional IRQ lookup
  2026-08-18  9:22 ` Konrad Dybcio
@ 2026-08-18 10:34   ` Bui Duc Phuc
  0 siblings, 0 replies; 3+ messages in thread
From: Bui Duc Phuc @ 2026-08-18 10:34 UTC (permalink / raw)
  To: Konrad Dybcio; +Cc: Bjorn Andersson, Konrad Dybcio, linux-arm-msm, linux-kernel

Hi Konrad,

Thank you for your review.

> >
> > -     drv_data->ecc_irq = platform_get_irq_optional(pdev, 0);
> > +     ret = platform_get_irq_optional(pdev, 0);
> > +     if (ret < 0 && ret != -ENXIO)
> > +             return dev_err_probe(&pdev->dev, ret, "failed to get IRQ resource\n");
> > +     if (ret > 0)
> > +             drv_data->ecc_irq = ret;
>
> Techinically you can drop the second if-statement
>

You are right. I checked the handling of ecc_irq here:

https://elixir.bootlin.com/linux/v7.2-rc7/source/drivers/edac/qcom_edac.c#L369

It already checks for > 0 before calling devm_request_irq().
So the second if statement can be removed entirely.
I will send v2 shortly.

Best regards,
Phuc

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

end of thread, other threads:[~2026-08-18 10:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-10  5:10 [PATCH] soc: qcom: llcc-qcom: Handle errors from optional IRQ lookup phucduc.bui
2026-08-18  9:22 ` Konrad Dybcio
2026-08-18 10:34   ` Bui Duc Phuc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®