提交 05a92622 编写于 作者: S Sahitya Tummala 提交者: Rafael J. Wysocki

PM / core: Fix bug in the error handling of async suspend

If async_suspend is enabled for parent and child devices, then
PM framework has to ensure that parent's async suspend gets called
only after child's async suspend is done. In case if child's async
suspend fails with error, then parent's async suspend must not be
invoked. The current code uses async_error to ensure this but there
is a problem with it in __device_suspend(). This function notifies
the completion of child's async suspend before updating its error
via async_error variable. As a result, parent's async suspend gets
invoked even though it's child suspend has failed. Fix this bug by
updating the async_error before notifying the child's completion.
Signed-off-by: NSahitya Tummala <stummala@codeaurora.org>
[ rjw: Rearranged wthitespace ]
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 bed57030
...@@ -1460,10 +1460,10 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async) ...@@ -1460,10 +1460,10 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async)
dpm_watchdog_clear(&wd); dpm_watchdog_clear(&wd);
Complete: Complete:
complete_all(&dev->power.completion);
if (error) if (error)
async_error = error; async_error = error;
complete_all(&dev->power.completion);
TRACE_SUSPEND(error); TRACE_SUSPEND(error);
return error; return error;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册