]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
leds: core: Flush scheduled work for system suspend
authorKai-Heng Feng <kai.heng.feng@canonical.com>
Thu, 2 Jul 2020 05:45:00 +0000 (13:45 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Aug 2020 06:26:33 +0000 (08:26 +0200)
commit413d189f9a3c3bab7a6a94de45112fe6b38fc87f
tree9bfed5c77af1ccc42610a5774a3a9ff05b9b27e3
parentc5450ee5eb1a760702c6f7c0ac5b3aed62bef00e
leds: core: Flush scheduled work for system suspend

[ Upstream commit 302a085c20194bfa7df52e0fe684ee0c41da02e6 ]

Sometimes LED won't be turned off by LED_CORE_SUSPENDRESUME flag upon
system suspend.

led_set_brightness_nopm() uses schedule_work() to set LED brightness.
However, there's no guarantee that the scheduled work gets executed
because no one flushes the work.

So flush the scheduled work to make sure LED gets turned off.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Acked-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Fixes: 81fe8e5b73e3 ("leds: core: Add led_set_brightness_nosleep{nopm} functions")
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/leds/led-class.c