Re: [PATCH 2/5] PM / Wakeirq: Add automated device wake IRQ handling

From: Felipe Balbi
Date: Thu May 14 2015 - 17:27:57 EST


Hi,

On Thu, May 14, 2015 at 02:15:01PM -0700, Tony Lindgren wrote:
> * Tony Lindgren <tony@xxxxxxxxxxx> [150514 09:01]:
> > * Felipe Balbi <balbi@xxxxxx> [150513 19:09]:
> > > > +void dev_pm_enable_wake_irq(struct device *dev)
> > > > +{
> > > > + struct wake_irq *wirq = dev->power.wakeirq;
> > > > +
> > > > + if (wirq && wirq->manage_irq)
> > > > + enable_irq(wirq->irq);
> > > > +}
> > > > +EXPORT_SYMBOL_GPL(dev_pm_enable_wake_irq);
> > >
> > > you probably want to enable dev_pm_enable_wake_irq() automatically for
> > > from rpm_suspend(). According to runtime_pm documentation, wakeup should
> > > always be enabled for runtime suspended devices. I didn't really look
> > > through the whole thing yet to know if you did call it or not.
> >
> > Yes I think we can also automate that part, I've been playing with an
> > additional patch doing that for pm runtime. Been still thinking if
> > there's any need to manage that in the consomer driver, I guess not.
>
> Here's what that would roughly look and now I also remember why
> I did not include it. It adds currently extra checks also for
> devices not using dedicated wakeirqs. But basically this would
> allow leaving out the enable/disable PM runtime calls from drivers.

hey cool, the only requirement now is that drivers attach and detach
wakeirq :-)

--
balbi

Attachment: signature.asc
Description: Digital signature