* [PATCH] platform/x86/amd: pmc: Require at least 2.5 seconds between HW sleep cycles
@ 2025-04-14 16:24 Mario Limonciello
2025-04-14 17:40 ` Shyam Sundar S K
2025-04-17 11:18 ` Ilpo Järvinen
0 siblings, 2 replies; 3+ messages in thread
From: Mario Limonciello @ 2025-04-14 16:24 UTC (permalink / raw)
To: mario.limonciello, Shyam-sundar.S-k, hdegoede, ilpo.jarvinen
Cc: stable, platform-driver-x86
From: Mario Limonciello <mario.limonciello@amd.com>
When an APU exits HW sleep with no active wake sources the Linux kernel will
rapidly assert that the APU can enter back into HW sleep. This happens in a
few ms. Contrasting this to Windows, Windows can take 10s of seconds to
enter back into the resiliency phase for Modern Standby.
For some situations this can be problematic because it can cause leakage
from VDDCR_SOC to VDD_MISC and force VDD_MISC outside of the electrical
design guide specifications. On some designs this will trip the over
voltage protection feature (OVP) of the voltage regulator module, but it
could cause APU damage as well.
To prevent this risk, add an explicit sleep call so that future attempts
to enter into HW sleep will have enough time to settle. This will occur
while the screen is dark and only on cases that the APU should enter HW
sleep again, so it shouldn't be noticeable to any user.
Cc: stable@vger.kernel.org
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
drivers/platform/x86/amd/pmc/pmc.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/platform/x86/amd/pmc/pmc.c b/drivers/platform/x86/amd/pmc/pmc.c
index d789d6cab7948..0329fafe14ebc 100644
--- a/drivers/platform/x86/amd/pmc/pmc.c
+++ b/drivers/platform/x86/amd/pmc/pmc.c
@@ -644,10 +644,9 @@ static void amd_pmc_s2idle_check(void)
struct smu_metrics table;
int rc;
- /* CZN: Ensure that future s0i3 entry attempts at least 10ms passed */
- if (pdev->cpu_id == AMD_CPU_ID_CZN && !get_metrics_table(pdev, &table) &&
- table.s0i3_last_entry_status)
- usleep_range(10000, 20000);
+ /* Avoid triggering OVP */
+ if (!get_metrics_table(pdev, &table) && table.s0i3_last_entry_status)
+ msleep(2500);
/* Dump the IdleMask before we add to the STB */
amd_pmc_idlemask_read(pdev, pdev->dev, NULL);
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] platform/x86/amd: pmc: Require at least 2.5 seconds between HW sleep cycles
2025-04-14 16:24 [PATCH] platform/x86/amd: pmc: Require at least 2.5 seconds between HW sleep cycles Mario Limonciello
@ 2025-04-14 17:40 ` Shyam Sundar S K
2025-04-17 11:18 ` Ilpo Järvinen
1 sibling, 0 replies; 3+ messages in thread
From: Shyam Sundar S K @ 2025-04-14 17:40 UTC (permalink / raw)
To: Mario Limonciello, mario.limonciello, hdegoede, ilpo.jarvinen
Cc: stable, platform-driver-x86
On 4/14/2025 21:54, Mario Limonciello wrote:
> From: Mario Limonciello <mario.limonciello@amd.com>
>
> When an APU exits HW sleep with no active wake sources the Linux kernel will
> rapidly assert that the APU can enter back into HW sleep. This happens in a
> few ms. Contrasting this to Windows, Windows can take 10s of seconds to
> enter back into the resiliency phase for Modern Standby.
>
> For some situations this can be problematic because it can cause leakage
> from VDDCR_SOC to VDD_MISC and force VDD_MISC outside of the electrical
> design guide specifications. On some designs this will trip the over
> voltage protection feature (OVP) of the voltage regulator module, but it
> could cause APU damage as well.
>
> To prevent this risk, add an explicit sleep call so that future attempts
> to enter into HW sleep will have enough time to settle. This will occur
> while the screen is dark and only on cases that the APU should enter HW
> sleep again, so it shouldn't be noticeable to any user.
>
> Cc: stable@vger.kernel.org
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Thank you.
Acked-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
> ---
> drivers/platform/x86/amd/pmc/pmc.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/platform/x86/amd/pmc/pmc.c b/drivers/platform/x86/amd/pmc/pmc.c
> index d789d6cab7948..0329fafe14ebc 100644
> --- a/drivers/platform/x86/amd/pmc/pmc.c
> +++ b/drivers/platform/x86/amd/pmc/pmc.c
> @@ -644,10 +644,9 @@ static void amd_pmc_s2idle_check(void)
> struct smu_metrics table;
> int rc;
>
> - /* CZN: Ensure that future s0i3 entry attempts at least 10ms passed */
> - if (pdev->cpu_id == AMD_CPU_ID_CZN && !get_metrics_table(pdev, &table) &&
> - table.s0i3_last_entry_status)
> - usleep_range(10000, 20000);
> + /* Avoid triggering OVP */
> + if (!get_metrics_table(pdev, &table) && table.s0i3_last_entry_status)
> + msleep(2500);
>
> /* Dump the IdleMask before we add to the STB */
> amd_pmc_idlemask_read(pdev, pdev->dev, NULL);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] platform/x86/amd: pmc: Require at least 2.5 seconds between HW sleep cycles
2025-04-14 16:24 [PATCH] platform/x86/amd: pmc: Require at least 2.5 seconds between HW sleep cycles Mario Limonciello
2025-04-14 17:40 ` Shyam Sundar S K
@ 2025-04-17 11:18 ` Ilpo Järvinen
1 sibling, 0 replies; 3+ messages in thread
From: Ilpo Järvinen @ 2025-04-17 11:18 UTC (permalink / raw)
To: mario.limonciello, Shyam-sundar.S-k, hdegoede, Mario Limonciello
Cc: stable, platform-driver-x86
On Mon, 14 Apr 2025 11:24:00 -0500, Mario Limonciello wrote:
> When an APU exits HW sleep with no active wake sources the Linux kernel will
> rapidly assert that the APU can enter back into HW sleep. This happens in a
> few ms. Contrasting this to Windows, Windows can take 10s of seconds to
> enter back into the resiliency phase for Modern Standby.
>
> For some situations this can be problematic because it can cause leakage
> from VDDCR_SOC to VDD_MISC and force VDD_MISC outside of the electrical
> design guide specifications. On some designs this will trip the over
> voltage protection feature (OVP) of the voltage regulator module, but it
> could cause APU damage as well.
>
> [...]
Thank you for your contribution, it has been applied to my local
review-ilpo-fixes branch. Note it will show up in the public
platform-drivers-x86/review-ilpo-fixes branch only once I've pushed my
local branch there, which might take a while.
The list of commits applied:
[1/1] platform/x86/amd: pmc: Require at least 2.5 seconds between HW sleep cycles
commit: 9f5595d5f03fd4dc640607a71e89a1daa68fd19d
--
i.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-04-17 11:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-14 16:24 [PATCH] platform/x86/amd: pmc: Require at least 2.5 seconds between HW sleep cycles Mario Limonciello
2025-04-14 17:40 ` Shyam Sundar S K
2025-04-17 11:18 ` Ilpo Järvinen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox