Re: [PATCH ver. 2] PM: add synchronous runtime interface for interrupt handlers

2010-11-24 Thread Alan Stern
On Tue, 23 Nov 2010, Rafael J. Wysocki wrote: Or maybe you think that when pm_runtime_put_sync detects the usage_count has decremented to 0 and the device is irq-safe, it should call rpm_suspend directly instead of calling rpm_idle? That also would work for me, actually. Okay, then

Re: [PATCH ver. 2] PM: add synchronous runtime interface for interrupt handlers

2010-11-24 Thread Alan Stern
On Tue, 23 Nov 2010, Kevin Hilman wrote: While I like the idea of the symmetry of having both _get_sync() and _put_sync() callable from an interrupt handler, I can't currently think of a situation where we would need to _put_sync() in the ISR. A standard _put() should suffice for all cases I

Re: [PATCH ver. 2] PM: add synchronous runtime interface for interrupt handlers

2010-11-24 Thread Kevin Hilman
Alan Stern st...@rowland.harvard.edu writes: On Tue, 23 Nov 2010, Kevin Hilman wrote: While I like the idea of the symmetry of having both _get_sync() and _put_sync() callable from an interrupt handler, I can't currently think of a situation where we would need to _put_sync() in the ISR. A

Re: [PATCH ver. 2] PM: add synchronous runtime interface for interrupt handlers

2010-11-24 Thread Rafael J. Wysocki
On Wednesday, November 24, 2010, Alan Stern wrote: On Tue, 23 Nov 2010, Rafael J. Wysocki wrote: Or maybe you think that when pm_runtime_put_sync detects the usage_count has decremented to 0 and the device is irq-safe, it should call rpm_suspend directly instead of calling rpm_idle?

Re: [PATCH ver. 2] PM: add synchronous runtime interface for interrupt handlers

2010-11-23 Thread Rafael J. Wysocki
On Tuesday, November 23, 2010, Alan Stern wrote: On Tue, 23 Nov 2010, Rafael J. Wysocki wrote: Moreover, I'm not sure if we need an IRQ safe version of _idle. Why do we need it, exactly? Because pm_runtime_put_sync() calls rpm_idle(). If there were no irq-safe version

Re: [PATCH ver. 2] PM: add synchronous runtime interface for interrupt handlers

2010-11-23 Thread Kevin Hilman
Rafael J. Wysocki r...@sisk.pl writes: On Tuesday, November 23, 2010, Alan Stern wrote: On Tue, 23 Nov 2010, Rafael J. Wysocki wrote: Moreover, I'm not sure if we need an IRQ safe version of _idle. Why do we need it, exactly? Because pm_runtime_put_sync() calls

Re: [PATCH ver. 2] PM: add synchronous runtime interface for interrupt handlers

2010-11-22 Thread Alan Stern
On Mon, 22 Nov 2010, Rafael J. Wysocki wrote: I didn't like this change before and I still don't like it. Quite frankly, I'm not sure I can convince Linus to pull it. :-) Why don't we simply execute the callback under the spinlock in the IRQ safe case? Because it

Re: [PATCH ver. 2] PM: add synchronous runtime interface for interrupt handlers

2010-11-22 Thread Rafael J. Wysocki
On Monday, November 22, 2010, Alan Stern wrote: On Mon, 22 Nov 2010, Rafael J. Wysocki wrote: I didn't like this change before and I still don't like it. Quite frankly, I'm not sure I can convince Linus to pull it. :-) Why don't we simply execute the callback under the

Re: [PATCH ver. 2] PM: add synchronous runtime interface for interrupt handlers

2010-11-22 Thread Alan Stern
On Tue, 23 Nov 2010, Rafael J. Wysocki wrote: Moreover, I'm not sure if we need an IRQ safe version of _idle. Why do we need it, exactly? Because pm_runtime_put_sync() calls rpm_idle(). If there were no irq-safe version of rpm_idle() then drivers wouldn't be able to call

Re: [PATCH ver. 2] PM: add synchronous runtime interface for interrupt handlers

2010-11-21 Thread Rafael J. Wysocki
On Saturday, November 20, 2010, Alan Stern wrote: On Sat, 20 Nov 2010, Rafael J. Wysocki wrote: On Friday, November 19, 2010, Alan Stern wrote: This patch (as1431b) makes the synchronous runtime-PM interface suitable for use in interrupt handlers. Subsystems can call the new

Re: [PATCH ver. 2] PM: add synchronous runtime interface for interrupt handlers

2010-11-20 Thread Rafael J. Wysocki
On Friday, November 19, 2010, Alan Stern wrote: This patch (as1431b) makes the synchronous runtime-PM interface suitable for use in interrupt handlers. Subsystems can call the new pm_runtime_irq_safe() function to tell the PM core that a device's runtime-PM callbacks should be invoked with

Re: [PATCH ver. 2] PM: add synchronous runtime interface for interrupt handlers

2010-11-20 Thread Alan Stern
On Sat, 20 Nov 2010, Rafael J. Wysocki wrote: On Friday, November 19, 2010, Alan Stern wrote: This patch (as1431b) makes the synchronous runtime-PM interface suitable for use in interrupt handlers. Subsystems can call the new pm_runtime_irq_safe() function to tell the PM core that a