All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Bainbridge <chris.bainbridge@gmail.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: "Thomas Gleixner" <tglx@linutronix.de>,
	"Borislav Petkov" <bp@alien8.de>,
	linux-rtc@vger.kernel.org,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"Mateusz Jończyk" <mat.jonczyk@o2.pl>,
	lkml <linux-kernel@vger.kernel.org>,
	"Anna-Maria Behnsen" <anna-maria@linutronix.de>,
	"Frederic Weisbecker" <frederic@kernel.org>,
	"Peter Zijlstra" <peterz@infradead.org>
Subject: Re: [PATCH] timekeeping: Add a lockdep override in tick_freeze().
Date: Sat, 31 May 2025 20:16:20 +0100	[thread overview]
Message-ID: <aDtVhPJD43DKNG3A@debian.local> (raw)
In-Reply-To: <aDtJ92foPUYmGheF@debian.local>

On Sat, May 31, 2025 at 07:27:03PM +0100, Chris Bainbridge wrote:
> Hi,
> 
> I'm getting "WARNING: inconsistent lock state" on resume with this
> commit (92e250c624ea37fde64bfd624fd2556f0d846f18):
> 

Further testing shows there are some required conditions for this
warning to be shown. The suspend must be of a short enough duration that
it does "not reach hardware sleep state" (according to amd_s2idle.py).

Also the warning is only shown once, I don't know if this is because the
conditions for the warning only occur once, or if there is log limit
somewhere that prevents it from being logged more than once.

I can reliably reproduce the warning by running amd_s2idle.py and
waiting for the automatic resume:

# ./amd_s2idle.py --log log --duration 5 --wait 4 --count 1
Debugging script for s2idle on AMD systems
💻 HP HP Pavilion Aero Laptop 13-be0xxx (103C_5335KV HP Pavilion) running BIOS 15.17 (F.17) released 12/18/2024 and EC 79.31
🐧 Debian GNU/Linux trixie/sid
🐧 Kernel 6.15.0-rc1-00002-g92e250c624ea
🔋 Battery BAT0 (313-27-3C-A PC03043XL) is operating at 100.00% of design
Checking prerequisites for s2idle
✅ Logs are provided via systemd
✅ AMD Ryzen 7 5800U with Radeon Graphics (family 19 model 50)
✅ SMT enabled
✅ LPS0 _DSM enabled
✅ ACPI FADT supports Low-power S0 idle
✅ HSMP driver `amd_hsmp` not detected (blocked: False)
✅ PMC driver `amd_pmc` loaded (Program 0 Firmware 64.73.0)
✅ GPU driver `amdgpu` bound to 0000:03:00.0
✅ System is configured for s2idle
✅ NVME Intel Corporation SSD 670p Series [Keystone Harbor] is configured for s2idle in BIOS
✅ GPIO driver `pinctrl_amd` available
🚦 Device firmware checks unavailable without fwupd gobject introspection
Started at 2025-05-31 19:46:33.911590 (cycle finish expected @ 2025-05-31 19:46:42.911616)
Results from last s2idle cycle
○ Suspend count: 1
○ Hardware sleep cycle count: 1
○ Wakeup triggered from IRQ 9: ACPI SCI
○ Woke up from IRQ 9: ACPI SCI
○ gpe03 increased from 140 to 148
✅ Userspace suspended for 0:00:08.256333
❌ Did not reach hardware sleep state

If the duration arg is 6 or higher, then amd_s2idle.py reports that the
hardware sleep state was entered, and the "inconsistent lock state"
warning does not appear. If the duration is too low (e.g. 1 second),
then the laptop does not wake up automatically, and upon pressing a
keyboard key, the amdgpu driver will report an error resuming the GPU,
and the GPU will not be working. (I don't think the amdgpu problem is
related to the lock state warning, I'm just mentioning it for
completeness). It is the state between these two cases, where the laptop
does suspend and resume correctly, but the suspend is too short to enter
a hardware sleep state, where the problem occurs.

  reply	other threads:[~2025-05-31 19:16 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-30 11:32 [ BUG: Invalid wait context ] rtc_lock at: mc146818_avoid_UIP Borislav Petkov
2025-03-30 12:23 ` Mateusz Jończyk
2025-03-30 12:32   ` Mateusz Jończyk
2025-04-03 13:12 ` Thomas Gleixner
2025-04-03 13:50   ` Sebastian Andrzej Siewior
2025-04-03 19:36     ` Sebastian Andrzej Siewior
2025-04-03 20:26       ` Thomas Gleixner
2025-04-04  6:16         ` Sebastian Andrzej Siewior
2025-04-04 13:34         ` [PATCH] timekeeping: Add a lockdep override in tick_freeze() Sebastian Andrzej Siewior
2025-04-04 18:47           ` Mateusz Jończyk
2025-04-09 19:13           ` Peter Zijlstra
2025-04-09 21:12           ` [tip: timers/urgent] " tip-bot2 for Sebastian Andrzej Siewior
2025-05-31 18:27           ` [PATCH] " Chris Bainbridge
2025-05-31 19:16             ` Chris Bainbridge [this message]
2025-06-02 19:52               ` Mateusz Jończyk
2025-06-02 20:20                 ` [DRAFT PATCH] rtc-cmos: use spin_lock_irqsave in cmos_interrupt Mateusz Jończyk
2025-06-02 21:19                   ` Chris Bainbridge
2025-06-03  6:47                   ` Sebastian Andrzej Siewior
2025-04-03 23:46   ` [ BUG: Invalid wait context ] rtc_lock at: mc146818_avoid_UIP Mateusz Jończyk
2025-04-04  7:39     ` Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aDtVhPJD43DKNG3A@debian.local \
    --to=chris.bainbridge@gmail.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=anna-maria@linutronix.de \
    --cc=bigeasy@linutronix.de \
    --cc=bp@alien8.de \
    --cc=frederic@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=mat.jonczyk@o2.pl \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.