Re: [PATCH v2 6/10] cpufreq: Support for fast frequency switching

2016-03-07 Thread Rafael J. Wysocki
On Mon, Mar 7, 2016 at 2:32 PM, Peter Zijlstra wrote: > On Mon, Mar 07, 2016 at 02:15:47PM +0100, Rafael J. Wysocki wrote: >> On Mon, Mar 7, 2016 at 9:00 AM, Peter Zijlstra wrote: > >> > Sure I know all that. But that, to me, seems like an argument for

Re: [PATCH v2 6/10] cpufreq: Support for fast frequency switching

2016-03-07 Thread Rafael J. Wysocki
On Mon, Mar 7, 2016 at 2:32 PM, Peter Zijlstra wrote: > On Mon, Mar 07, 2016 at 02:15:47PM +0100, Rafael J. Wysocki wrote: >> On Mon, Mar 7, 2016 at 9:00 AM, Peter Zijlstra wrote: > >> > Sure I know all that. But that, to me, seems like an argument for why >> > you should have done this a long

Re: [PATCH v2 6/10] cpufreq: Support for fast frequency switching

2016-03-07 Thread Peter Zijlstra
On Mon, Mar 07, 2016 at 02:15:47PM +0100, Rafael J. Wysocki wrote: > On Mon, Mar 7, 2016 at 9:00 AM, Peter Zijlstra wrote: > > Sure I know all that. But that, to me, seems like an argument for why > > you should have done this a long time ago. > > While I generally agree

Re: [PATCH v2 6/10] cpufreq: Support for fast frequency switching

2016-03-07 Thread Peter Zijlstra
On Mon, Mar 07, 2016 at 02:15:47PM +0100, Rafael J. Wysocki wrote: > On Mon, Mar 7, 2016 at 9:00 AM, Peter Zijlstra wrote: > > Sure I know all that. But that, to me, seems like an argument for why > > you should have done this a long time ago. > > While I generally agree with this, I don't

Re: [PATCH v2 6/10] cpufreq: Support for fast frequency switching

2016-03-07 Thread Rafael J. Wysocki
On Mon, Mar 7, 2016 at 9:00 AM, Peter Zijlstra wrote: > On Sun, Mar 06, 2016 at 03:17:09AM +0100, Rafael J. Wysocki wrote: >> > Agreed, fail the stuff hard. >> > >> > Simply make cpufreq_register_notifier a __must_check function and add >> > error handling to all call sites.

Re: [PATCH v2 6/10] cpufreq: Support for fast frequency switching

2016-03-07 Thread Rafael J. Wysocki
On Mon, Mar 7, 2016 at 9:00 AM, Peter Zijlstra wrote: > On Sun, Mar 06, 2016 at 03:17:09AM +0100, Rafael J. Wysocki wrote: >> > Agreed, fail the stuff hard. >> > >> > Simply make cpufreq_register_notifier a __must_check function and add >> > error handling to all call sites. >> >> Quite frankly,

Re: [PATCH v2 6/10] cpufreq: Support for fast frequency switching

2016-03-07 Thread Peter Zijlstra
On Sun, Mar 06, 2016 at 03:17:09AM +0100, Rafael J. Wysocki wrote: > > Agreed, fail the stuff hard. > > > > Simply make cpufreq_register_notifier a __must_check function and add > > error handling to all call sites. > > Quite frankly, I don't see a compelling reason to do anything about > the

Re: [PATCH v2 6/10] cpufreq: Support for fast frequency switching

2016-03-07 Thread Peter Zijlstra
On Sun, Mar 06, 2016 at 03:17:09AM +0100, Rafael J. Wysocki wrote: > > Agreed, fail the stuff hard. > > > > Simply make cpufreq_register_notifier a __must_check function and add > > error handling to all call sites. > > Quite frankly, I don't see a compelling reason to do anything about > the

Re: [PATCH v2 6/10] cpufreq: Support for fast frequency switching

2016-03-05 Thread Rafael J. Wysocki
On Sat, Mar 5, 2016 at 5:49 PM, Peter Zijlstra wrote: > On Sat, Mar 05, 2016 at 12:18:54AM +0100, Rafael J. Wysocki wrote: > >> >>> Even if there are platforms which may change the CPU frequency behind >> >>> cpufreq's back, breaking the transition notifiers, I'm worried

Re: [PATCH v2 6/10] cpufreq: Support for fast frequency switching

2016-03-05 Thread Rafael J. Wysocki
On Sat, Mar 5, 2016 at 5:49 PM, Peter Zijlstra wrote: > On Sat, Mar 05, 2016 at 12:18:54AM +0100, Rafael J. Wysocki wrote: > >> >>> Even if there are platforms which may change the CPU frequency behind >> >>> cpufreq's back, breaking the transition notifiers, I'm worried about the >> >>> addition

Re: [PATCH v2 6/10] cpufreq: Support for fast frequency switching

