]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
PM: sleep: wakeirq: fix wake irq arming
authorJohan Hovold <johan+linaro@kernel.org>
Thu, 13 Jul 2023 14:57:39 +0000 (16:57 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Aug 2023 08:26:13 +0000 (10:26 +0200)
commit5dac557301d868a55645c5681d14a48da2fde189
treea942af86550a7d494a8dc7a295018d19efe0e062
parent807ada0e4aa3c9090c66009a99fa530c462012c9
PM: sleep: wakeirq: fix wake irq arming

commit 8527beb12087238d4387607597b4020bc393c4b4 upstream.

The decision whether to enable a wake irq during suspend can not be done
based on the runtime PM state directly as a driver may use wake irqs
without implementing runtime PM. Such drivers specifically leave the
state set to the default 'suspended' and the wake irq is thus never
enabled at suspend.

Add a new wake irq flag to track whether a dedicated wake irq has been
enabled at runtime suspend and therefore must not be enabled at system
suspend.

Note that pm_runtime_enabled() can not be used as runtime PM is always
disabled during late suspend.

Fixes: 69728051f5bf ("PM / wakeirq: Fix unbalanced IRQ enable for wakeirq")
Cc: 4.16+ <stable@vger.kernel.org> # 4.16+
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Tony Lindgren <tony@atomide.com>
Tested-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/power/power.h
drivers/base/power/wakeirq.c