Re: [PATCH V3 8/9] cpufreq: Keep policy->freq_table sorted in ascending order

2016-06-07 Thread Viresh Kumar
On 08-06-16, 02:38, Rafael J. Wysocki wrote: > On Tuesday, June 07, 2016 09:58:07 AM Viresh Kumar wrote: > > On 06-06-16, 23:56, Rafael J. Wysocki wrote: > > > Since you are adding new code, you can write it so it doesn't do > > > unnecessary checks from the start. > > > > Hmm, I will do all that

Re: [PATCH V3 8/9] cpufreq: Keep policy->freq_table sorted in ascending order

2016-06-07 Thread Viresh Kumar
On 08-06-16, 02:38, Rafael J. Wysocki wrote: > On Tuesday, June 07, 2016 09:58:07 AM Viresh Kumar wrote: > > On 06-06-16, 23:56, Rafael J. Wysocki wrote: > > > Since you are adding new code, you can write it so it doesn't do > > > unnecessary checks from the start. > > > > Hmm, I will do all that

Re: [PATCH V3 8/9] cpufreq: Keep policy->freq_table sorted in ascending order

2016-06-07 Thread Rafael J. Wysocki
On Tuesday, June 07, 2016 09:58:07 AM Viresh Kumar wrote: > On 06-06-16, 23:56, Rafael J. Wysocki wrote: > > Since you are adding new code, you can write it so it doesn't do > > unnecessary checks from the start. > > Hmm, I will do all that in this series only now. > > > While at it, the "if

Re: [PATCH V3 8/9] cpufreq: Keep policy->freq_table sorted in ascending order

2016-06-07 Thread Rafael J. Wysocki
On Tuesday, June 07, 2016 09:58:07 AM Viresh Kumar wrote: > On 06-06-16, 23:56, Rafael J. Wysocki wrote: > > Since you are adding new code, you can write it so it doesn't do > > unnecessary checks from the start. > > Hmm, I will do all that in this series only now. > > > While at it, the "if

Re: [PATCH V3 8/9] cpufreq: Keep policy->freq_table sorted in ascending order

2016-06-06 Thread Viresh Kumar
On 06-06-16, 23:56, Rafael J. Wysocki wrote: > Since you are adding new code, you can write it so it doesn't do > unnecessary checks from the start. Hmm, I will do all that in this series only now. > While at it, the "if ((freq < policy->min) || (freq > policy->max))" > checks in

Re: [PATCH V3 8/9] cpufreq: Keep policy->freq_table sorted in ascending order

2016-06-06 Thread Viresh Kumar
On 06-06-16, 23:56, Rafael J. Wysocki wrote: > Since you are adding new code, you can write it so it doesn't do > unnecessary checks from the start. Hmm, I will do all that in this series only now. > While at it, the "if ((freq < policy->min) || (freq > policy->max))" > checks in

Re: [PATCH V3 8/9] cpufreq: Keep policy->freq_table sorted in ascending order

2016-06-06 Thread Rafael J. Wysocki
On Mon, Jun 6, 2016 at 6:25 PM, Viresh Kumar wrote: > On 6 June 2016 at 18:27, Rafael J. Wysocki wrote: >> On Mon, Jun 6, 2016 at 2:24 PM, Viresh Kumar wrote: >>> On 6 June 2016 at 17:40, Rafael J. Wysocki

Re: [PATCH V3 8/9] cpufreq: Keep policy->freq_table sorted in ascending order

2016-06-06 Thread Rafael J. Wysocki
On Mon, Jun 6, 2016 at 6:25 PM, Viresh Kumar wrote: > On 6 June 2016 at 18:27, Rafael J. Wysocki wrote: >> On Mon, Jun 6, 2016 at 2:24 PM, Viresh Kumar wrote: >>> On 6 June 2016 at 17:40, Rafael J. Wysocki wrote: On Monday, June 06, 2016 09:22:31 AM Viresh Kumar wrote: >>> > I agree

Re: [PATCH V3 8/9] cpufreq: Keep policy->freq_table sorted in ascending order

2016-06-06 Thread Viresh Kumar
On 6 June 2016 at 18:27, Rafael J. Wysocki wrote: > On Mon, Jun 6, 2016 at 2:24 PM, Viresh Kumar wrote: >> On 6 June 2016 at 17:40, Rafael J. Wysocki wrote: >>> On Monday, June 06, 2016 09:22:31 AM Viresh Kumar wrote: >> I

Re: [PATCH V3 8/9] cpufreq: Keep policy->freq_table sorted in ascending order

2016-06-06 Thread Viresh Kumar
On 6 June 2016 at 18:27, Rafael J. Wysocki wrote: > On Mon, Jun 6, 2016 at 2:24 PM, Viresh Kumar wrote: >> On 6 June 2016 at 17:40, Rafael J. Wysocki wrote: >>> On Monday, June 06, 2016 09:22:31 AM Viresh Kumar wrote: >> I agree with that, though that requires larger changes across

Re: [PATCH V3 8/9] cpufreq: Keep policy->freq_table sorted in ascending order

2016-06-06 Thread Rafael J. Wysocki
On Mon, Jun 6, 2016 at 2:24 PM, Viresh Kumar wrote: > On 6 June 2016 at 17:40, Rafael J. Wysocki wrote: >> On Monday, June 06, 2016 09:22:31 AM Viresh Kumar wrote: > >>> I agree with that, though that requires larger changes across multiple >>> sites.

