i2c: designware: use polling when IRQ resource is 0
Subsystems (3)
PATCH 2/2 i2c: designware: use polling when IRQ resource is 0
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.
--- drivers/i2c/busses/i2c-designware-platdrv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-designware-platdrv.c +1 -1
@@ -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;
Signature · 1 line
2.56.0.windows.4
Andy Shevchenko
reviewerQuoted 9 lines · Samuel Tirwa
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 enabledACCESS_POLLINGandrequest_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.
...
drivers/i2c/busses/i2c-designware-platdrv.c static int dw_i2c_plat_probe(struct platform_device *pdev) · line 10
Quoted 6 lines
drivers/i2c/busses/i2c-designware-platdrv.c +1
-1irq =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*().
Signature · 2 lines
With Best Regards, Andy Shevchenko