mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Neil Zhang <zhangwm@marvell.com>
To: <linux@arm.linux.org.uk>
Cc: <linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	Neil Zhang <zhangwm@marvell.com>
Subject: [PATCH] arm: irq: fix the affinity when migrate a irq
Date: Fri, 15 Aug 2014 15:31:57 +0800	[thread overview]
Message-ID: <1408087917-22603-1-git-send-email-zhangwm@marvell.com> (raw)

Commit ffde1de64012 ("irqchip: Gic: Support forced affinity setting")
has enable the forcing cpu affinity of interrupts for gic.

The current code of migrate_one_irq will pass the current affinity mask
to irq_set_affinity with force is true, it may select the cpu being
offlined as the target CPU again, then the interrupt won't be migrated
correctly.

Signed-off-by: Neil Zhang <zhangwm@marvell.com>
---
 arch/arm/kernel/irq.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
index 2c42576..6f5a878 100644
--- a/arch/arm/kernel/irq.c
+++ b/arch/arm/kernel/irq.c
@@ -167,11 +167,10 @@ static bool migrate_one_irq(struct irq_desc *desc)
 	if (irqd_is_per_cpu(d) || !cpumask_test_cpu(smp_processor_id(), affinity))
 		return false;
 
-	if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) {
-		affinity = cpu_online_mask;
+	if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids)
 		ret = true;
-	}
 
+	affinity = cpu_online_mask;
 	c = irq_data_get_irq_chip(d);
 	if (!c->irq_set_affinity)
 		pr_debug("IRQ%u: unable to set affinity\n", d->irq);
-- 
1.7.9.5


             reply	other threads:[~2014-08-15  7:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-15  7:31 Neil Zhang [this message]
2014-08-15  8:45 ` Sudeep Holla
2014-08-15  9:45   ` Neil Zhang
2014-08-15  8:48 ` Russell King - ARM Linux

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=1408087917-22603-1-git-send-email-zhangwm@marvell.com \
    --to=zhangwm@marvell.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    /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®