Re: [PATCH] PM / runtime: Rework pm_runtime_force_suspend/resume()

2018-01-03 Thread Rafael J. Wysocki
On Wednesday, January 3, 2018 12:21:36 AM CET Rafael J. Wysocki wrote: > On Tue, Jan 2, 2018 at 8:07 PM, Rafael J. Wysocki wrote: > > On Tuesday, January 2, 2018 2:04:04 PM CET Lukas Wunner wrote: > >> On Tue, Jan 02, 2018 at 12:02:18PM +0100, Rafael J. Wysocki wrote: > >> >

Re: [PATCH] PM / runtime: Rework pm_runtime_force_suspend/resume()

2018-01-03 Thread Rafael J. Wysocki
On Wednesday, January 3, 2018 12:21:36 AM CET Rafael J. Wysocki wrote: > On Tue, Jan 2, 2018 at 8:07 PM, Rafael J. Wysocki wrote: > > On Tuesday, January 2, 2018 2:04:04 PM CET Lukas Wunner wrote: > >> On Tue, Jan 02, 2018 at 12:02:18PM +0100, Rafael J. Wysocki wrote: > >> > On Tue, Jan 2, 2018

Re: [PATCH] PM / runtime: Rework pm_runtime_force_suspend/resume()

2018-01-02 Thread Rafael J. Wysocki
On Tue, Jan 2, 2018 at 8:07 PM, Rafael J. Wysocki wrote: > On Tuesday, January 2, 2018 2:04:04 PM CET Lukas Wunner wrote: >> On Tue, Jan 02, 2018 at 12:02:18PM +0100, Rafael J. Wysocki wrote: >> > On Tue, Jan 2, 2018 at 11:51 AM, Lukas Wunner wrote: >> > > On

Re: [PATCH] PM / runtime: Rework pm_runtime_force_suspend/resume()

2018-01-02 Thread Rafael J. Wysocki
On Tue, Jan 2, 2018 at 8:07 PM, Rafael J. Wysocki wrote: > On Tuesday, January 2, 2018 2:04:04 PM CET Lukas Wunner wrote: >> On Tue, Jan 02, 2018 at 12:02:18PM +0100, Rafael J. Wysocki wrote: >> > On Tue, Jan 2, 2018 at 11:51 AM, Lukas Wunner wrote: >> > > On Tue, Jan 02, 2018 at 01:56:28AM

Re: [PATCH] PM / runtime: Rework pm_runtime_force_suspend/resume()

2018-01-02 Thread Rafael J. Wysocki
On Tuesday, January 2, 2018 2:04:04 PM CET Lukas Wunner wrote: > On Tue, Jan 02, 2018 at 12:02:18PM +0100, Rafael J. Wysocki wrote: > > On Tue, Jan 2, 2018 at 11:51 AM, Lukas Wunner wrote: > > > On Tue, Jan 02, 2018 at 01:56:28AM +0100, Rafael J. Wysocki wrote: > > >> + if

Re: [PATCH] PM / runtime: Rework pm_runtime_force_suspend/resume()

2018-01-02 Thread Rafael J. Wysocki
On Tuesday, January 2, 2018 2:04:04 PM CET Lukas Wunner wrote: > On Tue, Jan 02, 2018 at 12:02:18PM +0100, Rafael J. Wysocki wrote: > > On Tue, Jan 2, 2018 at 11:51 AM, Lukas Wunner wrote: > > > On Tue, Jan 02, 2018 at 01:56:28AM +0100, Rafael J. Wysocki wrote: > > >> + if

Re: [PATCH] PM / runtime: Rework pm_runtime_force_suspend/resume()

