Commit 90bec285 authored by Mario Limonciello's avatar Mario Limonciello Committed by Hans de Goede
Browse files

platform/x86/amd: pmc: Always write to the STB



The kernel parameter `enable_stb` currently gates the access to the STB
from debugfs and also controls whether the kernel writes events to the
STB.

Even if not accessing STB data from the kernel it's useful to have this
data stored to review the STB. So in suspend/resume always write it.

Signed-off-by: default avatarMario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20220829162953.5947-4-mario.limonciello@amd.com


Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent e24faabf
Loading
Loading
Loading
Loading
+6 −10
Original line number Diff line number Diff line
@@ -701,12 +701,10 @@ static void amd_pmc_s2idle_prepare(void)
		return;
	}

	if (enable_stb) {
	rc = amd_pmc_write_stb(pdev, AMD_PMC_STB_S2IDLE_PREPARE);
	if (rc)
		dev_err(pdev->dev, "error writing to STB: %d\n", rc);
}
}

static void amd_pmc_s2idle_restore(void)
{
@@ -725,11 +723,9 @@ static void amd_pmc_s2idle_restore(void)
	/* Dump the IdleMask to see the blockers */
	amd_pmc_idlemask_read(pdev, pdev->dev, NULL);

	if (enable_stb) {
	rc = amd_pmc_write_stb(pdev, AMD_PMC_STB_S2IDLE_RESTORE);
	if (rc)
		dev_err(pdev->dev, "error writing to STB: %d\n", rc);
	}

	/* Notify on failed entry */
	amd_pmc_validate_deepest(pdev);