Re: [PATCH 1/2] thermal/drivers/rcar_gen3: Handle -ENXIO from optional IRQ lookup
Niklas Söderlund <[email protected]>
| Newsgroups | org.kernel.vger.linux-pm,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-renesas-soc |
|---|---|
| Message-ID | <[email protected]> |
On 2026-08-07 17:11:44 +0700, Bui Duc Phuc wrote: > Hi Geert, > > Thank you for your feedback. > > > > irq = platform_get_irq_optional(pdev, i); > > > - if (irq < 0) > > > + if (irq < 0 && irq != -ENXIO) > > > return irq; > > > > > > > So the code may continue using -ENXIO as an interrupt number (and fail)? > > > > Yes, you are right. We should probably handle it similarly to: > https://elixir.bootlin.com/linux/v7.2-rc6/source/drivers/thermal/renesas/rcar_thermal.c#L422 > and only assign the IRQ when the return value is positive: > if (ret > 0) > irq = ret; > > > Why is this change needed at all? > > The caller of rcar_gen3_thermal_request_irqs() knows how to handle > > failures, as IRQs are optional. > > > > Regarding the caller, I only found rcar_gen3_thermal_request_irqs() > being called here: > https://elixir.bootlin.com/linux/v7.2-rc6/source/drivers/thermal/renesas/rcar_gen3_thermal.c#L530 > It does not appear to handle the error return there, so I don't think > the caller currently handles these failures explicitly. Yes it does. If it can't get the optional interrupts the driver does not support setting trip-points in hardware. No? > > Best regards, > Phuc -- Kind Regards, Niklas Söderlund