pinctrl: amd: Mask non-wake source pins with interrupt enabled at suspend
authorMario Limonciello <mario.limonciello@amd.com>
Sun, 3 Dec 2023 03:24:31 +0000 (21:24 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 Jan 2024 10:51:44 +0000 (11:51 +0100)
commita2af708bb197b0efe10c65685defa510f308b663
tree71f2aa99f94e2ab834872f51d7ce1d5974fbabc4
parent0a4a682b502f1dae2db793415a75f564719fdb3f
pinctrl: amd: Mask non-wake source pins with interrupt enabled at suspend

[ Upstream commit 2fff0b5e1a6b9c577b4dd4958902c877159c856b ]

If a pin isn't marked as a wake source processing any interrupts is
just going to destroy battery life.  The APU may wake up from a hardware
sleep state to process the interrupt but not return control to the OS.

Mask interrupt for all non-wake source pins at suspend. They'll be
re-enabled at resume.

Reported-and-tested-by: Marcus Aram <marcus+oss@oxar.nl>
Reported-and-tested-by: Mark Herbert <mark.herbert42@gmail.com>
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2812
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20231203032431.30277-3-mario.limonciello@amd.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pinctrl/pinctrl-amd.c
drivers/pinctrl/pinctrl-amd.h