Re: [RFC PATCH] pm: prevent suspend until power supply events are processed

2014-09-09 Thread Todd Poynor
On Wed, Sep 3, 2014 at 9:53 PM, Viresh Kumar wrote: > On 4 September 2014 10:21, Viresh Kumar wrote: >> + /* dependent power supplies (e.g. battery) may have changed >> +* state as a result of this event, so poll again and hold >> +* the wakeup_source until

Re: [RFC PATCH] pm: prevent suspend until power supply events are processed

2014-09-09 Thread Todd Poynor
On Thu, Sep 4, 2014 at 9:37 AM, Tc, Jenny wrote: > If the intention is to prevent suspend while processing the power supply > uevents, > Isn't it a good option to use EPOLLWAKEUP? In Android, it's already used by > healthd to achieve the same. It's a good idea for the userspace handler of the

Re: [RFC PATCH] pm: prevent suspend until power supply events are processed

2014-09-09 Thread Todd Poynor
On Thu, Sep 4, 2014 at 9:37 AM, Tc, Jenny jenny...@intel.com wrote: If the intention is to prevent suspend while processing the power supply uevents, Isn't it a good option to use EPOLLWAKEUP? In Android, it's already used by healthd to achieve the same. It's a good idea for the userspace

Re: [RFC PATCH] pm: prevent suspend until power supply events are processed

2014-09-09 Thread Todd Poynor
On Wed, Sep 3, 2014 at 9:53 PM, Viresh Kumar viresh.ku...@linaro.org wrote: On 4 September 2014 10:21, Viresh Kumar viresh.ku...@linaro.org wrote: + /* dependent power supplies (e.g. battery) may have changed +* state as a result of this event, so poll again and hold +

RE: [RFC PATCH] pm: prevent suspend until power supply events are processed

2014-09-04 Thread Tc, Jenny
If the intention is to prevent suspend while processing the power supply uevents, Isn't it a good option to use EPOLLWAKEUP? In Android, it's already used by healthd to achieve the same. -Jenny > Subject: Re: [RFC PATCH] pm: prevent suspend until power supply events are > processed >

RE: [RFC PATCH] pm: prevent suspend until power supply events are processed

2014-09-04 Thread Tc, Jenny
If the intention is to prevent suspend while processing the power supply uevents, Isn't it a good option to use EPOLLWAKEUP? In Android, it's already used by healthd to achieve the same. -Jenny Subject: Re: [RFC PATCH] pm: prevent suspend until power supply events are processed On 4

Re: [RFC PATCH] pm: prevent suspend until power supply events are processed

2014-09-03 Thread Viresh Kumar
On 4 September 2014 10:21, Viresh Kumar wrote: >>> >> + /* dependent power supplies (e.g. battery) may have changed >>> >> +* state as a result of this event, so poll again and hold >>> >> +* the wakeup_source until all events are processed. >>> >> +*/ But isn't

Re: [RFC PATCH] pm: prevent suspend until power supply events are processed

2014-09-03 Thread Viresh Kumar
Thanks for your quick reply :) On 4 September 2014 00:43, Zoran Markovic wrote: > Note that power_supply_changed_work() could race with > power_supply_changed(), as well as with itself. You could theoretically run > power_supply_changed() several times and queue several >

Re: [RFC PATCH] pm: prevent suspend until power supply events are processed

2014-09-03 Thread Viresh Kumar
Thanks for your quick reply :) On 4 September 2014 00:43, Zoran Markovic zrn.marko...@gmail.com wrote: Note that power_supply_changed_work() could race with power_supply_changed(), as well as with itself. You could theoretically run power_supply_changed() several times and queue several

Re: [RFC PATCH] pm: prevent suspend until power supply events are processed

2014-09-03 Thread Viresh Kumar
On 4 September 2014 10:21, Viresh Kumar viresh.ku...@linaro.org wrote: + /* dependent power supplies (e.g. battery) may have changed +* state as a result of this event, so poll again and hold +* the wakeup_source until all events are processed. +*/ But isn't

Re: [RFC PATCH] pm: prevent suspend until power supply events are processed

2014-09-02 Thread Viresh Kumar
On Wed, Sep 3, 2014 at 10:09 AM, Viresh Kumar wrote: > Don't have Zoran's new email address, but probably other might have > answers to my queries. Got Zoran's email id finally :) > I have just started with the power-supply framework a day or two back > and so my understanding might not be good

Re: [RFC PATCH] pm: prevent suspend until power supply events are processed

2014-09-02 Thread Viresh Kumar
Don't have Zoran's new email address, but probably other might have answers to my queries. I have just started with the power-supply framework a day or two back and so my understanding might not be good enough :) On Sat, Aug 3, 2013 at 2:08 AM, Zoran Markovic wrote: > diff --git

Re: [RFC PATCH] pm: prevent suspend until power supply events are processed

2014-09-02 Thread Viresh Kumar
Don't have Zoran's new email address, but probably other might have answers to my queries. I have just started with the power-supply framework a day or two back and so my understanding might not be good enough :) On Sat, Aug 3, 2013 at 2:08 AM, Zoran Markovic zoran.marko...@linaro.org wrote:

Re: [RFC PATCH] pm: prevent suspend until power supply events are processed

2014-09-02 Thread Viresh Kumar
On Wed, Sep 3, 2014 at 10:09 AM, Viresh Kumar viresh.ku...@linaro.org wrote: Don't have Zoran's new email address, but probably other might have answers to my queries. Got Zoran's email id finally :) I have just started with the power-supply framework a day or two back and so my

Re: [RFC PATCH] pm: prevent suspend until power supply events are processed

2013-08-27 Thread Anton Vorontsov
On Fri, Aug 02, 2013 at 01:38:02PM -0700, Zoran Markovic wrote: > This patch, originally authored by Arve Hjonnevag and Todd Poynor, > prevents the system from entering suspend mode until the power > supply plug, unplug, or any other change of state event is fully > processed. This guarantees that

Re: [RFC PATCH] pm: prevent suspend until power supply events are processed

2013-08-27 Thread Anton Vorontsov
On Fri, Aug 02, 2013 at 01:38:02PM -0700, Zoran Markovic wrote: This patch, originally authored by Arve Hjonnevag and Todd Poynor, prevents the system from entering suspend mode until the power supply plug, unplug, or any other change of state event is fully processed. This guarantees that the

Re: [RFC PATCH] pm: prevent suspend until power supply events are processed

2013-08-22 Thread Zoran Markovic
Any opinions on this patch? Regards, Zoran On 2 August 2013 13:38, Zoran Markovic wrote: > This patch, originally authored by Arve Hjonnevag and Todd Poynor, > prevents the system from entering suspend mode until the power > supply plug, unplug, or any other change of state event is fully >

Re: [RFC PATCH] pm: prevent suspend until power supply events are processed

2013-08-22 Thread Zoran Markovic
Any opinions on this patch? Regards, Zoran On 2 August 2013 13:38, Zoran Markovic zoran.marko...@linaro.org wrote: This patch, originally authored by Arve Hjonnevag and Todd Poynor, prevents the system from entering suspend mode until the power supply plug, unplug, or any other change of state