Re: [PATCH] timekeeping: Move debug sleep time accounting outside spinlock

From: Thomas Gleixner

Date: Tue Sep 09 2025 - 07:49:25 EST


On Tue, Sep 09 2025 at 18:23, Haofeng Li wrote:
> From: Haofeng Li <lihaofeng@xxxxxxxxxx>
>
> The function tk_debug_account_sleep_time() was called inside a spinlock
> in __timekeeping_inject_sleeptime(), which could lead to potential
> deadlocks, particularly when CONFIG_DEBUG_PM_SLEEP is enabled.

How so exactly?

I don't see how that would deadlock, but I might miss something. So
please explain it properly instead of handwaving about it.

Thanks,

tglx