platform/x86: amd-pmc: only use callbacks for suspend
authorMario Limonciello <mario.limonciello@amd.com>
Fri, 10 Dec 2021 14:35:29 +0000 (08:35 -0600)
committerHans de Goede <hdegoede@redhat.com>
Tue, 21 Dec 2021 18:35:27 +0000 (19:35 +0100)
This driver is intended to be used exclusively for suspend to idle
so callbacks to send OS_HINT during hibernate and S5 will set OS_HINT
at the wrong time leading to an undefined behavior.

Cc: stable@vger.kernel.org
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20211210143529.10594-1-mario.limonciello@amd.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/x86/amd-pmc.c

index 841c44cd64c2c0c0545e60b791ccb632e76a684e..230593ae5d6de51c47e2d47ede5a4bc0dfbf285f 100644 (file)
@@ -508,7 +508,8 @@ static int __maybe_unused amd_pmc_resume(struct device *dev)
 }
 
 static const struct dev_pm_ops amd_pmc_pm_ops = {
-       SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(amd_pmc_suspend, amd_pmc_resume)
+       .suspend_noirq = amd_pmc_suspend,
+       .resume_noirq = amd_pmc_resume,
 };
 
 static const struct pci_device_id pmc_pci_ids[] = {