* [PATCH 1/4] ipmi: bt-bmc: Propagate errors from IRQ configuration
@ 2026-08-17 10:50 phucduc.bui
2026-08-17 10:50 ` [PATCH 2/4] ipmi: bt-bmc: Handle -ENXIO from optional IRQ lookup phucduc.bui
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: phucduc.bui @ 2026-08-17 10:50 UTC (permalink / raw)
To: Corey Minyard, openipmi-developer, linux-kernel; +Cc: bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
Check and propagate the return value of bt_bmc_config_irq() instead of
ignoring errors during probe.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
drivers/char/ipmi/bt-bmc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/char/ipmi/bt-bmc.c b/drivers/char/ipmi/bt-bmc.c
index a179d4797011..7d3944bda8db 100644
--- a/drivers/char/ipmi/bt-bmc.c
+++ b/drivers/char/ipmi/bt-bmc.c
@@ -436,7 +436,9 @@ static int bt_bmc_probe(struct platform_device *pdev)
return rc;
}
- bt_bmc_config_irq(bt_bmc, pdev);
+ rc = bt_bmc_config_irq(bt_bmc, pdev);
+ if (rc)
+ return rc;
if (bt_bmc->irq >= 0) {
dev_info(dev, "Using IRQ %d\n", bt_bmc->irq);
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/4] ipmi: bt-bmc: Handle -ENXIO from optional IRQ lookup
2026-08-17 10:50 [PATCH 1/4] ipmi: bt-bmc: Propagate errors from IRQ configuration phucduc.bui
@ 2026-08-17 10:50 ` phucduc.bui
2026-08-17 11:40 ` Corey Minyard
2026-08-17 10:50 ` [PATCH 3/4] ipmi: bt-bmc: Request IRQ only when available phucduc.bui
` (2 subsequent siblings)
3 siblings, 1 reply; 6+ messages in thread
From: phucduc.bui @ 2026-08-17 10:50 UTC (permalink / raw)
To: Corey Minyard, openipmi-developer, linux-kernel; +Cc: bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
platform_get_irq_optional() can return -ENXIO when no IRQ resource is
available, as well as other negative error codes.
The probe path supports running without an IRQ by falling back to
the timer. Treat -ENXIO as the no-IRQ case while propagating other
errors to the caller.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
drivers/char/ipmi/bt-bmc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/char/ipmi/bt-bmc.c b/drivers/char/ipmi/bt-bmc.c
index 7d3944bda8db..4c5457c88503 100644
--- a/drivers/char/ipmi/bt-bmc.c
+++ b/drivers/char/ipmi/bt-bmc.c
@@ -380,7 +380,7 @@ static int bt_bmc_config_irq(struct bt_bmc *bt_bmc,
u32 reg;
bt_bmc->irq = platform_get_irq_optional(pdev, 0);
- if (bt_bmc->irq < 0)
+ if (bt_bmc->irq < 0 && bt_bmc->irq != -ENXIO)
return bt_bmc->irq;
rc = devm_request_irq(dev, bt_bmc->irq, bt_bmc_irq, IRQF_SHARED,
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/4] ipmi: bt-bmc: Request IRQ only when available
2026-08-17 10:50 [PATCH 1/4] ipmi: bt-bmc: Propagate errors from IRQ configuration phucduc.bui
2026-08-17 10:50 ` [PATCH 2/4] ipmi: bt-bmc: Handle -ENXIO from optional IRQ lookup phucduc.bui
@ 2026-08-17 10:50 ` phucduc.bui
2026-08-17 10:50 ` [PATCH 4/4] ipmi: bt-bmc: Check IRQ number correctly phucduc.bui
2026-08-17 11:37 ` [PATCH 1/4] ipmi: bt-bmc: Propagate errors from IRQ configuration Corey Minyard
3 siblings, 0 replies; 6+ messages in thread
From: phucduc.bui @ 2026-08-17 10:50 UTC (permalink / raw)
To: Corey Minyard, openipmi-developer, linux-kernel; +Cc: bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
Only call devm_request_irq() when a valid positive IRQ number is
available.
Remove the redundant warning since devm_request_irq() already reports
the error. There is also no need to store the error in bt_bmc->irq,
as errors other than -ENXIO are returned to the caller instead of
being handled as the no-IRQ case.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
drivers/char/ipmi/bt-bmc.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/char/ipmi/bt-bmc.c b/drivers/char/ipmi/bt-bmc.c
index 4c5457c88503..99b38300f9e1 100644
--- a/drivers/char/ipmi/bt-bmc.c
+++ b/drivers/char/ipmi/bt-bmc.c
@@ -383,12 +383,11 @@ static int bt_bmc_config_irq(struct bt_bmc *bt_bmc,
if (bt_bmc->irq < 0 && bt_bmc->irq != -ENXIO)
return bt_bmc->irq;
- rc = devm_request_irq(dev, bt_bmc->irq, bt_bmc_irq, IRQF_SHARED,
- DEVICE_NAME, bt_bmc);
- if (rc < 0) {
- dev_warn(dev, "Unable to request IRQ %d\n", bt_bmc->irq);
- bt_bmc->irq = rc;
- return rc;
+ if (bt_bmc->irq > 0) {
+ rc = devm_request_irq(dev, bt_bmc->irq, bt_bmc_irq,
+ IRQF_SHARED, DEVICE_NAME, bt_bmc);
+ if (rc < 0)
+ return rc;
}
/*
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/4] ipmi: bt-bmc: Check IRQ number correctly
2026-08-17 10:50 [PATCH 1/4] ipmi: bt-bmc: Propagate errors from IRQ configuration phucduc.bui
2026-08-17 10:50 ` [PATCH 2/4] ipmi: bt-bmc: Handle -ENXIO from optional IRQ lookup phucduc.bui
2026-08-17 10:50 ` [PATCH 3/4] ipmi: bt-bmc: Request IRQ only when available phucduc.bui
@ 2026-08-17 10:50 ` phucduc.bui
2026-08-17 11:37 ` [PATCH 1/4] ipmi: bt-bmc: Propagate errors from IRQ configuration Corey Minyard
3 siblings, 0 replies; 6+ messages in thread
From: phucduc.bui @ 2026-08-17 10:50 UTC (permalink / raw)
To: Corey Minyard, openipmi-developer, linux-kernel; +Cc: bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
bt_bmc->irq does not have a value of zero, so check for a positive
IRQ number when selecting between IRQ and timer-based handling.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
drivers/char/ipmi/bt-bmc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/char/ipmi/bt-bmc.c b/drivers/char/ipmi/bt-bmc.c
index 99b38300f9e1..68bf34715387 100644
--- a/drivers/char/ipmi/bt-bmc.c
+++ b/drivers/char/ipmi/bt-bmc.c
@@ -439,7 +439,7 @@ static int bt_bmc_probe(struct platform_device *pdev)
if (rc)
return rc;
- if (bt_bmc->irq >= 0) {
+ if (bt_bmc->irq > 0) {
dev_info(dev, "Using IRQ %d\n", bt_bmc->irq);
} else {
dev_info(dev, "No IRQ; using timer\n");
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/4] ipmi: bt-bmc: Propagate errors from IRQ configuration
2026-08-17 10:50 [PATCH 1/4] ipmi: bt-bmc: Propagate errors from IRQ configuration phucduc.bui
` (2 preceding siblings ...)
2026-08-17 10:50 ` [PATCH 4/4] ipmi: bt-bmc: Check IRQ number correctly phucduc.bui
@ 2026-08-17 11:37 ` Corey Minyard
3 siblings, 0 replies; 6+ messages in thread
From: Corey Minyard @ 2026-08-17 11:37 UTC (permalink / raw)
To: phucduc.bui; +Cc: openipmi-developer, linux-kernel
On Mon, Aug 17, 2026 at 05:50:38PM +0700, phucduc.bui@gmail.com wrote:
> From: bui duc phuc <phucduc.bui@gmail.com>
>
> Check and propagate the return value of bt_bmc_config_irq() instead of
> ignoring errors during probe.
>
> Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
> ---
> drivers/char/ipmi/bt-bmc.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/char/ipmi/bt-bmc.c b/drivers/char/ipmi/bt-bmc.c
> index a179d4797011..7d3944bda8db 100644
> --- a/drivers/char/ipmi/bt-bmc.c
> +++ b/drivers/char/ipmi/bt-bmc.c
> @@ -436,7 +436,9 @@ static int bt_bmc_probe(struct platform_device *pdev)
> return rc;
> }
>
> - bt_bmc_config_irq(bt_bmc, pdev);
> + rc = bt_bmc_config_irq(bt_bmc, pdev);
> + if (rc)
> + return rc;
No, this will break the driver if the interrupt is not available. That
function is badly written (it should return the irq and the irq should
be set here) but if it encounters an error, it should use the timer.
-corey
>
> if (bt_bmc->irq >= 0) {
> dev_info(dev, "Using IRQ %d\n", bt_bmc->irq);
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/4] ipmi: bt-bmc: Handle -ENXIO from optional IRQ lookup
2026-08-17 10:50 ` [PATCH 2/4] ipmi: bt-bmc: Handle -ENXIO from optional IRQ lookup phucduc.bui
@ 2026-08-17 11:40 ` Corey Minyard
0 siblings, 0 replies; 6+ messages in thread
From: Corey Minyard @ 2026-08-17 11:40 UTC (permalink / raw)
To: phucduc.bui; +Cc: openipmi-developer, linux-kernel
On Mon, Aug 17, 2026 at 05:50:39PM +0700, phucduc.bui@gmail.com wrote:
> From: bui duc phuc <phucduc.bui@gmail.com>
>
> platform_get_irq_optional() can return -ENXIO when no IRQ resource is
> available, as well as other negative error codes.
>
> The probe path supports running without an IRQ by falling back to
> the timer. Treat -ENXIO as the no-IRQ case while propagating other
> errors to the caller.
This is obviously wrong, it will pass -ENXIO into devm_request_irq()
if returned.
-corey
>
> Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
> ---
> drivers/char/ipmi/bt-bmc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/char/ipmi/bt-bmc.c b/drivers/char/ipmi/bt-bmc.c
> index 7d3944bda8db..4c5457c88503 100644
> --- a/drivers/char/ipmi/bt-bmc.c
> +++ b/drivers/char/ipmi/bt-bmc.c
> @@ -380,7 +380,7 @@ static int bt_bmc_config_irq(struct bt_bmc *bt_bmc,
> u32 reg;
>
> bt_bmc->irq = platform_get_irq_optional(pdev, 0);
> - if (bt_bmc->irq < 0)
> + if (bt_bmc->irq < 0 && bt_bmc->irq != -ENXIO)
> return bt_bmc->irq;
>
> rc = devm_request_irq(dev, bt_bmc->irq, bt_bmc_irq, IRQF_SHARED,
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-08-17 11:40 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-17 10:50 [PATCH 1/4] ipmi: bt-bmc: Propagate errors from IRQ configuration phucduc.bui
2026-08-17 10:50 ` [PATCH 2/4] ipmi: bt-bmc: Handle -ENXIO from optional IRQ lookup phucduc.bui
2026-08-17 11:40 ` Corey Minyard
2026-08-17 10:50 ` [PATCH 3/4] ipmi: bt-bmc: Request IRQ only when available phucduc.bui
2026-08-17 10:50 ` [PATCH 4/4] ipmi: bt-bmc: Check IRQ number correctly phucduc.bui
2026-08-17 11:37 ` [PATCH 1/4] ipmi: bt-bmc: Propagate errors from IRQ configuration Corey Minyard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox