linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the rr tree with the cpufreq tree
@ 2009-03-05  3:59 Stephen Rothwell
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Rothwell @ 2009-03-05  3:59 UTC (permalink / raw)
  To: Rusty Russell; +Cc: linux-next, 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
0e64a0c982c06a6b8f5e2a7f29eb108fdf257b2f ("[CPUFREQ] checkpatch cleanups
for powernow-k8") and 0cb8bc256093e716d2a0a4a721f36c625a3f7634
("[CPUFREQ] powernow-k8: Use a common exit path") from the cpufreq tree
and commit 174510a6a5388fb4eb4605e2e6452380c4888758
("cpumask:remove-cpumask-games-arch-x86-kernel-cpu-cpufreq-powernow-k8.c")
from the rr tree.

I tried to fix it up (see below) (the first of the cpufreq patches above
is just formatting changes and so its conflicting bits were discarded)
and can carry the patch as necessary.  Please check the result.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

diff --cc arch/x86/kernel/cpu/cpufreq/powernow-k8.c
index a15ac94,864d5e6..0000000
--- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
+++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
@@@ -1216,9 -1160,7 +1235,8 @@@ static long __cpuinit powernowk8_cpu_in
  static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
  {
  	struct powernow_k8_data *data;
- 	cpumask_t oldmask;
  	int rc;
 +	static int print_once;
  
  	if (!cpu_online(pol->cpu))
  		return -ENODEV;
@@@ -1275,27 -1220,9 +1294,9 @@@
  		pol->cpuinfo.transition_latency = get_transition_latency(data);
  
  	/* only run on specific CPU from here on */
- 	oldmask = current->cpus_allowed;
- 	set_cpus_allowed_ptr(current, &cpumask_of_cpu(pol->cpu));
- 
- 	if (smp_processor_id() != pol->cpu) {
- 		printk(KERN_ERR PFX "limiting to cpu %u failed\n", pol->cpu);
+ 	rc = work_on_cpu(data->cpu, powernowk8_cpu_init_on_cpu, data);
+ 	if (rc != 0)
 -		goto err_out;
 +		goto err_out_unmask;
- 	}
- 
- 	if (pending_bit_stuck()) {
- 		printk(KERN_ERR PFX "failing init, change pending bit set\n");
- 		goto err_out_unmask;
- 	}
- 
- 	if (query_current_values_with_pending_wait(data))
- 		goto err_out_unmask;
- 
- 	if (cpu_family == CPU_OPTERON)
- 		fidvid_msr_init();
- 
- 	/* run on any CPU again */
- 	set_cpus_allowed_ptr(current, &oldmask);
  
  	if (cpu_family == CPU_HW_PSTATE)
  		cpumask_copy(pol->cpus, cpumask_of(pol->cpu));
@@@ -1332,11 -1257,9 +1333,10 @@@
  
  	return 0;
  
 -err_out:
 +err_out_unmask:
- 	set_cpus_allowed_ptr(current, &oldmask);
  	powernow_k8_cpu_exit_acpi(data);
  
 +err_out:
  	kfree(data);
  	return -ENODEV;
  }

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

* linux-next: manual merge of the rr tree with the cpufreq tree
@ 2009-03-05  3:59 Stephen Rothwell
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Rothwell @ 2009-03-05  3:59 UTC (permalink / raw)
  To: Rusty Russell; +Cc: linux-next, Dave Jones

Hi Rusty,

Today's linux-next merge of the rr tree got a conflict in
arch/x86/kernel/cpu/cpufreq/speedstep-lib.c between commit
bbfebd66554b934b270c4c49442f4fe5e62df0e5 ("[CPUFREQ] checkpatch cleanups
for speedstep related drivers") from the cpufreq tree and commit
8bd527201fec91f5b42e7ee56840eba399356003
("cpumask:remove-cpumask-games-arch-x86-kernel-cpu-cpufreq-speedstep-ich.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
http://www.canb.auug.org.au/~sfr/

diff --cc arch/x86/kernel/cpu/cpufreq/speedstep-lib.c
index 2e3c686,4d82879..0000000
--- a/arch/x86/kernel/cpu/cpufreq/speedstep-lib.c
+++ b/arch/x86/kernel/cpu/cpufreq/speedstep-lib.c
@@@ -218,27 -200,25 +218,27 @@@ static unsigned int pentium4_get_freque
  	/* Multiplier. */
  	mult = msr_lo >> 24;
  
 -	dprintk("P4 - FSB %u kHz; Multiplier %u; Speed %u kHz\n", fsb, mult, (fsb * mult));
 +	dprintk("P4 - FSB %u kHz; Multiplier %u; Speed %u kHz\n",
 +			fsb, mult, (fsb * mult));
  
 -	return (fsb * mult);
 +	ret = (fsb * mult);
 +	return ret;
  }
  
- 
+ /* Warning: may get called from smp_call_function_single. */
 -unsigned int speedstep_get_processor_frequency(unsigned int processor)
 +unsigned int speedstep_get_frequency(unsigned int processor)
  {
  	switch (processor) {
 -	case SPEEDSTEP_PROCESSOR_PCORE:
 +	case SPEEDSTEP_CPU_PCORE:
  		return pentium_core_get_frequency();
 -	case SPEEDSTEP_PROCESSOR_PM:
 +	case SPEEDSTEP_CPU_PM:
  		return pentiumM_get_frequency();
 -	case SPEEDSTEP_PROCESSOR_P4D:
 -	case SPEEDSTEP_PROCESSOR_P4M:
 +	case SPEEDSTEP_CPU_P4D:
 +	case SPEEDSTEP_CPU_P4M:
  		return pentium4_get_frequency();
 -	case SPEEDSTEP_PROCESSOR_PIII_T:
 -	case SPEEDSTEP_PROCESSOR_PIII_C:
 -	case SPEEDSTEP_PROCESSOR_PIII_C_EARLY:
 +	case SPEEDSTEP_CPU_PIII_T:
 +	case SPEEDSTEP_CPU_PIII_C:
 +	case SPEEDSTEP_CPU_PIII_C_EARLY:
  		return pentium3_get_frequency(processor);
  	default:
  		return 0;

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

* linux-next: manual merge of the rr tree with the cpufreq tree
@ 2009-03-05  3:59 Stephen Rothwell
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Rothwell @ 2009-03-05  3:59 UTC (permalink / raw)
  To: Rusty Russell; +Cc: linux-next, Dave Jones

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
bbfebd66554b934b270c4c49442f4fe5e62df0e5 ("[CPUFREQ] checkpatch cleanups
for speedstep related drivers") from the cpufreq tree and commit
8bd527201fec91f5b42e7ee56840eba399356003
("cpumask:remove-cpumask-games-arch-x86-kernel-cpu-cpufreq-speedstep-ich.c")
from the rr tree.

I fixed it up (see below) and can carry the fix as necessary.  Please
check the result.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

diff --cc arch/x86/kernel/cpu/cpufreq/speedstep-ich.c
index 8bbb11a,0baf5f1..0000000
--- a/arch/x86/kernel/cpu/cpufreq/speedstep-ich.c
+++ b/arch/x86/kernel/cpu/cpufreq/speedstep-ich.c
@@@ -89,9 -88,10 +89,10 @@@ static int speedstep_find_register(void
   * speedstep_set_state - set the SpeedStep state
   * @state: new processor frequency state (SPEEDSTEP_LOW or SPEEDSTEP_HIGH)
   *
-  *   Tries to change the SpeedStep state.
+  *   Tries to change the SpeedStep state.  Can be called from
+  *   smp_call_function_single.
   */
 -static void speedstep_set_state (unsigned int state)
 +static void speedstep_set_state(unsigned int state)
  {
  	u8 pm2_blk;
  	u8 value;
@@@ -226,17 -235,16 +232,16 @@@ static unsigned int speedstep_detect_ch
  	return 0;
  }
  
- static unsigned int _speedstep_get(const struct cpumask *cpus)
- {
+ struct get_freq_data {
  	unsigned int speed;
- 	cpumask_t cpus_allowed;
- 
- 	cpus_allowed = current->cpus_allowed;
- 	set_cpus_allowed_ptr(current, cpus);
- 	speed = speedstep_get_frequency(speedstep_processor);
- 	set_cpus_allowed_ptr(current, &cpus_allowed);
- 	dprintk("detected %u kHz as current frequency\n", speed);
- 	return speed;
+ 	unsigned int processor;
+ };
+ 
+ static void get_freq_data(void *_data)
+ {
+ 	struct get_freq_data *data = _data;
+ 
 -	data->speed = speedstep_get_processor_frequency(data->processor);
++	data->speed = speedstep_get_frequency(data->processor);
  }
  
  static unsigned int speedstep_get(unsigned int cpu)
@@@ -257,16 -271,15 +269,16 @@@ static int speedstep_target(struct cpuf
  			     unsigned int target_freq,
  			     unsigned int relation)
  {
- 	unsigned int newstate = 0;
+ 	unsigned int newstate = 0, policy_cpu;
  	struct cpufreq_freqs freqs;
- 	cpumask_t cpus_allowed;
  	int i;
  
 -	if (cpufreq_frequency_table_target(policy, &speedstep_freqs[0], target_freq, relation, &newstate))
 +	if (cpufreq_frequency_table_target(policy, &speedstep_freqs[0],
 +				target_freq, relation, &newstate))
  		return -EINVAL;
  
- 	freqs.old = _speedstep_get(policy->cpus);
+ 	policy_cpu = cpumask_any_and(policy->cpus, cpu_online_mask);
+ 	freqs.old = speedstep_get(policy_cpu);
  	freqs.new = speedstep_freqs[newstate].frequency;
  	freqs.cpu = policy->cpu;
  

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

* linux-next: manual merge of the rr tree with the cpufreq tree
@ 2009-02-05  4:18 Stephen Rothwell
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Rothwell @ 2009-02-05  4:18 UTC (permalink / raw)
  To: Rusty Russell; +Cc: linux-next, Thomas Renninger, Dave Jones, Mark Langsdorf

Hi Rusty,

Today's linux-next merge of the rr tree got a conflict in
arch/x86/kernel/cpu/cpufreq/powernow-k8.c between various commits from
the cpufreq-current and cpufreq trees and commit
35bed9c465bcf6e9e797cba9c54bab263e07be31
("cpumask:partial-revert-powernow-k8") from the rr tree.

I fixed it up (see below) and can carry the fix as necessary.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

diff --cc arch/x86/kernel/cpu/cpufreq/powernow-k8.c
index 83515f16,8b99478..0000000
--- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
+++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
@@@ -1242,38 -1148,34 +1241,42 @@@ static int __cpuinit powernowk8_cpu_ini
  		 * an UP version, and is deprecated by AMD.
  		 */
  		if (num_online_cpus() != 1) {
 -#ifndef CONFIG_ACPI_PROCESSOR
 -			printk(KERN_ERR PFX "ACPI Processor support is required "
 -			       "for SMP systems but is absent. Please load the "
 -			       "ACPI Processor module before starting this "
 -			       "driver.\n");
 -#else
 -			printk(KERN_ERR FW_BUG PFX "Your BIOS does not provide"
 -			       " ACPI _PSS objects in a way that Linux "
 -			       "understands. Please report this to the Linux "
 -			       "ACPI maintainers and complain to your BIOS "
 -			       "vendor.\n");
 -#endif
 +			/*
 +			 * Replace this one with print_once as soon as such a
 +			 * thing gets introduced
 +			 */
 +			if (!print_once) {
 +				WARN_ONCE(1, KERN_ERR FW_BUG PFX "Your BIOS "
 +					  "does not provide ACPI _PSS objects "
 +					  "in a way that Linux understands. "
 +					  "Please report this to the Linux ACPI"
 +					  " maintainers and complain to your "
 +					  "BIOS vendor.\n");
 +				print_once++;
 +			}
- 			goto err_out;
+ 			kfree(data);
+ 			return -ENODEV;
  		}
  		if (pol->cpu != 0) {
  			printk(KERN_ERR FW_BUG PFX "No ACPI _PSS objects for "
  			       "CPU other than CPU0. Complain to your BIOS "
  			       "vendor.\n");
- 			goto err_out;
+ 			kfree(data);
+ 			return -ENODEV;
  		}
  		rc = find_psb_table(data);
- 		if (rc)
- 			goto err_out;
+ 		if (rc) {
+ 			kfree(data);
+ 			return -ENODEV;
+ 		}
 -	}
 +
 +		/* Take a crude guess here.
 +		 * That guess was in microseconds, so multiply with 1000 */
 +		pol->cpuinfo.transition_latency = (
 +			 ((data->rvo + 8) * data->vstable * VST_UNITS_20US) +
 +			 ((1 << data->irt) * 30)) * 1000;
 +	} else /* ACPI _PSS objects available */
 +		pol->cpuinfo.transition_latency = get_transition_latency(data);
  
  	/* only run on specific CPU from here on */
  	oldmask = current->cpus_allowed;

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

* linux-next: manual merge of the rr tree with the cpufreq tree
@ 2009-02-02  4:00 Stephen Rothwell
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Rothwell @ 2009-02-02  4:00 UTC (permalink / raw)
  To: Rusty Russell; +Cc: linux-next, Dave Jones

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

Hi Rusty,

Today's linux-next merge of the rr tree got a conflict in
arch/x86/kernel/cpu/cpufreq/powernow-k8.c between commit
8ad2aedc2129f4e791dc7e2e89eabdcb2145d16c ("[CPUFREQ] checkpatch cleanups
for powernow-k8") from the cpufreq tree and commit
d58128cd5c204e6f9d2e1910f160064c15b5f19d
("cpumask:partial-revert-powernow-k8") from the rr tree.

Just simple overlapping changes.  I fixed it up (used the conflicting
part from the rr tree change) and can carry the fix as necessary.

-- 
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] 5+ messages in thread

end of thread, other threads:[~2009-03-05  4:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-05  3:59 linux-next: manual merge of the rr tree with the cpufreq tree Stephen Rothwell
  -- strict thread matches above, loose matches on Subject: below --
2009-03-05  3:59 Stephen Rothwell
2009-03-05  3:59 Stephen Rothwell
2009-02-05  4:18 Stephen Rothwell
2009-02-02  4:00 Stephen Rothwell

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).