linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the rr tree with the cpufreq-current tree
@ 2009-06-12  3:50 Stephen Rothwell
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Rothwell @ 2009-06-12  3:50 UTC (permalink / raw)
  To: Rusty Russell; +Cc: linux-next, linux-kernel, Dave Jones

[-- Attachment #1: Type: text/plain, Size: 623 bytes --]

Hi Rusty,

Today's linux-next merge of the rr tree got a conflict in
arch/x86/kernel/cpu/cpufreq/speedstep-ich.c between commit
ed5a409578578f263a362d6527ad9e5a493e2a44 ("[CPUFREQ] cpumask: avoid
playing with cpus_allowed in speedstep-ich.c") from the cpufreq-current
tree and commit a5b99ac32f444cd1b7d9aa60ee468de15f8d6964
("cpumask:remove-cpumask-games-arch-x86-kernel-cpu-cpufreq-speedstep-ich.c")
from the rr tree.

Just white space differences ... I used the version from the
cpufreq-current tree.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

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

* RE: linux-next: manual merge of the rr tree with the cpufreq-current tree
  2009-06-12  3:47 Stephen Rothwell
@ 2009-06-12 19:45 ` Chumbalkar, Nagananda
  0 siblings, 0 replies; 3+ messages in thread
From: Chumbalkar, Nagananda @ 2009-06-12 19:45 UTC (permalink / raw)
  To: Stephen Rothwell, Rusty Russell
  Cc: linux-next, linux-kernel, Andrew Morton, Dave Jones


> -----Original Message-----
> From: Stephen Rothwell [mailto:sfr@canb.auug.org.au] 
> Sent: Thursday, June 11, 2009 10:47 PM
> To: Rusty Russell
> Cc: linux-next@vger.kernel.org; linux-kernel@vger.kernel.org; 
> Andrew Morton; Chumbalkar, Nagananda; Dave Jones
> Subject: linux-next: manual merge of the rr tree with the 
> cpufreq-current tree
> 
> Hi Rusty,
> 
> Today's linux-next merge of the rr tree got a conflict in
> arch/x86/kernel/cpu/cpufreq/powernow-k8.c between commits
> ec50b17b706931fb5d2854893cfa4b3f96f19276 ("[CPUFREQ] reduce scope of
> ACPI_PSS_BIOS_BUG_MSG[]") and 97f1bb65966b4276581988755238a1b326fce475
> ("[CPUFREQ] powernow-k8: get drv data for correct CPU") from the
> cpufreq-current tree and commit fd9641cb9b0cd9296a83242164d53517351b6aaa
> ("cpumask: avoid playing with cpus_allowed in powernow-k8.c") from the rr
> tree.
> 
> Just context changes.  I fixed it up (see below) and can carry the fix as
> necessary.

Hi Stephen, the changes to powernowk8_get() may not work as intended. Please
see the reason, and also other comments below. FYI, Dave has a request on the
"cpufreq" list to rebase this patch: 
http://www.spinics.net/lists/cpufreq/msg00771.html


> -- 
> Cheers,
> Stephen Rothwell                    sfr@canb.auug.org.au
> 
> diff --cc arch/x86/kernel/cpu/cpufreq/powernow-k8.c
> index 20c7b99,0e1f6c4..0000000
> --- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
> +++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
> @@@ -1247,14 -1224,41 +1236,40 @@@ static int 
> powernowk8_verify(struct cpu
>   	return cpufreq_frequency_table_verify(pol, 
> data->powernow_table);
>   }
>   
> + struct init_on_cpu {
> + 	struct powernow_k8_data *data;
> + 	int rc;
> + };
> + 
> + static void __cpuinit powernowk8_cpu_init_on_cpu(void *_init_on_cpu)
> + {
> + 	struct init_on_cpu *init_on_cpu = _init_on_cpu;
> + 
> + 	if (pending_bit_stuck()) {
> + 		printk(KERN_ERR PFX "failing init, change 
> pending bit set\n");
> + 		init_on_cpu->rc = -ENODEV;
> + 		return;
> + 	}
> + 
> + 	if (query_current_values_with_pending_wait(init_on_cpu->data)) {
> + 		init_on_cpu->rc = -ENODEV;
> + 		return;
> + 	}
> + 
> + 	if (cpu_family == CPU_OPTERON)
> + 		fidvid_msr_init();
> + 
> + 	init_on_cpu->rc = 0;
> + }
> + 
>   /* per CPU init entry point to the driver */
>   static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
>   {
>  +	static const char ACPI_PSS_BIOS_BUG_MSG[] =
>  +		KERN_ERR FW_BUG PFX "No compatible ACPI _PSS 
> objects found.\n"
>  +		KERN_ERR FW_BUG PFX "Try again with latest BIOS.\n";
>   	struct powernow_k8_data *data;
> - 	cpumask_t oldmask;
> + 	struct init_on_cpu init_on_cpu;
>   	int rc;
>   
>   	if (!cpu_online(pol->cpu))
> @@@ -1383,11 -1372,23 +1383,21 @@@ static int __devexit 
> powernowk8_cpu_exi
>   	return 0;
>   }
>   
> + static void query_values_on_cpu(void *_err)
> + {
> + 	int *err = _err;
> + 	struct powernow_k8_data *data = __get_cpu_var(powernow_data);
> + 

"data" has only local scope. So, powernowk8_get() is not using this data.

Prior equivalent code used to sanity check "data" before calling the function 
below. The sanity check was introduced with this commit:
4211a30349e8d2b724cfb4ce2584604f5e59c299

> + 	*err = query_current_values_with_pending_wait(data);
> + }
> + 
>   static unsigned int powernowk8_get(unsigned int cpu)
>   {
>  -	struct powernow_k8_data *data;
>  +	struct powernow_k8_data *data = per_cpu(powernow_data, cpu);

The above line duplicates what query_values_on_cpu() is now supposed to do on
the given CPU. 

> - 	cpumask_t oldmask = current->cpus_allowed;
>   	unsigned int khz = 0;
> + 	unsigned int first;

The line above seems unnecessary, because smp_call_function_single() should
be called with "cpu", not "first".


> + 	int err;
> + 
>  -	first = cpumask_first(cpu_core_mask(cpu));
>  -	data = per_cpu(powernow_data, first);
>   
>   	if (!data)
>   		return -EINVAL;
> 

The above is not actually sanity checking "data" from query_values_on_cpu(). 

- naga -

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

* linux-next: manual merge of the rr tree with the cpufreq-current tree
@ 2009-06-12  3:47 Stephen Rothwell
  2009-06-12 19:45 ` Chumbalkar, Nagananda
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Rothwell @ 2009-06-12  3:47 UTC (permalink / raw)
  To: Rusty Russell
  Cc: linux-next, linux-kernel, Andrew Morton, Naga Chumbalkar, Dave Jones

Hi Rusty,

Today's linux-next merge of the rr tree got a conflict in
arch/x86/kernel/cpu/cpufreq/powernow-k8.c between commits
ec50b17b706931fb5d2854893cfa4b3f96f19276 ("[CPUFREQ] reduce scope of
ACPI_PSS_BIOS_BUG_MSG[]") and 97f1bb65966b4276581988755238a1b326fce475
("[CPUFREQ] powernow-k8: get drv data for correct CPU") from the
cpufreq-current tree and commit fd9641cb9b0cd9296a83242164d53517351b6aaa
("cpumask: avoid playing with cpus_allowed in powernow-k8.c") from the rr
tree.

Just context changes.  I fixed it up (see below) and can carry the fix as
necessary.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc arch/x86/kernel/cpu/cpufreq/powernow-k8.c
index 20c7b99,0e1f6c4..0000000
--- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
+++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
@@@ -1247,14 -1224,41 +1236,40 @@@ static int powernowk8_verify(struct cpu
  	return cpufreq_frequency_table_verify(pol, data->powernow_table);
  }
  
+ struct init_on_cpu {
+ 	struct powernow_k8_data *data;
+ 	int rc;
+ };
+ 
+ static void __cpuinit powernowk8_cpu_init_on_cpu(void *_init_on_cpu)
+ {
+ 	struct init_on_cpu *init_on_cpu = _init_on_cpu;
+ 
+ 	if (pending_bit_stuck()) {
+ 		printk(KERN_ERR PFX "failing init, change pending bit set\n");
+ 		init_on_cpu->rc = -ENODEV;
+ 		return;
+ 	}
+ 
+ 	if (query_current_values_with_pending_wait(init_on_cpu->data)) {
+ 		init_on_cpu->rc = -ENODEV;
+ 		return;
+ 	}
+ 
+ 	if (cpu_family == CPU_OPTERON)
+ 		fidvid_msr_init();
+ 
+ 	init_on_cpu->rc = 0;
+ }
+ 
  /* per CPU init entry point to the driver */
  static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
  {
 +	static const char ACPI_PSS_BIOS_BUG_MSG[] =
 +		KERN_ERR FW_BUG PFX "No compatible ACPI _PSS objects found.\n"
 +		KERN_ERR FW_BUG PFX "Try again with latest BIOS.\n";
  	struct powernow_k8_data *data;
- 	cpumask_t oldmask;
+ 	struct init_on_cpu init_on_cpu;
  	int rc;
  
  	if (!cpu_online(pol->cpu))
@@@ -1383,11 -1372,23 +1383,21 @@@ static int __devexit powernowk8_cpu_exi
  	return 0;
  }
  
+ static void query_values_on_cpu(void *_err)
+ {
+ 	int *err = _err;
+ 	struct powernow_k8_data *data = __get_cpu_var(powernow_data);
+ 
+ 	*err = query_current_values_with_pending_wait(data);
+ }
+ 
  static unsigned int powernowk8_get(unsigned int cpu)
  {
 -	struct powernow_k8_data *data;
 +	struct powernow_k8_data *data = per_cpu(powernow_data, cpu);
- 	cpumask_t oldmask = current->cpus_allowed;
  	unsigned int khz = 0;
+ 	unsigned int first;
+ 	int err;
+ 
 -	first = cpumask_first(cpu_core_mask(cpu));
 -	data = per_cpu(powernow_data, first);
  
  	if (!data)
  		return -EINVAL;

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

end of thread, other threads:[~2009-06-12 19:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-12  3:50 linux-next: manual merge of the rr tree with the cpufreq-current tree Stephen Rothwell
  -- strict thread matches above, loose matches on Subject: below --
2009-06-12  3:47 Stephen Rothwell
2009-06-12 19:45 ` Chumbalkar, Nagananda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).