mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Farrukh Seyer Hasan <farrukh13hasan31@gmail.com>
To: Mario Limonciello <mario.limonciello@amd.com>
Cc: Huang Rui <ray.huang@amd.com>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Perry Yuan <perry.yuan@amd.com>,
	K Prateek Nayak <kprateek.nayak@amd.com>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Farrukh Seyer Hasan <farrukh13hasan31@gmail.com>
Subject: Re: [PATCH] cpufreq/amd-pstate: Do not cache bios_min_perf from populated CPPC_REQ
Date: Fri,  4 Dec 2026 12:45:30 +0530	[thread overview]
Message-ID: <20261204071530.21240-1-farrukh13hasan31@gmail.com> (raw)
In-Reply-To: <1fbd5718-11db-42f0-89e2-6255afc3c5f4@amd.com>

(Resending in plain text so this reaches the mailing lists.)

On 12/3/26 20:38, Mario Limonciello wrote:
> Can you tell me more about the actual issue that reproduced this?  Did 
> you really see a problem with warm reboots?  Or are you having a system 
> crash?  Can you give me some reproduce steps?
> 
> My knee jerk reaction was this doesn't make sense for kexec and the 
> shutdown sequence both are expecting this flow.  Sashiko seems to agree.
> 
> https://sashiko.dev/#/patchset/20261203130758.38506-1-farrukh13hasan31%40gmail.com

Hi Mario,

Sorry, you and Sashiko are right about v1. It breaks kexec because
device_shutdown() -> cpufreq_suspend() -> amd_pstate_suspend() keeps
MAX_PERF and DES_PERF non-zero, and commit 0e850278016e dropped the
check for that reason. Please drop v1.

I had not tested a cold boot before. When I checked a clean cold boot
(poweroff -> power on) on stock 7.3.6-200.fc44.x86_64 with
dyndbg="file drivers/cpufreq/amd-pstate.c +p", the issue reproduced
directly on cold boot:

Hardware: ASUS TUF Gaming A17 FA706IC (BIOS FA706IC.302, Ryzen 7 4800H)
There is no "Requested CPU Min frequency" option in BIOS.

MSR_AMD_CPPC_CAP1 (0xC00102B0): 0xffac4218
  lowest=24 (404791 KHz), lownonlin=66 (1113175 KHz),
  nominal=172 (2901000 KHz), highest=255 (4300902 KHz)

On cold boot, dmesg logs on all 16 CPUs show:
  amd_pstate: Found Requested CPU Min Frequency of 4300902KHz on CPU0

Under balanced (powersave governor, balance_performance EPP):
  scaling_min_freq: 4300902
  scaling_max_freq: 4300902
  MSR_AMD_CPPC_REQ (0xC00102B3): 0x8000ffff (max=255 min=255 des=0 epp=0x80)

Under powersave (power EPP, max capped at nominal):
  scaling_min_freq: 2901000
  scaling_max_freq: 2901000
  MSR_AMD_CPPC_REQ (0xC00102B3): 0xff00acac (max=172 min=172 des=0 epp=0xff)

Earlier I observed the 2901000 KHz clamped state while powersave was
active, which made me suspect a leftover value across reboot/crash. On
cold boot this firmware leaves MSR_AMD_CPPC_REQ at 0xffff (min=max=255),
so after 0e850278016e, msr_init_perf() latches bios_min_perf = highest_perf.

For v2, which direction would you prefer so that I can prepare and test
the patch before sending it?
1. Reject min_perf >= perf.highest_perf in msr_init_perf()
   (seems least invasive to me as it avoids touching suspend/kexec for
   lower bios_min_perf values).
2. Restore the check on other CPPC_REQ fields in msr_init_perf() and
   clear MAX_PERF/DES_PERF in amd_pstate_suspend()/offline.
3. Add a DMI quirk for FA706IC.

  reply	other threads:[~2026-12-04  7:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 13:07 Farrukh Seyer Hasan
2026-12-03 20:38 ` Mario Limonciello
2026-12-04  7:15   ` Farrukh Seyer Hasan [this message]
2026-12-04 22:25     ` Mario Limonciello

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=20261204071530.21240-1-farrukh13hasan31@gmail.com \
    --to=farrukh13hasan31@gmail.com \
    --cc=kprateek.nayak@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=perry.yuan@amd.com \
    --cc=rafael@kernel.org \
    --cc=ray.huang@amd.com \
    --cc=viresh.kumar@linaro.org \
    /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

all inboxes | Powered by JetHome®