The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Corey Minyard <corey@minyard.net>
To: phucduc.bui@gmail.com
Cc: Rosen Penev <rosenp@gmail.com>,
	openipmi-developer@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ipmi: si: Handle errors from optional IRQ lookup
Date: Mon, 17 Aug 2026 06:30:58 -0500	[thread overview]
Message-ID: <aoLw8pRGvwOQAsnB@mail.minyard.net> (raw)
In-Reply-To: <20260817105150.63310-1-phucduc.bui@gmail.com>

On Mon, Aug 17, 2026 at 05:51:50PM +0700, phucduc.bui@gmail.com wrote:
> From: bui duc phuc <phucduc.bui@gmail.com>
> 
> platform_get_irq_optional() returns a positive IRQ number on success or
> a negative error code on failure. For an optional IRQ, -ENXIO indicates
> that no optional IRQ is available. Other errors, such as -EPROBE_DEFER
> and -EINVAL, should be propagated so that the caller can handle them
> appropriately.
> 
> Propagate negative errors other than -ENXIO.

The driver works without interrupts, and there may be cases where
-EINVAL or -EPROBE_DEFER gets returned due to invalid configuration.
This will break those systems.

So no.

-corey

> 
> Fixes: 39851b7e580a ("ipmi: si: Use platform_get_irq_optional() to retrieve interrupt")
> Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
> ---
>  drivers/char/ipmi/ipmi_si_platform.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/char/ipmi/ipmi_si_platform.c b/drivers/char/ipmi/ipmi_si_platform.c
> index bdc481ce1302..04b3e205470f 100644
> --- a/drivers/char/ipmi/ipmi_si_platform.c
> +++ b/drivers/char/ipmi/ipmi_si_platform.c
> @@ -198,6 +198,8 @@ static int platform_ipmi_probe(struct platform_device *pdev)
>  		io.slave_addr = slave_addr;
>  
>  	io.irq = platform_get_irq_optional(pdev, 0);
> +	if (io.irq < 0 && io.irq != -ENXIO)
> +		return io.irq;
>  	if (io.irq > 0)
>  		io.irq_setup = ipmi_std_irq_setup;
>  	else
> -- 
> 2.43.0
> 

      reply	other threads:[~2026-08-17 11:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-17 10:51 [PATCH] ipmi: si: Handle errors from optional IRQ lookup phucduc.bui
2026-08-17 11:30 ` Corey Minyard [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aoLw8pRGvwOQAsnB@mail.minyard.net \
    --to=corey@minyard.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=openipmi-developer@lists.sourceforge.net \
    --cc=phucduc.bui@gmail.com \
    --cc=rosenp@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox