lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 19 Jul 2012 18:00:19 -0700
From:	Todd Poynor <toddpoynor@...gle.com>
To:	"Rafael J. Wysocki" <rjw@...k.pl>
Cc:	linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
	arve@...roid.com
Subject: Re: [PATCH] PM / Sleep: Print name of wakeup source that aborts
 suspend

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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