[PATCH 0/3] irq / PM: wakeup interrupt interface for drivers (was: Re: [RFC][PATCH] irq: Rework IRQF_NO_SUSPENDED)

2014-07-30 Thread Rafael J. Wysocki
On Tuesday, July 29, 2014 03:33:23 PM Rafael J. Wysocki wrote: > On Tuesday, July 29, 2014 02:46:41 PM Thomas Gleixner wrote: > > On Tue, 29 Jul 2014, Rafael J. Wysocki wrote: > > > > > On Monday, July 28, 2014 11:53:15 PM Rafael J. Wysocki wrote: > > > > On Monday, July 28, 2014 02:33:41 PM Thoma

Re: [RFC][PATCH] irq: Rework IRQF_NO_SUSPENDED

2014-07-29 Thread Brian Norris
On Tue, Jul 29, 2014 at 09:28:43PM +0200, Peter Zijlstra wrote: > On Tue, Jul 29, 2014 at 12:20:08PM -0700, Brian Norris wrote: > > > I'm curious what you mean. Are you referring to the fact that its input > > is simply an IRQ number (regardless of whether the IRQ is shared), not > > something tha

Re: [RFC][PATCH] irq: Rework IRQF_NO_SUSPENDED

2014-07-29 Thread Peter Zijlstra
On Tue, Jul 29, 2014 at 12:20:08PM -0700, Brian Norris wrote: > I'm curious what you mean. Are you referring to the fact that its input > is simply an IRQ number (regardless of whether the IRQ is shared), not > something that identifies the particular handler (e.g., struct > irqaction)? Yes. I kn

Re: [RFC][PATCH] irq: Rework IRQF_NO_SUSPENDED

2014-07-29 Thread Brian Norris
Hi Peter, On Fri, Jul 25, 2014 at 07:58:47AM +0200, Peter Zijlstra wrote: > On Fri, Jul 25, 2014 at 01:10:36AM +0200, Rafael J. Wysocki wrote: > > Yes, drivers using enable_irq_wake() will likely want IRQF_NO_SUSPEND to > > be set for their irqactions, but that should not imply "no suspend" for >

Re: [RFC][PATCH] irq: Rework IRQF_NO_SUSPENDED

2014-07-29 Thread Rafael J. Wysocki
On Tuesday, July 29, 2014 02:46:41 PM Thomas Gleixner wrote: > On Tue, 29 Jul 2014, Rafael J. Wysocki wrote: > > > On Monday, July 28, 2014 11:53:15 PM Rafael J. Wysocki wrote: > > > On Monday, July 28, 2014 02:33:41 PM Thomas Gleixner wrote: > > > > On Mon, 28 Jul 2014, Peter Zijlstra wrote: > >

Re: [RFC][PATCH] irq: Rework IRQF_NO_SUSPENDED

2014-07-29 Thread Thomas Gleixner
On Tue, 29 Jul 2014, Rafael J. Wysocki wrote: > On Monday, July 28, 2014 11:53:15 PM Rafael J. Wysocki wrote: > > On Monday, July 28, 2014 02:33:41 PM Thomas Gleixner wrote: > > > On Mon, 28 Jul 2014, Peter Zijlstra wrote: > > > > On Sat, Jul 26, 2014 at 01:49:17PM +0200, Rafael J. Wysocki wrote:

Re: [RFC][PATCH] irq: Rework IRQF_NO_SUSPENDED

2014-07-28 Thread Rafael J. Wysocki
On Monday, July 28, 2014 11:53:15 PM Rafael J. Wysocki wrote: > On Monday, July 28, 2014 02:33:41 PM Thomas Gleixner wrote: > > On Mon, 28 Jul 2014, Peter Zijlstra wrote: > > > On Sat, Jul 26, 2014 at 01:49:17PM +0200, Rafael J. Wysocki wrote: [cut] > > So we are not going to make everything a si

Re: [RFC][PATCH] irq: Rework IRQF_NO_SUSPENDED

