mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mike Travis <travis@sgi.com>
To: Ingo Molnar <mingo@redhat.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>,
	Andrew Morton <akpm@linux-foundation.org>,
	Jack Steiner <steiner@sgi.com>,
	linux-kernel@vger.kernel.org, <kernel@wantstofly.org>
Subject: [PATCH 2/8] arm irq: update arm for new irq_desc
Date: Mon, 12 Jan 2009 14:05:21 -0800	[thread overview]
Message-ID: <20090112220519.899197000@polaris-admin.engr.sgi.com> (raw)
In-Reply-To: <20090112220519.566749000@polaris-admin.engr.sgi.com>

[-- Attachment #1: irq:update-arm-to-new-irq_desc --]
[-- Type: text/plain, Size: 2441 bytes --]

Impact: cleanup, update to new cpumask API

Irq_desc.affinity and irq_desc.pending_mask are now cpumask_var_t's
so access to them should be using the new cpumask API.

Since CONFIG_CPUMASK_OFFSTACK is not likely to be enabled for the arm
architecture, double check that it is indeed not set, as we do not
allocate any variable-sized cpumask_var_t's.

Signed-off-by: Mike Travis <travis@sgi.com>
Cc: <kernel@wantstofly.org>
---
 arch/arm/kernel/irq.c               |   18 ++++++++++++------
 arch/arm/oprofile/op_model_mpcore.c |    2 +-
 2 files changed, 13 insertions(+), 7 deletions(-)

--- linux-2.6-for-ingo.orig/arch/arm/kernel/irq.c
+++ linux-2.6-for-ingo/arch/arm/kernel/irq.c
@@ -104,6 +104,11 @@ static struct irq_desc bad_irq_desc = {
 	.lock = SPIN_LOCK_UNLOCKED
 };
 
+#ifdef CONFIG_CPUMASK_OFFSTACK
+/* We are not allocating bad_irq_desc.affinity or .pending_mask */
+#error "ARM architecture does not support CONFIG_CPUMASK_OFFSTACK."
+#endif
+
 /*
  * do_IRQ handles all hardware IRQ's.  Decoded IRQs should not
  * come via this function.  Instead, they should provide their
@@ -161,7 +166,7 @@ void __init init_IRQ(void)
 		irq_desc[irq].status |= IRQ_NOREQUEST | IRQ_NOPROBE;
 
 #ifdef CONFIG_SMP
-	bad_irq_desc.affinity = CPU_MASK_ALL;
+	cpumask_setall(bad_irq_desc.affinity);
 	bad_irq_desc.cpu = smp_processor_id();
 #endif
 	init_arch_irq();
@@ -191,15 +196,16 @@ void migrate_irqs(void)
 		struct irq_desc *desc = irq_desc + i;
 
 		if (desc->cpu == cpu) {
-			unsigned int newcpu = any_online_cpu(desc->affinity);
-
-			if (newcpu == NR_CPUS) {
+			unsigned int newcpu = cpumask_any_and(desc->affinity,
+							      cpu_online_mask);
+			if (newcpu >= nr_cpu_ids) {
 				if (printk_ratelimit())
 					printk(KERN_INFO "IRQ%u no longer affine to CPU%u\n",
 					       i, cpu);
 
-				cpus_setall(desc->affinity);
-				newcpu = any_online_cpu(desc->affinity);
+				cpumask_setall(desc->affinity);
+				newcpu = cpumask_any_and(desc->affinity,
+							 cpu_online_mask);
 			}
 
 			route_irq(desc, i, newcpu);
--- linux-2.6-for-ingo.orig/arch/arm/oprofile/op_model_mpcore.c
+++ linux-2.6-for-ingo/arch/arm/oprofile/op_model_mpcore.c
@@ -263,7 +263,7 @@ static void em_route_irq(int irq, unsign
 	const struct cpumask *mask = cpumask_of(cpu);
 
 	spin_lock_irq(&desc->lock);
-	desc->affinity = *mask;
+	cpumask_copy(desc->affinity, mask);
 	desc->chip->set_affinity(irq, mask);
 	spin_unlock_irq(&desc->lock);
 }

-- 

  parent reply	other threads:[~2009-01-12 22:06 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-12 22:05 [PATCH 0/8] irq: update all archs to use new irq_desc cpumask_var_t's Mike Travis
2009-01-12 22:05 ` [PATCH 1/8] alpha irq: update alpha for new irq_desc Mike Travis
2009-01-12 22:05 ` Mike Travis [this message]
2009-01-12 22:05 ` [PATCH 3/8] blackfin irq: update blackfin " Mike Travis
2009-01-12 22:05 ` [PATCH 4/8] ia64 irq: update ia64 " Mike Travis
2009-01-12 22:05 ` [PATCH 5/8] mips irq: update mips " Mike Travis
2009-01-12 22:05 ` [PATCH 6/8] parisc irq: update parisc " Mike Travis
2009-01-13  6:04   ` Kyle McMartin
2009-01-12 22:05 ` [PATCH 7/8] powerpc irq: update powerpc " Mike Travis
2009-01-12 22:05 ` [PATCH 8/8] sparc irq: update sparc " Mike Travis
2009-01-12 22:07 ` [PATCH 0/8] irq: update all archs to use new irq_desc cpumask_var_t's Mike Frysinger
2009-01-13  1:21   ` Mike Travis
2009-01-13  1:25     ` Mike Frysinger
2009-01-12 22:20 ` Ingo Molnar
2009-01-12 22:21 ` Ingo Molnar
2009-01-12 22:31   ` Mike Travis
2009-01-12 22:52     ` Ingo Molnar
2009-01-13  0:15   ` Mike Travis
2009-01-14 11:14     ` Ingo Molnar

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=20090112220519.899197000@polaris-admin.engr.sgi.com \
    --to=travis@sgi.com \
    --cc=akpm@linux-foundation.org \
    --cc=kernel@wantstofly.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rusty@rustcorp.com.au \
    --cc=steiner@sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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

all inboxes | Powered by JetHome®