The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Mario Limonciello <superm1@kernel.org>
To: "Daniel Gibson" <daniel@gibson.sh>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>,
	Hans de Goede <hansg@kernel.org>,
	platform-driver-x86@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	Sindre Henriksen <sindrehenriksen93@gmail.com>
Subject: Re: [PATCH 1/2] platform/x86/amd/pmc: Delay suspend for some Lenovo Laptops
Date: Thu, 7 May 2026 18:48:55 -0500	[thread overview]
Message-ID: <f268efcd-ad44-4b5c-b2f8-9837c5678a7f@kernel.org> (raw)
In-Reply-To: <36c3e7fa-f153-42d2-b1c2-8f5b9564ee77@gibson.sh>


> 
> Are you sure it behaves like this?
> The check is basically "is the SMU table's s0i3_last_entry_status != 0".
> And as far as I can tell this is the case after every successful suspend,
> it only seems to be reset by rebooting or if a suspend fails.
> 
> See smu_fw_info_show() (for /sys/kern/debug/amd_pmc/smu_fw_info):
> seq_printf(s, "Last S0i3 Status: %s\n", table.s0i3_last_entry_status ? "Success" :
> 		   "Unknown/Fail");
> 
> When I read /sys/kern/debug/amd_pmc/smu_fw_info right after booting, it prints
> "Last S0i3 Status: Unknown/Fail"
> After resuming, even minutes (and presumably hours) later, it prints
> "Last S0i3 Status: Success"
> indicating that s0i3_last_entry_status still is != 0.
> 
>>
>> Now you might have been confused by not looking at commit
>> 4dbd11796f3a8eb95647507befc41995458a4023.  This fixes the behavior as
>> it's supposed to be.
>>
First suspend entry:

amd_pmc_s2idle_prepare()
->amd_pmc_setup_smu_logging()
->->memset_io(dev->smu_virt_addr, 0, sizeof(struct smu_metrics))

That is the table is cleared.

amd_pmc_s2idle_check()
->get_metrics_table() && table.s0i3_last_entry_status

The table is fetched and check (last entry will be 0).
No delay.

At this point system is in hardware sleep.

If system resumes from hardware sleep table.s0i3_last_entry_status will 
be non-zero.

If you re-enter:

amd_pmc_s2idle_check() will do the msleep.

If you exit:

amd_pmc_s2idle_restore()
-> amd_pmc_validate_deepest()

This will read metrics table and tell you in logs if you didn't get to 
HW sleep.


  reply	other threads:[~2026-05-07 23:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260501032655.283789-1-daniel@gibson.sh>
     [not found] ` <20260501032655.283789-2-daniel@gibson.sh>
2026-05-07 13:22   ` [PATCH 1/2] platform/x86/amd/pmc: Delay suspend for some Lenovo Laptops Ilpo Järvinen
2026-05-07 20:19     ` Daniel Gibson
2026-05-07 22:43       ` Daniel Gibson
2026-05-07 22:54         ` Mario Limonciello
2026-05-07 23:25           ` Daniel Gibson
2026-05-07 23:48             ` Mario Limonciello [this message]
2026-05-07 23:56               ` Daniel Gibson
     [not found] ` <20260501032655.283789-3-daniel@gibson.sh>
2026-05-04 14:37   ` [PATCH 2/2] platform/x86/amd/pmc: Add delay_suspend module argument Mario Limonciello
2026-05-04 15:38     ` Daniel Gibson
2026-05-04 16:58       ` Mario Limonciello
2026-05-07 13:33   ` Ilpo Järvinen
2026-05-07 20:19     ` Daniel Gibson

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=f268efcd-ad44-4b5c-b2f8-9837c5678a7f@kernel.org \
    --to=superm1@kernel.org \
    --cc=Shyam-sundar.S-k@amd.com \
    --cc=daniel@gibson.sh \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=sindrehenriksen93@gmail.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