The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Tzung-Bi Shih <tzungbi@kernel.org>
To: Xi Pardee <xi.pardee@linux.intel.com>
Cc: "Rajneesh Bhardwaj" <irenic.rajneesh@gmail.com>,
	"Hans de Goede" <hansg@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org, tfiga@chromium.org
Subject: Re: [PATCH v3] platform/x86/intel/pmc: Disable ACPI PM timer during suspend on Panther Lake
Date: Wed, 18 Nov 2026 07:15:23 +0000	[thread overview]
Message-ID: <av1Qi2MGB4asm0ks@google.com> (raw)
In-Reply-To: <766daa32-2247-40c2-980f-2a2317733b96@linux.intel.com>

On Mon, Nov 16, 2026 at 09:17:13PM -0800, Xi Pardee wrote:
> Hi Tzung-Bi,
> 
> Thanks for the v3. Avoiding  pmcdev->lock  and the tick_freeze()  atomic
> context resolves the problem behind the revert in 5fa607880168, and the save
> and restore logic looks correct.
> 
> Two requests:
> 
> 1. Ordering vs. the  acpi_pm  clocksource.
> • The reverted code toggled the timer from the clocksource's own callbacks.
> These run inside  timekeeping_suspend()  after the last read and inside 
> timekeeping_resume()  before the first read, so the counter is never read
> while stopped.
> • Here the timer is stopped in  suspend_late  and restarted in resume_early
> . That is before  timekeeping_forward_now()  on suspend and after 
> tk_clock_read()  on resume.
> • If  acpi_pm  is the active clocksource, for example when TSC is unstable,
> timekeeping can read a stopped counter, and ktime_get()  stops advancing
> from  suspend_late  on.
> • Have you tested with  clocksource=acpi_pm ? If TSC is always used on PTL,
> please say so in the commit message.

Good catch.  I haven't tested with clocksource=acpi_pm since our test
kernel has CONFIG_X86_PM_TIMER=n and uses TSC.

To preserve proper ordering when CONFIG_X86_PM_TIMER=y, in v4 I will
move the lockless toggle helper into pmc_core and register it via
acpi_pmtmr_register_suspend_resume_callback() when CONFIG_X86_PM_TIMER=y
(falling back to pmc_core_suspend()/pmc_core_resume() when disabled).

I will send out v4 after re-running the s2idle test with the updated
patches.

> 2. Evidence for S0i2.2.
> • Please share S0i2.1 and S0i2.2 residency with and without the patch.
> • Include the platform, firmware and kernel version, and say whether
> firmware enabled the timer and  wdat_wdt  was active.

Here are the current results from v3 on a Panther Lake Android desktop
device (coreboot with CONFIG_USE_PM_ACPI_TIMER=y, kernel 6.18 with
CONFIG_X86_PM_TIMER=n, wdat_wdt not active):

- Without patch:
    S0i2.1: 100.00% (345,477 ms), S0i2.2: 0.00% (0 ms)
- With patch:
    S0i2.1: 0.00% (11 ms), S0i2.2: 100.00% (338,628 ms)

I will include the residency results in the v4 commit message as well.

> 
> Also, does WCL, which reuses the PTL ops, need the same fix?

I'm not sure whether WCL has the same behavior, and I don't have WCL
hardware to verify it.  In v4, I'll move the support into pmc_core via
opt-in fields in struct pmc_reg_map and enable it for Panther Lake, so
WCL (or other platforms) can easily opt in if needed.

      reply	other threads:[~2026-11-18  7:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-12  3:20 [PATCH v3] platform/x86/intel/pmc: Disable ACPI PM timer during suspend on Panther Lake Tzung-Bi Shih
2026-11-17  5:17 ` Xi Pardee
2026-11-18  7:15   ` Tzung-Bi Shih [this message]

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=av1Qi2MGB4asm0ks@google.com \
    --to=tzungbi@kernel.org \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=irenic.rajneesh@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=tfiga@chromium.org \
    --cc=xi.pardee@linux.intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox