Re: [ BUG: Invalid wait context ] rtc_lock at: mc146818_avoid_UIP
From: Sebastian Andrzej Siewior
Date: Thu Apr 03 2025 - 16:59:20 EST
On 2025-04-03 15:50:32 [+0200], To Thomas Gleixner wrote:
> 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.
might_sleep() is quite because system_states is SYSTEM_SUSPEND.
lockdep seems to be quiet because I don't have an outer lock while
testing via
echo mem > /sys/power/state
it is just
| WARNING: CPU: 0 PID: 1007 at kernel/time/timekeeping.c:1858 timekeeping_suspend+0x3b/0x330
| RIP: 0010:timekeeping_suspend+0x3b/0x330
| Call Trace:
| <TASK>
| syscore_suspend+0x80/0x2f0
| suspend_devices_and_enter+0x21c/0xad0
| pm_suspend+0x25c/0x6b0
| state_store+0x68/0xd0
| kernfs_fop_write_iter+0x15e/0x210
| vfs_write+0x2bb/0x560
| ksys_write+0x73/0xf0
| do_syscall_64+0x91/0x1a0
> > Thanks,
> >
> > tglx
Sebastian