From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Colin Cross <ccross@android.com>
Cc: Pavel Machek <pavel@ucw.cz>, Len Brown <len.brown@intel.com>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PM / Sleep: call early resume handlers when suspend_noirq fails
Date: Thu, 19 Jul 2012 11:10:01 +0200 [thread overview]
Message-ID: <201207191110.01193.rjw@sisk.pl> (raw)
In-Reply-To: <1342663694-3645-1-git-send-email-ccross@android.com>
On Thursday, July 19, 2012, Colin Cross wrote:
> Commit cf579dfb82550e34de7ccf3ef090d8b834ccd3a9 (PM / Sleep: Introduce
> "late suspend" and "early resume" of devices) introduced a bug where
> suspend_late handlers would be called, but if dpm_suspend_noirq returned
> an error the early_resume handlers would never be called. All devices
> would end up on the dpm_late_early_list, and would never be resumed
> again.
>
> Fix it by calling dpm_resume_early when dpm_suspend_noirq returns
> an error.
>
> Signed-off-by: Colin Cross <ccross@android.com>
Nice catch, thanks!
Applied, with a CC to -stable.
Thanks,
Rafael
> ---
> drivers/base/power/main.c | 10 +++++++++-
> 1 files changed, 9 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
> index 9cb845e..742fcbe 100644
> --- a/drivers/base/power/main.c
> +++ b/drivers/base/power/main.c
> @@ -989,8 +989,16 @@ static int dpm_suspend_late(pm_message_t state)
> int dpm_suspend_end(pm_message_t state)
> {
> int error = dpm_suspend_late(state);
> + if (error)
> + return error;
>
> - return error ? : dpm_suspend_noirq(state);
> + error = dpm_suspend_noirq(state);
> + if (error) {
> + dpm_resume_early(state);
> + return error;
> + }
> +
> + return 0;
> }
> EXPORT_SYMBOL_GPL(dpm_suspend_end);
>
>
prev parent reply other threads:[~2012-07-19 9:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-19 2:08 Colin Cross
2012-07-19 9:10 ` Rafael J. Wysocki [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201207191110.01193.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=ccross@android.com \
--cc=gregkh@linuxfoundation.org \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=pavel@ucw.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome