* [PATCH] platform/x86/amd: pmc: Clear metrics table at start of cycle
@ 2025-06-03 13:24 Mario Limonciello
2025-06-09 7:53 ` Ilpo Järvinen
0 siblings, 1 reply; 2+ messages in thread
From: Mario Limonciello @ 2025-06-03 13:24 UTC (permalink / raw)
To: mario.limonciello, Shyam-sundar.S-k, hdegoede, ilpo.jarvinen
Cc: platform-driver-x86
From: Mario Limonciello <mario.limonciello@amd.com>
The area of memory that contains the metrics table may contain garbage
when the cycle starts. This normally doesn't matter because the cycle
itself will populate it with valid data, however commit 9f5595d5f03fd
("platform/x86/amd: pmc: Require at least 2.5 seconds between HW sleep
cycles") started to use it during the check() phase. Depending upon
what garbage is in the table it's possible that the system will wait
2.5 seconds for even the first cycle, which will be visible to a user.
To prevent this from happening explicitly clear the table when logging
is started.
Fixes: 9f5595d5f03fd ("platform/x86/amd: pmc: Require at least 2.5 seconds between HW sleep cycles")
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
drivers/platform/x86/amd/pmc/pmc.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/platform/x86/amd/pmc/pmc.c b/drivers/platform/x86/amd/pmc/pmc.c
index 37c7a57afee5c..0b9b23eb7c2c3 100644
--- a/drivers/platform/x86/amd/pmc/pmc.c
+++ b/drivers/platform/x86/amd/pmc/pmc.c
@@ -157,6 +157,8 @@ static int amd_pmc_setup_smu_logging(struct amd_pmc_dev *dev)
return -ENOMEM;
}
+ memset_io(dev->smu_virt_addr, 0, sizeof(struct smu_metrics));
+
/* Start the logging */
amd_pmc_send_cmd(dev, 0, NULL, SMU_MSG_LOG_RESET, false);
amd_pmc_send_cmd(dev, 0, NULL, SMU_MSG_LOG_START, false);
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] platform/x86/amd: pmc: Clear metrics table at start of cycle
2025-06-03 13:24 [PATCH] platform/x86/amd: pmc: Clear metrics table at start of cycle Mario Limonciello
@ 2025-06-09 7:53 ` Ilpo Järvinen
0 siblings, 0 replies; 2+ messages in thread
From: Ilpo Järvinen @ 2025-06-09 7:53 UTC (permalink / raw)
To: mario.limonciello, Shyam-sundar.S-k, hdegoede, Mario Limonciello
Cc: platform-driver-x86
On Tue, 03 Jun 2025 08:24:08 -0500, Mario Limonciello wrote:
> The area of memory that contains the metrics table may contain garbage
> when the cycle starts. This normally doesn't matter because the cycle
> itself will populate it with valid data, however commit 9f5595d5f03fd
> ("platform/x86/amd: pmc: Require at least 2.5 seconds between HW sleep
> cycles") started to use it during the check() phase. Depending upon
> what garbage is in the table it's possible that the system will wait
> 2.5 seconds for even the first cycle, which will be visible to a user.
>
> [...]
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: Clear metrics table at start of cycle
commit: 4dbd11796f3a8eb95647507befc41995458a4023
--
i.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-06-09 7:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-03 13:24 [PATCH] platform/x86/amd: pmc: Clear metrics table at start of cycle Mario Limonciello
2025-06-09 7:53 ` 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