Re: [PATCH v2] thermal: rcar_gen3: release the IRQ handlers before the zones are freed

From: Niklas Söderlund

Date: Tue Nov 24 2026 - 01:40:52 EST


Hi Yaohan,

On 2026-11-24 10:22:31 +0800, Yaohan Li wrote:
> Hi Niklas,
>
> Yes, I agree. I have reworked the probe to look up the IRQs first,
> initialize the sensors with IRQEN cleared, and request the handlers after
> all the thermal zones have been registered. A devres action disables the
> interrupt sources before the handlers are freed, so ->remove() is no
> longer needed.
>
> Since the thermal core copies the zone operations during registration,
> set_trips() still has to be selected beforehand.
>
> The current version retains the no-IRQ fallback for -ENXIO and propagates
> -EPROBE_DEFER and other lookup errors. However, if IRQ lookup succeeds
> but requesting a handler fails, probe now fails instead of falling back
> to polling.

It needs to revert back to polling. IIRC the interrupts are used to get
quick notification of a trip point but if interrupts are not
enabled/supported it can still find it using the polling method.

>
> Would you be happy with that change, or would you prefer to retain the
> original fallback on IRQ request failure as well?

A bug fix should not alter behavior, other then fixing the bug ;-)

>
> The reworked patch builds on arm64, but I have not tested it on hardware.
>
> Thanks,
> Yaohan

--
Kind Regards,
Niklas Söderlund