Skip to contentSkip to conversation

2.6.19-rc5-mm2

PATCH In review Pallipadi, Venkatesh 3 participants 4 messages Nov 15, 2006 – Nov 17, 2006

lore
Share & tools
lore
#0 lore raw
Quoted 19 lines

-----Original Message-----
From: Mattia Dongili [mailto:[email protected]]
Sent: Wednesday, November 15, 2006 9:47 AM
To: Pallipadi, Venkatesh
Cc: [email protected]; Reuben Farrelly; Andrew Morton; [email protected]; [email protected]; CPUFreq Mailing List; Sadykov, Denis M
Subject: Re: 2.6.19-rc5-mm2

On Wed, Nov 15, 2006 at 06:09:47AM -0800, Pallipadi, Venkatesh wrote:
[...]

Quoted 5 lines
Quoted 1 line

data->cpu_feature == ACPI_ADR_SPACE_FIXED_HARDWARE.

Yes. Patch from Mattia is indeed required for acpi-cpufreq.
Mattia: Can you please send the patch towards Andrew (With signed off etc) for inclusion.

Quoted 6 lines

Venki, I'm a little worried about the switch/case in question (line 702): the data->cpu_feature is set either to SYSTEM_IO_CAPABLE or SYSTEM_INTEL_MSR_CAPABLE just a few lines above so it seems the switch variable is wrong and none of the 2 cases will ever get a chance to execute.

The variable is set few lines before. So, it should be OK to switch on that
variable set and one of the two cases will execute. isn't it? Or am I missing something?

Quoted 2 lines

Unfortunately I don't have enough knowledge to tell if it's simply necessary to fix the switch variable as

Get_cur_freq_on_cpu will not work on SYSTEM_IO space as ACPI does not have an interface to get the current frequency. It only has a interface to say whether the last transitions tried was successful or not. So, if indeed a change in switch is required, first option should be good...

Thanks,
Venki

#1 lore raw

On Wed, Nov 15, 2006 at 10:06:23AM -0800, Pallipadi, Venkatesh wrote:
[...]

Quoted 11 lines
Quoted 6 lines

Venki, I'm a little worried about the switch/case in question (line 702): the data->cpu_feature is set either to SYSTEM_IO_CAPABLE or SYSTEM_INTEL_MSR_CAPABLE just a few lines above so it seems the switch variable is wrong and none of the 2 cases will ever get a chance to execute.

The variable is set few lines before. So, it should be OK to switch on that
variable set and one of the two cases will execute. isn't it? Or am I missing something?

Yes, patch is coming.

Quoted 8 lines
Quoted 2 lines

Unfortunately I don't have enough knowledge to tell if it's simply necessary to fix the switch variable as

Get_cur_freq_on_cpu will not work on SYSTEM_IO space as ACPI does not have an interface to get the current frequency. It only has a interface to say whether the last transitions tried was successful or not. So, if indeed a change in switch is required, first option should be good...

Hmmmm... I see, the following path fooled me, but re-reading it seems more obvious what it is doing :)

	get_cur_freq_on_cpu
		extract_freq
			switch (data->cpu_feature) {
			case SYSTEM_INTEL_MSR_CAPABLE:
				return extract_msr(val, data);
			case SYSTEM_IO_CAPABLE:
				return extract_io(val, data);
			...
Signature · 2 lines
mattia
:wq!
#2 lore raw

PATCH 1/1 cpufreq: set policy->curfreq on initialization

Check the correct variable and set policy->cur upon acpi-cpufreq initialization to allow the userspace governor to be used as default.

---

Reuben, could you also try if this patch fixes the BUG()? Thanks

arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c +2 -2
index 18f4715..a630f94 100644
@@ -699,14 +699,14 @@ static int acpi_cpufreq_cpu_init(struct
 	if (result)
 		goto err_freqfree;
 
-	switch (data->cpu_feature) {
+	switch (perf->control_register.space_id) {
 	case ACPI_ADR_SPACE_SYSTEM_IO:
 		/* Current speed is unknown and not detectable by IO port */
 		policy->cur = acpi_cpufreq_guess_freq(data, policy->cpu);
 		break;
 	case ACPI_ADR_SPACE_FIXED_HARDWARE:
 		acpi_cpufreq_driver.get = get_cur_freq_on_cpu;
-		get_cur_freq_on_cpu(cpu);
+		policy->cur = get_cur_freq_on_cpu(cpu);
 		break;
 	default:
 		break;
#3 lore raw

Re: [PATCH 2.6.19-rc5-mm2] cpufreq: set policy->curfreq on initialization

Quoted 9 lines · Mattia Dongili

Check the correct variable and set policy->cur upon acpi-cpufreq initialization to allow the userspace governor to be used as default.

---

Reuben, could you also try if this patch fixes the BUG()? Thanks

It does, and all looks fine now, thanks. Sorry for not getting back about it a little earlier.

Reuben

Quoted 21 lines
arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c +2 -2
index 18f4715..a630f94 100644
@@ -699,14 +699,14 @@ static int acpi_cpufreq_cpu_init(struct
 	if (result)
 		goto err_freqfree;
 
-	switch (data->cpu_feature) {
+	switch (perf->control_register.space_id) {
 	case ACPI_ADR_SPACE_SYSTEM_IO:
 		/* Current speed is unknown and not detectable by IO port */
 		policy->cur = acpi_cpufreq_guess_freq(data, policy->cpu);
 		break;
 	case ACPI_ADR_SPACE_FIXED_HARDWARE:
 		acpi_cpufreq_driver.get = get_cur_freq_on_cpu;
-		get_cur_freq_on_cpu(cpu);
+		policy->cur = get_cur_freq_on_cpu(cpu);
 		break;
 	default:
 		break;