All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 8/8] acpi-cpufreq: skip duplicate frequencies
@ 2006-07-31 18:58 Alexey Starikovskiy
  0 siblings, 0 replies; 5+ messages in thread
From: Alexey Starikovskiy @ 2006-07-31 18:58 UTC (permalink / raw)
  To: Brown, Len, Dave Jones; +Cc: cpufreq

 acpi-cpufreq.c |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

Skip duplicate frequencies reported by ACPI.

Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy at intel.com>

Index: linux-2.6.15.1/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
===================================================================
--- linux-2.6.15.1.orig/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c	2006-07-31 21:23:47.000000000 +0400
+++ linux-2.6.15.1/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c	2006-07-31 21:36:02.000000000 +0400
@@ -22,7 +22,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  *
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  */
 
 #include <linux/config.h>
@@ -476,8 +476,14 @@
 		} else {
 			data->freq_table[i].index = i;
 		}
-		data->freq_table[i].frequency =
-		    perf->states[i].core_frequency * 1000;
+		if (i == 0 ||
+		    perf->states[i].core_frequency !=
+		    perf->states[i - 1].core_frequency) {
+			data->freq_table[i].frequency =
+			    perf->states[i].core_frequency * 1000;
+		} else {
+			data->freq_table[i].frequency = CPUFREQ_ENTRY_INVALID;
+		}
 	}
 	data->freq_table[perf->state_count].frequency = CPUFREQ_TABLE_END;

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH 8/8] acpi-cpufreq: skip duplicate frequencies
@ 2006-08-03 21:10 Pallipadi, Venkatesh
  2006-08-03 21:14 ` Alexey Starikovskiy
  0 siblings, 1 reply; 5+ messages in thread
From: Pallipadi, Venkatesh @ 2006-08-03 21:10 UTC (permalink / raw)
  To: Alexey Starikovskiy, Brown, Len, Dave Jones; +Cc: cpufreq

 

>-----Original Message-----
>From: cpufreq-bounces@lists.linux.org.uk 
>[mailto:cpufreq-bounces@lists.linux.org.uk] On Behalf Of 
>Alexey Starikovskiy
>Sent: Monday, July 31, 2006 11:58 AM
>To: Brown, Len; Dave Jones
>Cc: cpufreq@lists.linux.org.uk
>Subject: [PATCH 8/8] acpi-cpufreq: skip duplicate frequencies
>
> acpi-cpufreq.c |   12 +++++++++---
> 1 file changed, 9 insertions(+), 3 deletions(-)
>
>Skip duplicate frequencies reported by ACPI.
>
>Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy at intel.com>
>
>Index: linux-2.6.15.1/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
>===================================================================
>--- 
>linux-2.6.15.1.orig/arch/i386/kernel/cpu/cpufreq/acpi-cp
>ufreq.c	2006-07-31 21:23:47.000000000 +0400
>+++ linux-2.6.15.1/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c	
>2006-07-31 21:36:02.000000000 +0400
>@@ -22,7 +22,7 @@
>  *  with this program; if not, write to the Free Software 
>Foundation, Inc.,
>  *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
>  *
>- * 
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>~~~~~~~~~~~ 
>+ * 
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>~~~~~~~~~~~
>  */
> 
> #include <linux/config.h>
>@@ -476,8 +476,14 @@
> 		} else {
> 			data->freq_table[i].index = i;
> 		}
>-		data->freq_table[i].frequency =
>-		    perf->states[i].core_frequency * 1000;
>+		if (i == 0 ||
>+		    perf->states[i].core_frequency !=
>+		    perf->states[i - 1].core_frequency) {
>+			data->freq_table[i].frequency =
>+			    perf->states[i].core_frequency * 1000;
>+		} else {
>+			data->freq_table[i].frequency = 
>CPUFREQ_ENTRY_INVALID;
>+		}
> 	}
> 	data->freq_table[perf->state_count].frequency = 
>CPUFREQ_TABLE_END;


I guess we should compact the whole table rather than adding INVALID
entries. With INVALID entries, we may end up running some redundant
loops table_verify table_target functions later.

Thanks,
Venki
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 8/8] acpi-cpufreq: skip duplicate frequencies
  2006-08-03 21:10 Pallipadi, Venkatesh
@ 2006-08-03 21:14 ` Alexey Starikovskiy
  0 siblings, 0 replies; 5+ messages in thread