2016-03-05 Thread Peter Zijlstra
On Sat, Mar 05, 2016 at 12:18:54AM +0100, Rafael J. Wysocki wrote: > >>> Even if there are platforms which may change the CPU frequency behind > >>> cpufreq's back, breaking the transition notifiers, I'm worried about the > >>> addition of an interface which itself breaks them. The platforms

Re: [PATCH v2 6/10] cpufreq: Support for fast frequency switching

2016-03-05 Thread Peter Zijlstra
On Sat, Mar 05, 2016 at 12:18:54AM +0100, Rafael J. Wysocki wrote: > >>> Even if there are platforms which may change the CPU frequency behind > >>> cpufreq's back, breaking the transition notifiers, I'm worried about the > >>> addition of an interface which itself breaks them. The platforms

Re: [PATCH v2 6/10] cpufreq: Support for fast frequency switching

2016-03-05 Thread Ingo Molnar
* Rafael J. Wysocki wrote: > > Honestly I wonder if it's better to just try the "no notifiers with fast > > drivers" approach to start. The notifiers could always be added if platform > > owners complain that they absolutely require them. > > Well, I'm not sure what

Re: [PATCH v2 6/10] cpufreq: Support for fast frequency switching

2016-03-05 Thread Ingo Molnar
* Rafael J. Wysocki wrote: > > Honestly I wonder if it's better to just try the "no notifiers with fast > > drivers" approach to start. The notifiers could always be added if platform > > owners complain that they absolutely require them. > > Well, I'm not sure what happens if we start to

Re: [PATCH v2 6/10] cpufreq: Support for fast frequency switching

2016-03-04 Thread Rafael J. Wysocki
On Sat, Mar 5, 2016 at 12:56 AM, Steve Muckle wrote: > On 03/04/2016 03:18 PM, Rafael J. Wysocki wrote: >> In fact, the mechanism may be relatively simple if I'm not mistaken. >> >> In the "fast switch" case, the governor may spawn a work item that >> will just execute

Re: [PATCH v2 6/10] cpufreq: Support for fast frequency switching

2016-03-04 Thread Rafael J. Wysocki
On Sat, Mar 5, 2016 at 12:56 AM, Steve Muckle wrote: > On 03/04/2016 03:18 PM, Rafael J. Wysocki wrote: >> In fact, the mechanism may be relatively simple if I'm not mistaken. >> >> In the "fast switch" case, the governor may spawn a work item that >> will just execute cpufreq_get() on

Re: [PATCH v2 6/10] cpufreq: Support for fast frequency switching

2016-03-04 Thread Steve Muckle
On 03/04/2016 02:58 PM, Rafael J. Wysocki wrote: >>> How about modifying cpufreq_register_notifier to return an error if the >>> >> driver has a fast_switch callback installed and an attempt to register a >>> >> transition notifier is made? >> > >> > That sounds like a good idea. > > Transition

Re: [PATCH v2 6/10] cpufreq: Support for fast frequency switching

2016-03-04 Thread Steve Muckle
On 03/04/2016 02:58 PM, Rafael J. Wysocki wrote: >>> How about modifying cpufreq_register_notifier to return an error if the >>> >> driver has a fast_switch callback installed and an attempt to register a >>> >> transition notifier is made? >> > >> > That sounds like a good idea. > > Transition

Re: [PATCH v2 6/10] cpufreq: Support for fast frequency switching

2016-03-04 Thread Steve Muckle
On 03/04/2016 03:18 PM, Rafael J. Wysocki wrote: > In fact, the mechanism may be relatively simple if I'm not mistaken. > > In the "fast switch" case, the governor may spawn a work item that > will just execute cpufreq_get() on policy->cpu. That will notice that > policy->cur is different from

Re: [PATCH v2 6/10] cpufreq: Support for fast frequency switching

2016-03-04 Thread Steve Muckle
On 03/04/2016 03:18 PM, Rafael J. Wysocki wrote: > In fact, the mechanism may be relatively simple if I'm not mistaken. > > In the "fast switch" case, the governor may spawn a work item that > will just execute cpufreq_get() on policy->cpu. That will notice that > policy->cur is different from

Re: [PATCH v2 6/10] cpufreq: Support for fast frequency switching

2016-03-04 Thread Rafael J. Wysocki
On Fri, Mar 4, 2016 at 11:40 PM, Rafael J. Wysocki wrote: > On Fri, Mar 4, 2016 at 11:32 PM, Rafael J. Wysocki wrote: >> On Fri, Mar 4, 2016 at 11:18 PM, Steve Muckle >> wrote: >>> On 03/03/2016 07:07 PM, Rafael J. Wysocki wrote:

Re: [PATCH v2 6/10] cpufreq: Support for fast frequency switching

