Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 196633
b: refs/heads/master
c: b6decb7
h: refs/heads/master
i:
  196631: b66415d
v: v3
  • Loading branch information
Anton Blanchard authored and Benjamin Herrenschmidt committed May 6, 2010
1 parent f67f7f6 commit 2dd67d7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 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: bfb9126defa80cbed6d91ed9685b238b0d7e81c4
refs/heads/master: b6decb707952c678d110699abb5ed86d45ca6927
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/include/asm/smp.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ extern void smp_message_recv(int);
DECLARE_PER_CPU(unsigned int, cpu_pvr);

#ifdef CONFIG_HOTPLUG_CPU
extern void fixup_irqs(cpumask_t map);
extern void fixup_irqs(const struct cpumask *map);
int generic_cpu_disable(void);
int generic_cpu_enable(unsigned int cpu);
void generic_cpu_die(unsigned int cpu);
Expand Down
17 changes: 10 additions & 7 deletions trunk/arch/powerpc/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,30 +290,33 @@ u64 arch_irq_stat_cpu(unsigned int cpu)
}

#ifdef CONFIG_HOTPLUG_CPU
void fixup_irqs(cpumask_t map)
void fixup_irqs(const struct cpumask *map)
{
struct irq_desc *desc;
unsigned int irq;
static int warned;
cpumask_var_t mask;

for_each_irq(irq) {
cpumask_t mask;
alloc_cpumask_var(&mask, GFP_KERNEL);

for_each_irq(irq) {
desc = irq_to_desc(irq);
if (desc && desc->status & IRQ_PER_CPU)
continue;

cpumask_and(&mask, desc->affinity, &map);
if (any_online_cpu(mask) == NR_CPUS) {
cpumask_and(mask, desc->affinity, map);
if (cpumask_any(mask) >= nr_cpu_ids) {
printk("Breaking affinity for irq %i\n", irq);
mask = map;
cpumask_copy(mask, map);
}
if (desc->chip->set_affinity)
desc->chip->set_affinity(irq, &mask);
desc->chip->set_affinity(irq, mask);
else if (desc->action && !(warned++))
printk("Cannot set affinity for irq %i\n", irq);
}

free_cpumask_var(mask);

local_irq_enable();
mdelay(1);
local_irq_disable();
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/powerpc/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ int generic_cpu_disable(void)
set_cpu_online(cpu, false);
#ifdef CONFIG_PPC64
vdso_data->processorCount--;
fixup_irqs(cpu_online_map);
fixup_irqs(cpu_online_mask);
#endif
return 0;
}
Expand All @@ -333,7 +333,7 @@ int generic_cpu_enable(unsigned int cpu)
cpu_relax();

#ifdef CONFIG_PPC64
fixup_irqs(cpu_online_map);
fixup_irqs(cpu_online_mask);
/* counter the irq disable in fixup_irqs */
local_irq_enable();
#endif
Expand Down

0 comments on commit 2dd67d7

Please sign in to comment.