diff mbox series

[2/2] i2c: designware: use polling when IRQ resource is 0

Message ID 20261103090059.1759-1-samuel.tirwa@web.de
State New
Headers show
Series [1/2] mfd: intel-lpss: fall back to polling when no usable IRQ | expand

Commit Message

Samuel Tirwa Nov. 3, 2026, 9 a.m. UTC
When an Intel LPSS I2C controller has no usable interrupt (firmware
reports PCI INTx as not connected), intel-lpss passes 0 as the IRQ base,
which leaves the child device with an IRQ resource whose start is 0.
platform_get_irq_optional() then returns 0 instead of -ENXIO, so the
DesignWare driver never enabled ACCESS_POLLING and request_irq(0, ...)
failed.

Treat an IRQ number of 0 the same as 'no IRQ resource' and enable
polling mode.

Signed-off-by: Samuel Tirwa <samuel.tirwa@web.de>
---
 drivers/i2c/busses/i2c-designware-platdrv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andy Shevchenko Nov. 3, 2026, 9:48 a.m. UTC | #1
On Tue, Nov 03, 2026 at 10:00:59AM +0100, Samuel Tirwa wrote:
> When an Intel LPSS I2C controller has no usable interrupt (firmware
> reports PCI INTx as not connected), intel-lpss passes 0 as the IRQ base,
> which leaves the child device with an IRQ resource whose start is 0.
> platform_get_irq_optional() then returns 0 instead of -ENXIO, so the
> DesignWare driver never enabled ACCESS_POLLING and request_irq(0, ...)
> failed.
> 
> Treat an IRQ number of 0 the same as 'no IRQ resource' and enable
> polling mode.

Slow down. You have made a mess in the mailing list: no email thread, no
versioning between the series of the same, no cover letter. Take your time to
become a familiar with the process first.

...

>  	irq = platform_get_irq_optional(pdev, 0);
> -	if (irq == -ENXIO)
> +	if (irq == -ENXIO || irq == 0)
>  		flags |= ACCESS_POLLING;
>  	else if (irq < 0)
>  		return irq;

NAK. irq==0 gives a warning and has not be a valid output from
platform_get_irq*().
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index ca63b74..035ec92 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -4,7 +4,7 @@  static int dw_i2c_plat_probe(struct platform_device *pdev)
 	int irq, ret;
 
 	irq = platform_get_irq_optional(pdev, 0);
-	if (irq == -ENXIO)
+	if (irq == -ENXIO || irq == 0)
 		flags |= ACCESS_POLLING;
 	else if (irq < 0)
 		return irq;