]> git.baikalelectronics.ru Git - kernel.git/commit
platform/x86: amd-pmc: Add special handling for timer based S0i3 wakeup
authorMario Limonciello <mario.limonciello@amd.com>
Wed, 20 Oct 2021 16:29:46 +0000 (11:29 -0500)
committerHans de Goede <hdegoede@redhat.com>
Thu, 21 Oct 2021 18:36:15 +0000 (20:36 +0200)
commitc0b396a9af973d8f799b0d4e59e6b68c3c73ef43
tree16254a3001b95028e860a63530a97ee91480d165
parente8f6c320ba3e7bace2183331652edb0c2f313920
platform/x86: amd-pmc: Add special handling for timer based S0i3 wakeup

RTC based wakeup from s0i3 doesn't work properly on some Green Sardine
platforms. Because of this, a newer SMU for Green Sardine has the ability
to pass wakeup time as argument of the upper 16 bits of OS_HINT message.

With older firmware setting the timer value in OS_HINT will cause firmware
to reject the hint, so only run this path on:
1) Green Sardine
2) Minimum SMU FW
3) RTC alarm armed during s0i3 entry

Using this method has some limitations that the s0i3 wakeup will need to
be between 4 seconds and 18 hours, so check those boundary conditions as
well and abort the suspend if RTC is armed for too short or too long of a
duration.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20211020162946.10537-2-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