From: Alexey Starikovskiy @ 2006-08-03 21:14 UTC (permalink / raw)
  To: Pallipadi, Venkatesh; +Cc: cpufreq, Dave Jones

Pallipadi, Venkatesh wrote:
>  
> 
>> -----Original Message-----
>> From: cpufreq-bounces@lists.linux.org.uk 
>> [mailto:cpufreq-bounces@lists.linux.org.uk] On Behalf Of 
>> Alexey Starikovskiy
>> Sent: Monday, July 31, 2006 11:58 AM
>> To: Brown, Len; Dave Jones
>> Cc: cpufreq@lists.linux.org.uk
>> Subject: [PATCH 8/8] acpi-cpufreq: skip duplicate frequencies
>>
>> acpi-cpufreq.c |   12 +++++++++---
>> 1 file changed, 9 insertions(+), 3 deletions(-)
>>
>> Skip duplicate frequencies reported by ACPI.
>>
>> Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy at intel.com>
>>
>> Index: linux-2.6.15.1/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
>> ===================================================================
>> --- 
>> linux-2.6.15.1.orig/arch/i386/kernel/cpu/cpufreq/acpi-cp
>> ufreq.c	2006-07-31 21:23:47.000000000 +0400
>> +++ linux-2.6.15.1/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c	
>> 2006-07-31 21:36:02.000000000 +0400
>> @@ -22,7 +22,7 @@
>>  *  with this program; if not, write to the Free Software 
>> Foundation, Inc.,
>>  *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
>>  *
>> - * 
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> ~~~~~~~~~~~ 
>> + * 
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> ~~~~~~~~~~~
>>  */
>>
>> #include <linux/config.h>
>> @@ -476,8 +476,14 @@
>> 		} else {
>> 			data->freq_table[i].index = i;
>> 		}
>> -		data->freq_table[i].frequency =
>> -		    perf->states[i].core_frequency * 1000;
>> +		if (i == 0 ||
>> +		    perf->states[i].core_frequency !=
>> +		    perf->states[i - 1].core_frequency) {
>> +			data->freq_table[i].frequency =
>> +			    perf->states[i].core_frequency * 1000;
>> +		} else {
>> +			data->freq_table[i].frequency = 
>> CPUFREQ_ENTRY_INVALID;
>> +		}
>> 	}
>> 	data->freq_table[perf->state_count].frequency = 
>> CPUFREQ_TABLE_END;
> 
> 
> I guess we should compact the whole table rather than adding INVALID
> entries. With INVALID entries, we may end up running some redundant
> loops table_verify table_target functions later.
> 
> Thanks,
> Venki
>  
there can be inconsistency then BIOS issues notifies, if we change number of P-states.
Keeping them INVALID is safer.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH 8/8] acpi-cpufreq: skip duplicate frequencies
@ 2006-08-03 21:42 Pallipadi, Venkatesh
  2006-08-04  8:24 ` Alexey Starikovskiy
  0 siblings, 1 reply; 5+ messages in thread
From: Pallipadi, Venkatesh @ 2006-08-03 21:42 UTC (permalink / raw)
  To: Alexey Starikovskiy; +Cc: cpufreq, Dave Jones

 

>-----Original Message-----
>From: Alexey Starikovskiy 
>[mailto:alexey_y_starikovskiy@linux.intel.com] 
>Sent: Thursday, August 03, 2006 2:14 PM
>To: Pallipadi, Venkatesh
>Cc: Brown, Len; Dave Jones; cpufreq@lists.linux.org.uk
>Subject: Re: [PATCH 8/8] acpi-cpufreq: skip duplicate frequencies
>
>Pallipadi, Venkatesh wrote:
>>  
>> 
>>> -----Original Message-----
>>> From: cpufreq-bounces@lists.linux.org.uk 
>>> [mailto:cpufreq-bounces@lists.linux.org.uk] On Behalf Of 
>>> Alexey Starikovskiy
>>> Sent: Monday, July 31, 2006 11:58 AM
>>> To: Brown, Len; Dave Jones
>>> Cc: cpufreq@lists.linux.org.uk
>>> Subject: [PATCH 8/8] acpi-cpufreq: skip duplicate frequencies
>>>
>>> acpi-cpufreq.c |   12 +++++++++---
>>> 1 file changed, 9 insertions(+), 3 deletions(-)
>>>
>>> Skip duplicate frequencies reported by ACPI.
>>>
>>> Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy 
>at intel.com>
>>>
>>> Index: linux-2.6.15.1/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
>>> ===================================================================
>>> --- 
>>> linux-2.6.15.1.orig/arch/i386/kernel/cpu/cpufreq/acpi-cp
>>> ufreq.c	2006-07-31 21:23:47.000000000 +0400
>>> +++ linux-2.6.15.1/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c	
>>> 2006-07-31 21:36:02.000000000 +0400
>>> @@ -22,7 +22,7 @@
>>>  *  with this program; if not, write to the Free Software 
>>> Foundation, Inc.,
>>>  *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
>>>  *
>>> - * 
>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>> ~~~~~~~~~~~ 
>>> + * 
>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>> ~~~~~~~~~~~
>>>  */
>>>
>>> #include <linux/config.h>
>>> @@ -476,8 +476,14 @@
>>> 		} else {
>>> 			data->freq_table[i].index = i;
>>> 		}
>>> -		data->freq_table[i].frequency =
>>> -		    perf->states[i].core_frequency * 1000;
>>> +		if (i == 0 ||
>>> +		    perf->states[i].core_frequency !=
>>> +		    perf->states[i - 1].core_frequency) {
>>> +			data->freq_table[i].frequency =
>>> +			    perf->states[i].core_frequency * 1000;
>>> +		} else {
>>> +			data->freq_table[i].frequency = 
>>> CPUFREQ_ENTRY_INVALID;
>>> +		}
>>> 	}
>>> 	data->freq_table[perf->state_count].frequency = 
>>> CPUFREQ_TABLE_END;
>> 
>> 
>> I guess we should compact the whole table rather than adding INVALID
>> entries. With INVALID entries, we may end up running some redundant
>> loops table_verify table_target functions later.
>> 
>> Thanks,
>> Venki
>>  
>there can be inconsistency then BIOS issues notifies, if we 
>change number of P-states.
>Keeping them INVALID is safer.
>

But, BIOS notification only checks the perf->states structure and does
not depend on frequency table. Right?
Also, if notification depends on freq table, we will still have a issue
with this patch and number_of_P-states_change notification.
Say we have - 3 GHz, 3 GHz, 3 GHz, 2 GHz as P0, P1, P2, and P3 reported
by BIOS. And it says P2 as the highest frequency through notify. This
patch would have made P1 and P2 frequency as INVALID. 

Thanks,
Venki

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 8/8] acpi-cpufreq: skip duplicate frequencies
  2006-08-03 21:42 [PATCH 8/8] acpi-cpufreq: skip duplicate frequencies Pallipadi, Venkatesh
@ 2006-08-04  8:24 ` Alexey Starikovskiy
  0 siblings, 0 replies; 5+ messages in thread
