Re: [bug report] Potential deadlock bug in 'drivers/thermal/ti-soc-thermal/ti-bandgap.c', between 'ti_bandgap_write_counter()' and 'ti_bandgap_talert_irq_handler()'

From: Aaro Koskinen

Date: Fri Apr 24 2026 - 10:34:25 EST


Hi,

On Fri, Apr 24, 2026 at 01:32:39PM +0800, Ginger wrote:
> Potential concurrent triggering executions:
> T0:
> ti_bandgap_talert_irq_handler [t1]
> --> spin_lock(&bgp->lock); [t2]
>
> T1:
> ti_bandgap_write_counter
> --> spin_lock(&bgp->lock); [t0]
>
> T1 does not disable hardware irqs in acquiring the spin lock. If T0
> (i.e., the hard irq context) occurs after T1 acquires the lock and
> both happen within the same CPU, then T0 will not proceed because it
> cannot hold the spin lock that has already been possessed by T1, yet
> T1 cannot proceed because the hard irq runs disables preempts.

It's a threaded interrupt.

A.