Re: [ BUG: Invalid wait context ] rtc_lock at: mc146818_avoid_UIP
From: Sebastian Andrzej Siewior
Date: Thu Apr 03 2025 - 09:50:44 EST
On 2025-04-03 15:12:08 [+0200], Thomas Gleixner wrote:
> Converting it to a raw lock "fixes" the problem, but RT people will hunt
> you down with a big latency bat.
>
> But this is not related to the commit above and not new.
>
> timekeeping_suspend() has always invoked mach_get_cmos_time() with the
> freeze lock held and mc146818_get_time() has always locked rtc_lock.
>
> I wonder, why this splat hasn't popped before. On RT lockdep should have
> complained forever. Sebastian???
I sure haven't seen it. But it has to.
> Suspend, whether it's suspend to idle or regular suspend, are weird
> contexts as there is no concurrency possible because interrupts are
> disabled and it is guaranteed that there is only a single CPU which is
> operational. The other CPUs are either in a deep idle state or when they
> are on the way back, they serialize on tick_freeze_lock.
>
> So taking the non-raw spinlock in that context is safe, but obviously
> lockdep does not know about that.
>
> Peter, any ideas?
We can tell lockdep that. I will look into this.
> Thanks,
>
> tglx
Sebastian