2016-03-04 Thread Rafael J. Wysocki
On Fri, Mar 4, 2016 at 11:40 PM, Rafael J. Wysocki wrote: > On Fri, Mar 4, 2016 at 11:32 PM, Rafael J. Wysocki wrote: >> On Fri, Mar 4, 2016 at 11:18 PM, Steve Muckle >> wrote: >>> On 03/03/2016 07:07 PM, Rafael J. Wysocki wrote: +void cpufreq_driver_fast_switch(struct cpufreq_policy

Re: [PATCH v2 6/10] cpufreq: Support for fast frequency switching

2016-03-04 Thread Rafael J. Wysocki
On Fri, Mar 4, 2016 at 11:32 PM, Rafael J. Wysocki wrote: > On Fri, Mar 4, 2016 at 11:18 PM, Steve Muckle wrote: >> On 03/03/2016 07:07 PM, Rafael J. Wysocki wrote: >>> +void cpufreq_driver_fast_switch(struct cpufreq_policy *policy, >>> +

Re: [PATCH v2 6/10] cpufreq: Support for fast frequency switching

2016-03-04 Thread Rafael J. Wysocki
On Fri, Mar 4, 2016 at 11:32 PM, Rafael J. Wysocki wrote: > On Fri, Mar 4, 2016 at 11:18 PM, Steve Muckle wrote: >> On 03/03/2016 07:07 PM, Rafael J. Wysocki wrote: >>> +void cpufreq_driver_fast_switch(struct cpufreq_policy *policy, >>> + unsigned int target_freq,

Re: [PATCH v2 6/10] cpufreq: Support for fast frequency switching

2016-03-04 Thread Rafael J. Wysocki
On Fri, Mar 4, 2016 at 11:32 PM, Rafael J. Wysocki wrote: > On Fri, Mar 4, 2016 at 11:18 PM, Steve Muckle wrote: >> On 03/03/2016 07:07 PM, Rafael J. Wysocki wrote: >>> +void cpufreq_driver_fast_switch(struct cpufreq_policy *policy, >>> +

Re: [PATCH v2 6/10] cpufreq: Support for fast frequency switching

2016-03-04 Thread Rafael J. Wysocki
On Fri, Mar 4, 2016 at 11:32 PM, Rafael J. Wysocki wrote: > On Fri, Mar 4, 2016 at 11:18 PM, Steve Muckle wrote: >> On 03/03/2016 07:07 PM, Rafael J. Wysocki wrote: >>> +void cpufreq_driver_fast_switch(struct cpufreq_policy *policy, >>> + unsigned int target_freq,

Re: [PATCH v2 6/10] cpufreq: Support for fast frequency switching

2016-03-04 Thread Rafael J. Wysocki
On Fri, Mar 4, 2016 at 11:18 PM, Steve Muckle wrote: > On 03/03/2016 07:07 PM, Rafael J. Wysocki wrote: >> +void cpufreq_driver_fast_switch(struct cpufreq_policy *policy, >> + unsigned int target_freq, unsigned int >> relation) >> +{ >> +

Re: [PATCH v2 6/10] cpufreq: Support for fast frequency switching

2016-03-04 Thread Rafael J. Wysocki
On Fri, Mar 4, 2016 at 11:18 PM, Steve Muckle wrote: > On 03/03/2016 07:07 PM, Rafael J. Wysocki wrote: >> +void cpufreq_driver_fast_switch(struct cpufreq_policy *policy, >> + unsigned int target_freq, unsigned int >> relation) >> +{ >> + unsigned int freq; >> +

Re: [PATCH v2 6/10] cpufreq: Support for fast frequency switching

2016-03-04 Thread Steve Muckle
On 03/03/2016 07:07 PM, Rafael J. Wysocki wrote: > +void cpufreq_driver_fast_switch(struct cpufreq_policy *policy, > + unsigned int target_freq, unsigned int relation) > +{ > + unsigned int freq; > + > + freq = cpufreq_driver->fast_switch(policy, target_freq,

Re: [PATCH v2 6/10] cpufreq: Support for fast frequency switching

2016-03-04 Thread Steve Muckle
On 03/03/2016 07:07 PM, Rafael J. Wysocki wrote: > +void cpufreq_driver_fast_switch(struct cpufreq_policy *policy, > + unsigned int target_freq, unsigned int relation) > +{ > + unsigned int freq; > + > + freq = cpufreq_driver->fast_switch(policy, target_freq,

[PATCH v2 6/10] cpufreq: Support for fast frequency switching

2016-03-03 Thread Rafael J. Wysocki
From: Rafael J. Wysocki Modify the ACPI cpufreq driver to provide a method for switching CPU frequencies from interrupt context and update the cpufreq core to support that method if available. Introduce a new cpufreq driver callback, ->fast_switch, to be invoked for

[PATCH v2 6/10] cpufreq: Support for fast frequency switching

2016-03-03 Thread Rafael J. Wysocki
From: Rafael J. Wysocki Modify the ACPI cpufreq driver to provide a method for switching CPU frequencies from interrupt context and update the cpufreq core to support that method if available. Introduce a new cpufreq driver callback, ->fast_switch, to be invoked for frequency switching from