PM / wakeup: Print warn if device gets enabled as wakeup source during sleep
authorUlf Hansson <ulf.hansson@linaro.org>
Thu, 11 Jan 2018 08:18:59 +0000 (09:18 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 11 Jan 2018 17:50:54 +0000 (18:50 +0100)
commit0026cef067d2962ed064b974e07f017233d5bd5a
treeaf16c9124b91cfae4af7620c662364a8832bfe59
parent0a99d767a9b0aae6e0fd983c889c793e4c91684c
PM / wakeup: Print warn if device gets enabled as wakeup source during sleep

In general, wakeup settings are not supposed to be changed during any of
the system wide PM phases. The reason is simply that it would break
guarantees provided by the PM core, to properly act on active wakeup
sources.

However, there are exceptions to when, in particular, disabling a device as
wakeup source makes sense. For example, in cases when a driver realizes
that its device is dead during system suspend. For these scenarios, we
don't need to care about acting on the wakeup source correctly, because a
dead device shouldn't deliver wakeup signals.

To this reasoning and to help users to properly manage wakeup settings,
let's print a warning in cases someone calls device_wakeup_enable() during
system sleep.

Suggested-by: Rafael J. Wysocki <rafael@kernel.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
[ rjw: Message to be printed ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/base/power/wakeup.c