From: Alexey Starikovskiy @ 2006-08-04  8:24 UTC (permalink / raw)
  To: Pallipadi, Venkatesh; +Cc: cpufreq, Dave Jones

Pallipadi, Venkatesh wrote:
>>> I guess we should compact the whole table rather than adding INVALID
>>> entries. With INVALID entries, we may end up running some redundant
>>> loops table_verify table_target functions later.
>>>
>>> Thanks,
>>> Venki
>>>  
>> there can be inconsistency then BIOS issues notifies, if we 
>> change number of P-states.
>> Keeping them INVALID is safer.
>>
> 
> But, BIOS notification only checks the perf->states structure and does
> not depend on frequency table. Right?
> Also, if notification depends on freq table, we will still have a issue
> with this patch and number_of_P-states_change notification.
> Say we have - 3 GHz, 3 GHz, 3 GHz, 2 GHz as P0, P1, P2, and P3 reported
> by BIOS. And it says P2 as the highest frequency through notify. This
> patch would have made P1 and P2 frequency as INVALID. 
BIOS knows that there are 4 P-states, 3 of them being equal (it populated these values after all).
So if it says we need to set limit to upper 2 equal states -- it is BIOS bug (feature).

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-08-04  8:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-03 21:42 [PATCH 8/8] acpi-cpufreq: skip duplicate frequencies Pallipadi, Venkatesh
2006-08-04  8:24 ` Alexey Starikovskiy
  -- strict thread matches above, loose matches on Subject: below --
2006-08-03 21:10 Pallipadi, Venkatesh
2006-08-03 21:14 ` Alexey Starikovskiy
2006-07-31 18:58 Alexey Starikovskiy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.