pinctrl: amd: Fix wakeups when IRQ is shared with SCI
authorMario Limonciello <mario.limonciello@amd.com>
Mon, 1 Nov 2021 01:48:53 +0000 (20:48 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Dec 2021 08:32:37 +0000 (09:32 +0100)
commit8e72fcf9aa9a0bec7f2a394e871be87a97d31aec
tree359177ea6d6c5e9ce48a057892a93db2af37aed1
parent78ae328fb170a6fe4eb7206dce8bbfcc8e630053
pinctrl: amd: Fix wakeups when IRQ is shared with SCI

commit 2d54067fcd23aae61e23508425ae5b29e973573d upstream.

On some Lenovo AMD Gen2 platforms the IRQ for the SCI and pinctrl drivers
are shared.  Due to how the s2idle loop handling works, this case needs
an extra explicit check whether the interrupt was caused by SCI or by
the GPIO controller.

To fix this rework the existing IRQ handler function to function as a
checker and an IRQ handler depending on the calling arguments.

BugLink: https://gitlab.freedesktop.org/drm/amd/-/issues/1738
Reported-by: Joerie de Gram <j.de.gram@gmail.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Acked-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
Link: https://lore.kernel.org/r/20211101014853.6177-2-mario.limonciello@amd.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pinctrl/pinctrl-amd.c