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:	Mon, 9 Mar 2015 08:09:09 -0700
From:	Tony Lindgren <tony@...mide.com>
To:	Alan Stern <stern@...land.harvard.edu>
Cc:	"Rafael J. Wysocki" <rjw@...ysocki.net>,
	"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
	Andreas Fenkart <afenkart@...il.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Felipe Balbi <balbi@...com>,
	Huiquan Zhong <huiquan.zhong@...el.com>,
	Kevin Hilman <khilman@...nel.org>, NeilBrown <neilb@...e.de>,
	Mika Westerberg <mika.westerberg@...ux.intel.com>,
	Nishanth Menon <nm@...com>,
	Peter Hurley <peter@...leysoftware.com>,
	Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
	Ulf Hansson <ulf.hansson@...aro.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	linux-kernel@...r.kernel.org, linux-serial@...r.kernel.org,
	linux-omap@...r.kernel.org,
	Linux PM list <linux-pm@...r.kernel.org>
Subject: Re: [PATCH 1/4] PM / Wakeirq: Add minimal device wakeirq helper
 functions

* Alan Stern <stern@...land.harvard.edu> [150308 08:41]:
> On Fri, 6 Mar 2015, Tony Lindgren wrote:
> 
> > > > I'll verify again, but I believe the issue was that without doing
> > > > mark_last_busy here the device falls back asleep right away.
> 
> As it should.  If you don't increment the usage counter (for example, 
> by calling pm_runtime_get instead of pm_request_resume) and you don't 
> update last_busy then you are telling the PM core that the device 
> currently isn't busy and it hasn't been in use since the last time it 
> was suspended.  Under those circumstances, the PM core is _supposed_ to 
> suspend the device right away.

OK so it's a feature then.
 
> > > > That probably should be fixed in pm_runtime in general if that's
> > > > the case.
> > > 
> > > It's up to the subsystem to handle this.  For example, the USB 
> > > subsystem's runtime-resume routine calls pm_runtime_mark_last_busy.
> > 
> > Hmm.. OK thanks this probably explains why pm_request_resume() did
> > not work.
> > 
> > For omaps, I could call this from the interconnect related code,
> > but then how dow we deal with the subsystems that don't call it?
> 
> Start by determining _why_ they don't call it.  Maybe they have a good 
> reason.  If they don't then fix them.

Yes I'll check, it's just probably because the drivers have been
calling it instead.
 
> > > > Considering the above, should we add a new function something like
> > > > pm_resume_complete() that does not need irq_safe set but does
> > > > not return until the device has completed resume?
> > > 
> > > That doesn't make sense.  You're asking for a routine that is allowed
> > > to sleep but can safely be called in interrupt context.
> > 
> > Oh it naturally would not work in irq context, it's for the bottom
> > half again.
> 
> In other words, you're suggesting we add a function that runs in 
> process context and doesn't return until the device is fully resumed?  
> That's exactly what pm_runtime_resume does right now.

But doesn't it only wait for completion if the driver is marked with
pm_runtime_irq_safe()?
 
> >  But I'll take a look if we can just call
> > pm_request_resume() and disable_irq() on the wakeirq in without
> > waiting for the device driver runtime_suspend to disable the wakeirq.
> > That would minimize the interface to just dev_pm_request_wakeirq()
> > and dev_pm_free_wakeirq().
> 
> Will that be acceptable in systems with shared IRQ lines?

Not without us keeping track of when the wakeirq is enabled or
disabled :)

Regards,

Tony
--
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