Skip to content

Commit 7abc361

Browse files
superm1jwrdegoede
authored andcommitted
platform/x86/amd: pmc: Don't dump data after resume from s0i3 on picasso
This command isn't supported on Picasso, so guard against running it to avoid errors like `SMU cmd unknown. err: 0xfe` in the logs. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2449 Fixes: 7662056 ("platform/x86: amd-pmc: Add support for logging SMU metrics") Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Link: https://lore.kernel.org/r/20230409185348.556161-4-Shyam-sundar.S-k@amd.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
1 parent 5ec9ee0 commit 7abc361

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

  • drivers/platform/x86/amd

drivers/platform/x86/amd/pmc.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,6 +834,14 @@ static void amd_pmc_s2idle_check(void)
834834
dev_err(pdev->dev, "error writing to STB: %d\n", rc);
835835
}
836836

837+
static int amd_pmc_dump_data(struct amd_pmc_dev *pdev)
838+
{
839+
if (pdev->cpu_id == AMD_CPU_ID_PCO)
840+
return -ENODEV;
841+
842+
return amd_pmc_send_cmd(pdev, 0, NULL, SMU_MSG_LOG_DUMP_DATA, 0);
843+
}
844+
837845
static void amd_pmc_s2idle_restore(void)
838846
{
839847
struct amd_pmc_dev *pdev = &pmc;
@@ -846,7 +854,7 @@ static void amd_pmc_s2idle_restore(void)
846854
dev_err(pdev->dev, "resume failed: %d\n", rc);
847855

848856
/* Let SMU know that we are looking for stats */
849-
amd_pmc_send_cmd(pdev, 0, NULL, SMU_MSG_LOG_DUMP_DATA, 0);
857+
amd_pmc_dump_data(pdev);
850858

851859
rc = amd_pmc_write_stb(pdev, AMD_PMC_STB_S2IDLE_RESTORE);
852860
if (rc)

0 commit comments

Comments
 (0)