public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Anton Blanchard <anton@samba•org>
To: benh@kernel•crashing.org, rusty@rustcorp•com.au
Cc: linuxppc-dev@ozlabs•org
Subject: [patch 04/15] powerpc: cpumask: Convert fixup_irqs to new cpumask API
Date: Tue, 27 Apr 2010 11:32:35 +1000	[thread overview]
Message-ID: <20100427013431.893354454@samba.org> (raw)
In-Reply-To: 20100427013231.510168034@samba.org

Use new cpumask_* functions, and dynamically allocate cpumask in fixup_irqs.

Signed-off-by: Anton Blanchard <anton@samba•org>
---

Index: linux-cpumask/arch/powerpc/kernel/irq.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/kernel/irq.c	2010-04-08 19:46:04.269196650 +1000
+++ linux-cpumask/arch/powerpc/kernel/irq.c	2010-04-22 13:03:14.615446106 +1000
@@ -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();
Index: linux-cpumask/arch/powerpc/kernel/smp.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/kernel/smp.c	2010-04-22 13:03:13.025446124 +1000
+++ linux-cpumask/arch/powerpc/kernel/smp.c	2010-04-22 13:03:14.615446106 +1000
@@ -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;
 }
@@ -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
Index: linux-cpumask/arch/powerpc/include/asm/smp.h
===================================================================
--- linux-cpumask.orig/arch/powerpc/include/asm/smp.h	2010-04-08 19:46:04.299203515 +1000
+++ linux-cpumask/arch/powerpc/include/asm/smp.h	2010-04-22 13:03:14.635445670 +1000
@@ -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);

  parent reply	other threads:[~2010-04-27  1:32 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-27  1:32 [patch 00/15] PowerPC cpumask patches Anton Blanchard
2010-04-27  1:32 ` [patch 01/15] powerpc: cpumask: Use cpu_online_mask Anton Blanchard
2010-04-27  1:32 ` [patch 02/15] powerpc: cpumask: Convert rtasd to new cpumask API Anton Blanchard
2010-04-27  1:32 ` [patch 03/15] powerpc: cpumask: Convert smp_cpus_done " Anton Blanchard
2010-04-28  2:09   ` Stephen Rothwell
2010-04-27  1:32 ` Anton Blanchard [this message]
2010-04-27  1:32 ` [patch 05/15] powerpc: cpumask: Convert iseries SMP code " Anton Blanchard
2010-04-27  1:32 ` [patch 06/15] powerpc: cpumask: Convert pseries " Anton Blanchard
2010-04-27  1:32 ` [patch 07/15] powerpc: cpumask: Convert xics driver " Anton Blanchard
2010-04-27  1:32 ` [patch 08/15] powerpc: cpumask: Refactor /proc/cpuinfo code Anton Blanchard
2010-04-27  1:32 ` [patch 09/15] powerpc: cpumask: Convert /proc/cpuinfo to new cpumask API Anton Blanchard
2010-04-27  1:32 ` [patch 10/15] powerpc: cpumask: Dynamically allocate cpu_sibling_map and cpu_core_map cpumasks Anton Blanchard
2010-04-27  1:32 ` [patch 11/15] powerpc: cpumask: Convert hotplug-cpu code to new cpumask API Anton Blanchard
2010-04-27  1:32 ` [patch 12/15] powerpc: cpumask: Convert NUMA " Anton Blanchard
2010-04-27  1:32 ` [patch 13/15] powerpc: cpumask: Update some comments Anton Blanchard
2010-04-27  1:32 ` [patch 14/15] powerpc: cpumask: Convert mpic driver to new cpumask API Anton Blanchard
2010-04-27  1:32 ` [patch 15/15] powerpc: cpumask: Add DEBUG_PER_CPU_MAPS option Anton Blanchard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100427013431.893354454@samba.org \
    --to=anton@samba$(echo .)org \
    --cc=benh@kernel$(echo .)crashing.org \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    --cc=rusty@rustcorp$(echo .)com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox