mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Julius Werner <jwerner@chromium.org>
Cc: Len Brown <len.brown@intel.com>, Pavel Machek <pavel@ucw.cz>,
	Todd Poynor <toddpoynor@google.com>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Sameer Nanda <snanda@chromium.org>
Subject: Re: [PATCH] PM / Sleep: Print last wakeup source on failed wakeup_count write
Date: Wed, 12 Jun 2013 00:00:18 +0200	[thread overview]
Message-ID: <4844834.TBe7kS6ocA@vostro.rjw.lan> (raw)
In-Reply-To: <1369944137-30948-1-git-send-email-jwerner@chromium.org>

On Thursday, May 30, 2013 01:02:17 PM Julius Werner wrote:
> Commit a938da06 introduced a useful little log message to tell
> users/debuggers which wakeup source aborted a suspend. However, this
> message is only printed if the abort happens during the in-kernel
> suspend path (after writing /sys/power/state).
> 
> The full specification of the /sys/power/wakeup_count facility allows
> user-space power managers to double-check if wakeups have already
> happened before it actually tries to suspend (e.g. while it was running
> user-space pre-suspend hooks), by writing the last known wakeup_count
> value to /sys/power/wakeup_count. This patch changes the sysfs handler
> for that node to also print said log message if that write fails, so
> that we can figure out the offending wakeup source for both kinds of
> suspend aborts.
> 
> Signed-off-by: Julius Werner <jwerner@chromium.org>
> ---
>  drivers/base/power/wakeup.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c
> index 79715e7..b0b7886 100644
> --- a/drivers/base/power/wakeup.c
> +++ b/drivers/base/power/wakeup.c
> @@ -772,6 +772,8 @@ bool pm_save_wakeup_count(unsigned int count)
>  		events_check_enabled = true;
>  	}
>  	spin_unlock_irqrestore(&events_lock, flags);
> +	if (!events_check_enabled)
> +		print_active_wakeup_sources();

This is going to be done in the autosleep case too, which I'm slightly
concerned about.

If you wanted to cover /sys/power/wakeup_count only, it would be better
to put that into wakeup_count_store(), but perhaps you wanted to cover
autosleep too?

>  	return events_check_enabled;
>  }

Thanks,
Rafael


-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

  reply	other threads:[~2013-06-11 21:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-30 20:02 Julius Werner
2013-06-11 22:00 ` Rafael J. Wysocki [this message]
     [not found]   ` <CAODwPW9gt_E_rtVhk4bMO_EnGaLbRqca0xQosQBc7KuEtEDQXQ@mail.gmail.com>
2013-06-11 23:20     ` Julius Werner
2013-06-12 11:08     ` Rafael J. Wysocki

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=4844834.TBe7kS6ocA@vostro.rjw.lan \
    --to=rjw@sisk.pl \
    --cc=jwerner@chromium.org \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=snanda@chromium.org \
    --cc=toddpoynor@google.com \
    /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

all inboxes | Powered by JetHome®