2018-01-02 Thread Lukas Wunner
On Tue, Jan 02, 2018 at 12:02:18PM +0100, Rafael J. Wysocki wrote: > On Tue, Jan 2, 2018 at 11:51 AM, Lukas Wunner wrote: > > On Tue, Jan 02, 2018 at 01:56:28AM +0100, Rafael J. Wysocki wrote: > >> + if (atomic_read(>power.usage_count) <= 1 && > >> +

Re: [PATCH] PM / runtime: Rework pm_runtime_force_suspend/resume()

2018-01-02 Thread Lukas Wunner
On Tue, Jan 02, 2018 at 12:02:18PM +0100, Rafael J. Wysocki wrote: > On Tue, Jan 2, 2018 at 11:51 AM, Lukas Wunner wrote: > > On Tue, Jan 02, 2018 at 01:56:28AM +0100, Rafael J. Wysocki wrote: > >> + if (atomic_read(>power.usage_count) <= 1 && > >> + atomic_read(>power.child_count) ==

Re: [PATCH] PM / runtime: Rework pm_runtime_force_suspend/resume()

2018-01-02 Thread Rafael J. Wysocki
On Tue, Jan 2, 2018 at 12:02 PM, Rafael J. Wysocki wrote: > On Tue, Jan 2, 2018 at 11:51 AM, Lukas Wunner wrote: >> On Tue, Jan 02, 2018 at 01:56:28AM +0100, Rafael J. Wysocki wrote: [cut] > >> One addition that would be really helpful:

Re: [PATCH] PM / runtime: Rework pm_runtime_force_suspend/resume()

2018-01-02 Thread Rafael J. Wysocki
On Tue, Jan 2, 2018 at 12:02 PM, Rafael J. Wysocki wrote: > On Tue, Jan 2, 2018 at 11:51 AM, Lukas Wunner wrote: >> On Tue, Jan 02, 2018 at 01:56:28AM +0100, Rafael J. Wysocki wrote: [cut] > >> One addition that would be really helpful: pm_runtime_force_suspend() >> should also force-suspend

Re: [PATCH] PM / runtime: Rework pm_runtime_force_suspend/resume()

2018-01-02 Thread Rafael J. Wysocki
On Tue, Jan 2, 2018 at 11:51 AM, Lukas Wunner wrote: > On Tue, Jan 02, 2018 at 01:56:28AM +0100, Rafael J. Wysocki wrote: >> + if (atomic_read(>power.usage_count) <= 1 && >> + atomic_read(>power.child_count) == 0) >> + pm_runtime_set_suspended(dev); >> >>

Re: [PATCH] PM / runtime: Rework pm_runtime_force_suspend/resume()

2018-01-02 Thread Rafael J. Wysocki
On Tue, Jan 2, 2018 at 11:51 AM, Lukas Wunner wrote: > On Tue, Jan 02, 2018 at 01:56:28AM +0100, Rafael J. Wysocki wrote: >> + if (atomic_read(>power.usage_count) <= 1 && >> + atomic_read(>power.child_count) == 0) >> + pm_runtime_set_suspended(dev); >> >> -

Re: [PATCH] PM / runtime: Rework pm_runtime_force_suspend/resume()

2018-01-02 Thread Lukas Wunner
On Tue, Jan 02, 2018 at 01:56:28AM +0100, Rafael J. Wysocki wrote: > + if (atomic_read(>power.usage_count) <= 1 && > + atomic_read(>power.child_count) == 0) > + pm_runtime_set_suspended(dev); > > - pm_runtime_set_suspended(dev); The ->runtime_suspend callback *has*

Re: [PATCH] PM / runtime: Rework pm_runtime_force_suspend/resume()

2018-01-02 Thread Lukas Wunner
On Tue, Jan 02, 2018 at 01:56:28AM +0100, Rafael J. Wysocki wrote: > + if (atomic_read(>power.usage_count) <= 1 && > + atomic_read(>power.child_count) == 0) > + pm_runtime_set_suspended(dev); > > - pm_runtime_set_suspended(dev); The ->runtime_suspend callback *has*

[PATCH] PM / runtime: Rework pm_runtime_force_suspend/resume()

2018-01-01 Thread Rafael J. Wysocki
From: Rafael J. Wysocki One of the limitations of pm_runtime_force_suspend/resume() is that if a parent driver wants to use these functions, all of its child drivers have to do that too because of the parent usage counter manipulations necessary to get the correct

[PATCH] PM / runtime: Rework pm_runtime_force_suspend/resume()

2018-01-01 Thread Rafael J. Wysocki
From: Rafael J. Wysocki One of the limitations of pm_runtime_force_suspend/resume() is that if a parent driver wants to use these functions, all of its child drivers have to do that too because of the parent usage counter manipulations necessary to get the correct state of the parent during