OSDN Git Service

PM / core: Propagate dev->power.wakeup_path when no callbacks
authorUlf Hansson <ulf.hansson@linaro.org>
Wed, 10 Apr 2019 09:55:16 +0000 (11:55 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 12 Apr 2019 09:03:53 +0000 (11:03 +0200)
commitdc351d4c5f4fe4d0f274d6d660227be0c3a03317
tree2be16995c3f74f9c5e7c8ebc5883edf8cf4435b1
parentf2a424f6c613a98560dc49fd9984589401d51648
PM / core: Propagate dev->power.wakeup_path when no callbacks

The dev->power.direct_complete flag may become set in device_prepare() in
case the device don't have any PM callbacks (dev->power.no_pm_callbacks is
set). This leads to a broken behaviour, when there is child having wakeup
enabled and relies on its parent to be used in the wakeup path.

More precisely, when the direct complete path becomes selected for the
child in __device_suspend(), the propagation of the dev->power.wakeup_path
becomes skipped as well.

Let's address this problem, by checking if the device is a part the wakeup
path or has wakeup enabled, then prevent the direct complete path from
being used.

Reported-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
[ rjw: Comment cleanup ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/base/power/main.c