Skip to content

Commit 4dbd117

Browse files
superm1ij-intel
authored andcommitted
platform/x86/amd: pmc: Clear metrics table at start of cycle
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 9f5595d ("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: 9f5595d ("platform/x86/amd: pmc: Require at least 2.5 seconds between HW sleep cycles") Signed-off-by: Mario Limonciello <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
1 parent 1d0a619 commit 4dbd117

File tree

1 file changed

+2
-0
lines changed
  • drivers/platform/x86/amd/pmc

1 file changed

+2
-0
lines changed

drivers/platform/x86/amd/pmc/pmc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ static int amd_pmc_setup_smu_logging(struct amd_pmc_dev *dev)
157157
return -ENOMEM;
158158
}
159159

160+
memset_io(dev->smu_virt_addr, 0, sizeof(struct smu_metrics));
161+
160162
/* Start the logging */
161163
amd_pmc_send_cmd(dev, 0, NULL, SMU_MSG_LOG_RESET, false);
162164
amd_pmc_send_cmd(dev, 0, NULL, SMU_MSG_LOG_START, false);

0 commit comments

Comments
 (0)