2014-07-28 Thread Rafael J. Wysocki
On Monday, July 28, 2014 02:33:41 PM Thomas Gleixner wrote: > On Mon, 28 Jul 2014, Peter Zijlstra wrote: > > On Sat, Jul 26, 2014 at 01:49:17PM +0200, Rafael J. Wysocki wrote: > > > One more idea, on top of the prototype patch that I posted > > > (https://patchwork.kernel.org/patch/4625921/). > > >

Re: [RFC][PATCH] irq: Rework IRQF_NO_SUSPENDED

2014-07-28 Thread Rafael J. Wysocki
On Monday, July 28, 2014 08:49:13 AM Peter Zijlstra wrote: > On Sat, Jul 26, 2014 at 01:49:17PM +0200, Rafael J. Wysocki wrote: > > One more idea, on top of the prototype patch that I posted > > (https://patchwork.kernel.org/patch/4625921/). > > > > The problem with enable_irq_wake() is that it on

Re: [RFC][PATCH] irq: Rework IRQF_NO_SUSPENDED

2014-07-28 Thread Peter Zijlstra
On Mon, Jul 28, 2014 at 02:33:41PM +0200, Thomas Gleixner wrote: > > I realize its dynamic, but that's crap, at device registration time it > > pretty much already knows if its a wakeup source or not, right? > > It does, but that doesn't make it crap. There are situations where you > want certain

Re: [RFC][PATCH] irq: Rework IRQF_NO_SUSPENDED

2014-07-28 Thread Thomas Gleixner
On Mon, 28 Jul 2014, Peter Zijlstra wrote: > On Sat, Jul 26, 2014 at 01:49:17PM +0200, Rafael J. Wysocki wrote: > > One more idea, on top of the prototype patch that I posted > > (https://patchwork.kernel.org/patch/4625921/). > > > > The problem with enable_irq_wake() is that it only takes one arg

Re: [RFC][PATCH] irq: Rework IRQF_NO_SUSPENDED

2014-07-27 Thread Peter Zijlstra
On Sat, Jul 26, 2014 at 01:49:17PM +0200, Rafael J. Wysocki wrote: > One more idea, on top of the prototype patch that I posted > (https://patchwork.kernel.org/patch/4625921/). > > The problem with enable_irq_wake() is that it only takes one argument, so > if that's a shared interrupt, we can't re

Re: [RFC][PATCH] irq: Rework IRQF_NO_SUSPENDED

2014-07-27 Thread Rafael J. Wysocki
On Saturday, July 26, 2014 12:25:29 AM Rafael J. Wysocki wrote: > On Friday, July 25, 2014 11:00:12 PM Thomas Gleixner wrote: > > On Fri, 25 Jul 2014, Rafael J. Wysocki wrote: > > > On Friday, July 25, 2014 03:25:41 PM Peter Zijlstra wrote: > > > > OK, so Rafael said there's devices that keep on ra

Re: [RFC][PATCH] irq: Rework IRQF_NO_SUSPENDED

2014-07-26 Thread Rafael J. Wysocki
On Saturday, July 26, 2014 01:49:17 PM Rafael J. Wysocki wrote: > On Saturday, July 26, 2014 12:25:29 AM Rafael J. Wysocki wrote: > > On Friday, July 25, 2014 11:00:12 PM Thomas Gleixner wrote: > > > On Fri, 25 Jul 2014, Rafael J. Wysocki wrote: > > > > On Friday, July 25, 2014 03:25:41 PM Peter Zi

Re: [RFC][PATCH] irq: Rework IRQF_NO_SUSPENDED

2014-07-26 Thread Rafael J. Wysocki
On Saturday, July 26, 2014 12:25:29 AM Rafael J. Wysocki wrote: > On Friday, July 25, 2014 11:00:12 PM Thomas Gleixner wrote: > > On Fri, 25 Jul 2014, Rafael J. Wysocki wrote: > > > On Friday, July 25, 2014 03:25:41 PM Peter Zijlstra wrote: > > > > OK, so Rafael said there's devices that keep on ra

Re: [RFC][PATCH] irq: Rework IRQF_NO_SUSPENDED

2014-07-25 Thread Rafael J. Wysocki
On Saturday, July 26, 2014 12:25:29 AM Rafael J. Wysocki wrote: > On Friday, July 25, 2014 11:00:12 PM Thomas Gleixner wrote: > > On Fri, 25 Jul 2014, Rafael J. Wysocki wrote: > > > On Friday, July 25, 2014 03:25:41 PM Peter Zijlstra wrote: > > > > OK, so Rafael said there's devices that keep on ra

Re: [RFC][PATCH] irq: Rework IRQF_NO_SUSPENDED

2014-07-25 Thread Rafael J. Wysocki
On Friday, July 25, 2014 11:00:12 PM Thomas Gleixner wrote: > On Fri, 25 Jul 2014, Rafael J. Wysocki wrote: > > On Friday, July 25, 2014 03:25:41 PM Peter Zijlstra wrote: > > > OK, so Rafael said there's devices that keep on raising their interrupt > > > until they get attention. Ideally this won't

Re: [RFC][PATCH] irq: Rework IRQF_NO_SUSPENDED

2014-07-25 Thread Thomas Gleixner
On Fri, 25 Jul 2014, Rafael J. Wysocki wrote: > On Friday, July 25, 2014 03:25:41 PM Peter Zijlstra wrote: > > OK, so Rafael said there's devices that keep on raising their interrupt > > until they get attention. Ideally this won't happen because the device > > is suspended etc.. But I'm sure there

Re: [RFC][PATCH] irq: Rework IRQF_NO_SUSPENDED

2014-07-25 Thread Peter Zijlstra
On Fri, Jul 25, 2014 at 07:03:38PM +0200, Rafael J. Wysocki wrote: > So here's an idea. > > What about returning IRQ_NONE rather than IRQ_HANDLED for "suspended" > interrupts (after all, that's what a sane driver would do for a > suspended device I suppose)? > > If the line is really shared and t

Re: [RFC][PATCH] irq: Rework IRQF_NO_SUSPENDED

2014-07-25 Thread Rafael J. Wysocki
On Friday, July 25, 2014 03:25:41 PM Peter Zijlstra wrote: > On Fri, Jul 25, 2014 at 02:40:37PM +0200, Peter Zijlstra wrote: > > On Fri, Jul 25, 2014 at 11:40:48AM +0200, Thomas Gleixner wrote: > > > On Thu, 24 Jul 2014, Peter Zijlstra wrote: > > > > @@ -29,14 +29,20 @@ void suspend_device_irqs(voi

Re: [RFC][PATCH] irq: Rework IRQF_NO_SUSPENDED

2014-07-25 Thread Thomas Gleixner
On Fri, 25 Jul 2014, Rafael J. Wysocki wrote: > If the face of your remark about the level-triggered interrupts that's all > moot. It's not only level. That you notice right away. But for edge you lose the edge and some devices will wait forever that their irq is handled. Not fun to debug :) Th

Re: [RFC][PATCH] irq: Rework IRQF_NO_SUSPENDED

2014-07-25 Thread Peter Zijlstra
On Fri, Jul 25, 2014 at 02:40:37PM +0200, Peter Zijlstra wrote: > On Fri, Jul 25, 2014 at 11:40:48AM +0200, Thomas Gleixner wrote: > > On Thu, 24 Jul 2014, Peter Zijlstra wrote: > > > @@ -29,14 +29,20 @@ void suspend_device_irqs(void) > > > for_each_irq_desc(irq, desc) { > > > unsigned

Re: [RFC][PATCH] irq: Rework IRQF_NO_SUSPENDED

2014-07-25 Thread Peter Zijlstra
On Fri, Jul 25, 2014 at 02:47:25PM +0200, Rafael J. Wysocki wrote: > So it looks like we really need the "suspend" thing to either disable > the interrupt entirely (in which case all handlers for all actions > will not be invoked after it's been suspended) or leave it enabled > (causing all handler

Re: [RFC][PATCH] irq: Rework IRQF_NO_SUSPENDED

2014-07-25 Thread Peter Zijlstra
On Fri, Jul 25, 2014 at 11:40:48AM +0200, Thomas Gleixner wrote: > On Thu, 24 Jul 2014, Peter Zijlstra wrote: > > @@ -29,14 +29,20 @@ void suspend_device_irqs(void) > > for_each_irq_desc(irq, desc) { > > unsigned long flags; > > > > + /* > > +* Ideally this w

Re: [RFC][PATCH] irq: Rework IRQF_NO_SUSPENDED

2014-07-25 Thread Rafael J. Wysocki
On Friday, July 25, 2014 11:27:25 AM Thomas Gleixner wrote: > On Fri, 25 Jul 2014, Rafael J. Wysocki wrote: > > On Thursday, July 24, 2014 11:26:20 PM Peter Zijlstra wrote: > > > Subject: irq: Rework IRQF_NO_SUSPENDED > > > From: Peter Zijlstra > > > Date: Thu Jul 24 22:34:50 CEST 2014 > > > > >

Re: [RFC][PATCH] irq: Rework IRQF_NO_SUSPENDED

2014-07-25 Thread Rafael J. Wysocki
On Friday, July 25, 2014 11:40:48 AM Thomas Gleixner wrote: > On Thu, 24 Jul 2014, Peter Zijlstra wrote: > > @@ -29,14 +29,20 @@ void suspend_device_irqs(void) > > for_each_irq_desc(irq, desc) { > > unsigned long flags; > > > > + /* > > +* Ideally this would

Re: [RFC][PATCH] irq: Rework IRQF_NO_SUSPENDED

2014-07-25 Thread Thomas Gleixner
On Thu, 24 Jul 2014, Peter Zijlstra wrote: > @@ -29,14 +29,20 @@ void suspend_device_irqs(void) > for_each_irq_desc(irq, desc) { > unsigned long flags; > > + /* > + * Ideally this would be a global state, but we cannot > + * for the trainw

Re: [RFC][PATCH] irq: Rework IRQF_NO_SUSPENDED

2014-07-25 Thread Thomas Gleixner
On Fri, 25 Jul 2014, Rafael J. Wysocki wrote: > On Thursday, July 24, 2014 11:26:20 PM Peter Zijlstra wrote: > > Subject: irq: Rework IRQF_NO_SUSPENDED > > From: Peter Zijlstra > > Date: Thu Jul 24 22:34:50 CEST 2014 > > > > Typically when devices are suspended they're quiesced such that they > >

Re: [RFC][PATCH] irq: Rework IRQF_NO_SUSPENDED

2014-07-24 Thread Peter Zijlstra
On Fri, Jul 25, 2014 at 01:10:36AM +0200, Rafael J. Wysocki wrote: > > There is still enable_irq_wake()/IRQD_WAKEUP_STATE that tries to serve > > a similar purpose but is equially wrecked for shared interrupts, > > ideally this would be removed. > > Let me comment about this particular thing. > >

Re: [RFC][PATCH] irq: Rework IRQF_NO_SUSPENDED

2014-07-24 Thread Rafael J. Wysocki
On Thursday, July 24, 2014 11:26:20 PM Peter Zijlstra wrote: > Subject: irq: Rework IRQF_NO_SUSPENDED > From: Peter Zijlstra > Date: Thu Jul 24 22:34:50 CEST 2014 > > Typically when devices are suspended they're quiesced such that they > will not generate any further interrupts. > > However some

Re: [RFC][PATCH] irq: Rework IRQF_NO_SUSPENDED

2014-07-24 Thread Rafael J. Wysocki
On Thursday, July 24, 2014 11:26:20 PM Peter Zijlstra wrote: > Subject: irq: Rework IRQF_NO_SUSPENDED > From: Peter Zijlstra > Date: Thu Jul 24 22:34:50 CEST 2014 > > Typically when devices are suspended they're quiesced such that they > will not generate any further interrupts. > > However some