Re: [PATCH V3 8/9] cpufreq: Keep policy->freq_table sorted in ascending order

2016-06-06 Thread Rafael J. Wysocki
On Mon, Jun 6, 2016 at 2:24 PM, Viresh Kumar wrote: > On 6 June 2016 at 17:40, Rafael J. Wysocki wrote: >> On Monday, June 06, 2016 09:22:31 AM Viresh Kumar wrote: > >>> I agree with that, though that requires larger changes across multiple >>> sites. >> >> What changes and where? > >

Re: [PATCH V3 8/9] cpufreq: Keep policy->freq_table sorted in ascending order

2016-06-06 Thread Viresh Kumar
On 6 June 2016 at 17:40, Rafael J. Wysocki wrote: > On Monday, June 06, 2016 09:22:31 AM Viresh Kumar wrote: >> I agree with that, though that requires larger changes across multiple >> sites. > > What changes and where? s/larger/some :) So we can change all the callers of

Re: [PATCH V3 8/9] cpufreq: Keep policy->freq_table sorted in ascending order

2016-06-06 Thread Viresh Kumar
On 6 June 2016 at 17:40, Rafael J. Wysocki wrote: > On Monday, June 06, 2016 09:22:31 AM Viresh Kumar wrote: >> I agree with that, though that requires larger changes across multiple >> sites. > > What changes and where? s/larger/some :) So we can change all the callers of

Re: [PATCH V3 8/9] cpufreq: Keep policy->freq_table sorted in ascending order

2016-06-06 Thread Rafael J. Wysocki
On Monday, June 06, 2016 09:22:31 AM Viresh Kumar wrote: > On 03-06-16, 16:48, Steve Muckle wrote: > > On Fri, Jun 03, 2016 at 07:05:14PM +0530, Viresh Kumar wrote: > > ... > > > @@ -468,20 +469,15 @@ unsigned int acpi_cpufreq_fast_switch(struct > > > cpufreq_policy *policy, > > > struct

Re: [PATCH V3 8/9] cpufreq: Keep policy->freq_table sorted in ascending order

2016-06-06 Thread Rafael J. Wysocki
On Monday, June 06, 2016 09:22:31 AM Viresh Kumar wrote: > On 03-06-16, 16:48, Steve Muckle wrote: > > On Fri, Jun 03, 2016 at 07:05:14PM +0530, Viresh Kumar wrote: > > ... > > > @@ -468,20 +469,15 @@ unsigned int acpi_cpufreq_fast_switch(struct > > > cpufreq_policy *policy, > > > struct

Re: [PATCH V3 8/9] cpufreq: Keep policy->freq_table sorted in ascending order

2016-06-05 Thread Viresh Kumar
On 03-06-16, 16:48, Steve Muckle wrote: > On Fri, Jun 03, 2016 at 07:05:14PM +0530, Viresh Kumar wrote: > ... > > @@ -468,20 +469,15 @@ unsigned int acpi_cpufreq_fast_switch(struct > > cpufreq_policy *policy, > > struct acpi_cpufreq_data *data = policy->driver_data; > > struct

Re: [PATCH V3 8/9] cpufreq: Keep policy->freq_table sorted in ascending order

2016-06-05 Thread Viresh Kumar
On 03-06-16, 16:48, Steve Muckle wrote: > On Fri, Jun 03, 2016 at 07:05:14PM +0530, Viresh Kumar wrote: > ... > > @@ -468,20 +469,15 @@ unsigned int acpi_cpufreq_fast_switch(struct > > cpufreq_policy *policy, > > struct acpi_cpufreq_data *data = policy->driver_data; > > struct

Re: [PATCH V3 8/9] cpufreq: Keep policy->freq_table sorted in ascending order

2016-06-03 Thread Steve Muckle
On Fri, Jun 03, 2016 at 07:05:14PM +0530, Viresh Kumar wrote: ... > @@ -468,20 +469,15 @@ unsigned int acpi_cpufreq_fast_switch(struct > cpufreq_policy *policy, > struct acpi_cpufreq_data *data = policy->driver_data; > struct acpi_processor_performance *perf; > struct

Re: [PATCH V3 8/9] cpufreq: Keep policy->freq_table sorted in ascending order

2016-06-03 Thread Steve Muckle
On Fri, Jun 03, 2016 at 07:05:14PM +0530, Viresh Kumar wrote: ... > @@ -468,20 +469,15 @@ unsigned int acpi_cpufreq_fast_switch(struct > cpufreq_policy *policy, > struct acpi_cpufreq_data *data = policy->driver_data; > struct acpi_processor_performance *perf; > struct

[PATCH V3 8/9] cpufreq: Keep policy->freq_table sorted in ascending order

2016-06-03 Thread Viresh Kumar
The drivers aren't required to provide a sorted frequency table today, and its not optimal to work on an unsorted frequency tables. To simplify and improve code performance, always keep policy->freq_table sorted in ascending order. Now that freq_table is sorted, update

[PATCH V3 8/9] cpufreq: Keep policy->freq_table sorted in ascending order

2016-06-03 Thread Viresh Kumar
The drivers aren't required to provide a sorted frequency table today, and its not optimal to work on an unsorted frequency tables. To simplify and improve code performance, always keep policy->freq_table sorted in ascending order. Now that freq_table is sorted, update