Re: [ BUG: Invalid wait context ] rtc_lock at: mc146818_avoid_UIP

From: Thomas Gleixner
Date: Fri Apr 04 2025 - 03:40:13 EST


On Fri, Apr 04 2025 at 01:46, Mateusz Jończyk wrote:
> W dniu 3.04.2025 o 15:12, Thomas Gleixner pisze:
>> 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 was able to trigger the bug on Linux 6.1.0 with
> CONFIG_PROVE_RAW_LOCK_NESTING enabled and I suspect it can be
> triggered much earlier.
>
> It is likely that only after
>
> commit 560af5dc839eef ("lockdep: Enable PROVE_RAW_LOCK_NESTING with PROVE_LOCKING.")
>
> people are seeing this simply because no one previously did
> the test with CONFIG_PROVE_RAW_LOCK_NESTING=y.

Well. On RT enabled kernels the raw lock nesting was always enabled. So
I just was curious why this didn't show up earlier. Though RT folks
might not regularly test suspend :)

Thanks,

tglx