Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 56767
b: refs/heads/master
c: d3fdaed
h: refs/heads/master
i:
  56765: 411c8aa
  56763: 31f7b49
  56759: 85abe5e
  56751: 706f4ea
  56735: cd392b4
  56703: 55373ff
v: v3
  • Loading branch information
Hugh Dickins authored and Paul Mackerras committed May 22, 2007
1 parent e8fbaf9 commit 4e9a18d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d25790532370e7448e3d3bd25a17e1e9f1299816
refs/heads/master: d3fdaed9e973687f088c9c156a6e20870386e0b7
34 changes: 18 additions & 16 deletions trunk/arch/powerpc/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,6 @@ int smp_call_function_map(void (*func) (void *info), void *info, int nonatomic,
/* Can deadlock when called with interrupts disabled */
WARN_ON(irqs_disabled());

/* remove 'self' from the map */
if (cpu_isset(smp_processor_id(), map))
cpu_clear(smp_processor_id(), map);

/* sanity check the map, remove any non-online processors. */
cpus_and(map, map, cpu_online_map);

if (unlikely(smp_ops == NULL))
return ret;

Expand All @@ -222,10 +215,17 @@ int smp_call_function_map(void (*func) (void *info), void *info, int nonatomic,
/* Must grab online cpu count with preempt disabled, otherwise
* it can change. */
num_cpus = num_online_cpus() - 1;
if (!num_cpus || cpus_empty(map)) {
ret = 0;
goto out;
}
if (!num_cpus)
goto done;

/* remove 'self' from the map */
if (cpu_isset(smp_processor_id(), map))
cpu_clear(smp_processor_id(), map);

/* sanity check the map, remove any non-online processors. */
cpus_and(map, map, cpu_online_map);
if (cpus_empty(map))
goto done;

call_data = &data;
smp_wmb();
Expand Down Expand Up @@ -263,6 +263,7 @@ int smp_call_function_map(void (*func) (void *info), void *info, int nonatomic,
}
}

done:
ret = 0;

out:
Expand All @@ -282,16 +283,17 @@ EXPORT_SYMBOL(smp_call_function);
int smp_call_function_single(int cpu, void (*func) (void *info), void *info, int nonatomic,
int wait)
{
cpumask_t map=CPU_MASK_NONE;
cpumask_t map = CPU_MASK_NONE;
int ret = -EBUSY;

if (!cpu_online(cpu))
return -EINVAL;

if (cpu == smp_processor_id())
return -EBUSY;

cpu_set(cpu, map);
return smp_call_function_map(func,info,nonatomic,wait,map);
if (cpu != get_cpu())
ret = smp_call_function_map(func,info,nonatomic,wait,map);
put_cpu();
return ret;
}
EXPORT_SYMBOL(smp_call_function_single);

Expand Down

0 comments on commit 4e9a18d

Please sign in to comment.