OSDN Git Service

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)
commit59348401ebed9f0e8ffe2d5b9cf1de30ecb24dde
tree16254a3001b95028e860a63530a97ee91480d165
parent4c9dbf8622797eee44e9a4f7327d3d04aa4d1d5f
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