]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 May 2019 13:48:26 +0000 (06:48 -0700)
commitf4bb904143a5dd41383bc0e4d96760a2aa2b8fcf
treee02c42c7e76abfc9a873a10549f0199048ed378c
parent6336b2f797f4c4e6c74571cec95d0ee8addb3576
PM / core: Propagate dev->power.wakeup_path when no callbacks

[ Upstream commit dc351d4c5f4fe4d0f274d6d660227be0c3a03317 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/base/power/main.c