From: Todd Poynor <toddpoynor@google.com>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, arve@android.com
Subject: Re: [PATCH] PM / Sleep: Print name of wakeup source that aborts suspend
Date: Thu, 19 Jul 2012 18:00:19 -0700 [thread overview]
Message-ID: <20120720010019.GA15701@google.com> (raw)
In-Reply-To: <201207182147.34750.rjw@sisk.pl>
On Wed, Jul 18, 2012 at 09:47:34PM +0200, Rafael J. Wysocki wrote:
> On Wednesday, July 18, 2012, Todd Poynor wrote:
...
> > +{
> > + struct wakeup_source *ws;
> > + int active = 0;
> > + struct wakeup_source *last_activity_ws = NULL;
> > +
> > + rcu_read_lock();
> > + list_for_each_entry_rcu(ws, &wakeup_sources, entry) {
> > + if (ws->active) {
> > + pr_info("active wakeup source: %s\n", ws->name);
> > + active = 1;
>
> Can we do a break here? Or do we want to get all of them?
I haven't seen more than 3 activated during suspend entry at a time, but
could just list one. I haven't made that change yet but will if it's
preferred.
>
> > + } else if (!active &&
> > + (!last_activity_ws ||
> > + ws->last_time.tv64 >
> > + last_activity_ws->last_time.tv64)) {
>
> ktime_to_ns() anyone?
Sure, I avoided it because some configs do math on each of these, but
perhaps most implementations implement it as a NOP.
>
> > + last_activity_ws = ws;
> > + }
> > + }
> > +
> > + if (!active && last_activity_ws)
> > + pr_info("last active wakeup source: %s\n",
> > + last_activity_ws->name);
> > + rcu_read_unlock();
> > +}
> > +
> > /**
> > * pm_wakeup_pending - Check if power transition in progress should be aborted.
> > *
> > @@ -671,6 +696,10 @@ bool pm_wakeup_pending(void)
> > events_check_enabled = !ret;
> > }
> > spin_unlock_irqrestore(&events_lock, flags);
> > +
> > + if (ret)
> > + print_active_wakeup_sources();
> > +
> > return ret;
> > }
>
> There is no way this or equivalent can go into v3.6. It may go into v3.7,
> but there's a plenty of time for that.
Sounds fine, thanks.
>
> Thanks,
> Rafael
Todd
next prev parent reply other threads:[~2012-07-20 1:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-18 18:51 [PATCH] PM / Sleep: Print name of wakeup source that aborts suspend Todd Poynor
2012-07-18 19:47 ` Rafael J. Wysocki
2012-07-20 1:00 ` Todd Poynor [this message]
2012-07-20 9:55 ` 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=20120720010019.GA15701@google.com \
--to=toddpoynor@google.com \
--cc=arve@android.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@sisk.pl \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.