Commit 28e7d82d authored by Ingo Molnar's avatar Ingo Molnar

Merge branch 'master' of...

Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/travis/linux-2.6-cpus4096-for-ingo into cpus4096
parents c99dbbe9 cef30b3a
...@@ -1833,6 +1833,11 @@ void __cpuinit generic_processor_info(int apicid, int version) ...@@ -1833,6 +1833,11 @@ void __cpuinit generic_processor_info(int apicid, int version)
num_processors++; num_processors++;
cpu = cpumask_next_zero(-1, cpu_present_mask); cpu = cpumask_next_zero(-1, cpu_present_mask);
if (version != apic_version[boot_cpu_physical_apicid])
WARN_ONCE(1,
"ACPI: apic version mismatch, bootcpu: %x cpu %d: %x\n",
apic_version[boot_cpu_physical_apicid], cpu, version);
physid_set(apicid, phys_cpu_present_map); physid_set(apicid, phys_cpu_present_map);
if (apicid == boot_cpu_physical_apicid) { if (apicid == boot_cpu_physical_apicid) {
/* /*
......
...@@ -150,8 +150,9 @@ struct drv_cmd { ...@@ -150,8 +150,9 @@ struct drv_cmd {
u32 val; u32 val;
}; };
static void do_drv_read(struct drv_cmd *cmd) static long do_drv_read(void *_cmd)
{ {
struct drv_cmd *cmd = _cmd;
u32 h; u32 h;
switch (cmd->type) { switch (cmd->type) {
...@@ -166,10 +167,12 @@ static void do_drv_read(struct drv_cmd *cmd) ...@@ -166,10 +167,12 @@ static void do_drv_read(struct drv_cmd *cmd)
default: default:
break; break;
} }
return 0;
} }
static void do_drv_write(struct drv_cmd *cmd) static long do_drv_write(void *_cmd)
{ {
struct drv_cmd *cmd = _cmd;
u32 lo, hi; u32 lo, hi;
switch (cmd->type) { switch (cmd->type) {
...@@ -186,30 +189,23 @@ static void do_drv_write(struct drv_cmd *cmd) ...@@ -186,30 +189,23 @@ static void do_drv_write(struct drv_cmd *cmd)
default: default:
break; break;
} }
return 0;
} }
static void drv_read(struct drv_cmd *cmd) static void drv_read(struct drv_cmd *cmd)
{ {
cpumask_t saved_mask = current->cpus_allowed;
cmd->val = 0; cmd->val = 0;
set_cpus_allowed_ptr(current, cmd->mask); work_on_cpu(cpumask_any(cmd->mask), do_drv_read, cmd);
do_drv_read(cmd);
set_cpus_allowed_ptr(current, &saved_mask);
} }
static void drv_write(struct drv_cmd *cmd) static void drv_write(struct drv_cmd *cmd)
{ {
cpumask_t saved_mask = current->cpus_allowed;
unsigned int i; unsigned int i;
for_each_cpu(i, cmd->mask) { for_each_cpu(i, cmd->mask) {
set_cpus_allowed_ptr(current, cpumask_of(i)); work_on_cpu(i, do_drv_write, cmd);
do_drv_write(cmd);
} }
set_cpus_allowed_ptr(current, &saved_mask);
return;
} }
static u32 get_cur_val(const struct cpumask *mask) static u32 get_cur_val(const struct cpumask *mask)
...@@ -367,7 +363,7 @@ static unsigned int get_cur_freq_on_cpu(unsigned int cpu) ...@@ -367,7 +363,7 @@ static unsigned int get_cur_freq_on_cpu(unsigned int cpu)
return freq; return freq;
} }
static unsigned int check_freqs(const cpumask_t *mask, unsigned int freq, static unsigned int check_freqs(const struct cpumask *mask, unsigned int freq,
struct acpi_cpufreq_data *data) struct acpi_cpufreq_data *data)
{ {
unsigned int cur_freq; unsigned int cur_freq;
......
...@@ -971,6 +971,8 @@ static int __devinit workqueue_cpu_callback(struct notifier_block *nfb, ...@@ -971,6 +971,8 @@ static int __devinit workqueue_cpu_callback(struct notifier_block *nfb,
} }
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
static struct workqueue_struct *work_on_cpu_wq __read_mostly;
struct work_for_cpu { struct work_for_cpu {
struct work_struct work; struct work_struct work;
long (*fn)(void *); long (*fn)(void *);
...@@ -991,8 +993,8 @@ static void do_work_for_cpu(struct work_struct *w) ...@@ -991,8 +993,8 @@ static void do_work_for_cpu(struct work_struct *w)
* @fn: the function to run * @fn: the function to run
* @arg: the function arg * @arg: the function arg
* *
* This will return -EINVAL in the cpu is not online, or the return value * This will return the value @fn returns.
* of @fn otherwise. * It is up to the caller to ensure that the cpu doesn't go offline.
*/ */
long work_on_cpu(unsigned int cpu, long (*fn)(void *), void *arg) long work_on_cpu(unsigned int cpu, long (*fn)(void *), void *arg)
{ {
...@@ -1001,14 +1003,8 @@ long work_on_cpu(unsigned int cpu, long (*fn)(void *), void *arg) ...@@ -1001,14 +1003,8 @@ long work_on_cpu(unsigned int cpu, long (*fn)(void *), void *arg)
INIT_WORK(&wfc.work, do_work_for_cpu); INIT_WORK(&wfc.work, do_work_for_cpu);
wfc.fn = fn; wfc.fn = fn;
wfc.arg = arg; wfc.arg = arg;
get_online_cpus(); queue_work_on(cpu, work_on_cpu_wq, &wfc.work);
if (unlikely(!cpu_online(cpu))) flush_work(&wfc.work);
wfc.ret = -EINVAL;
else {
schedule_work_on(cpu, &wfc.work);
flush_work(&wfc.work);
}
put_online_cpus();
return wfc.ret; return wfc.ret;
} }
...@@ -1025,4 +1021,8 @@ void __init init_workqueues(void) ...@@ -1025,4 +1021,8 @@ void __init init_workqueues(void)
hotcpu_notifier(workqueue_cpu_callback, 0); hotcpu_notifier(workqueue_cpu_callback, 0);
keventd_wq = create_workqueue("events"); keventd_wq = create_workqueue("events");
BUG_ON(!keventd_wq); BUG_ON(!keventd_wq);
#ifdef CONFIG_SMP
work_on_cpu_wq = create_workqueue("work_on_cpu");
BUG_ON(!work_on_cpu_wq);
#endif
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment