From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753583AbdFVRBQ (ORCPT ); Thu, 22 Jun 2017 13:01:16 -0400 Received: from terminus.zytor.com ([65.50.211.136]:60807 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753301AbdFVRBP (ORCPT ); Thu, 22 Jun 2017 13:01:15 -0400 Date: Thu, 22 Jun 2017 09:56:38 -0700 From: tip-bot for Thomas Gleixner Message-ID: Cc: hch@lst.de, mingo@kernel.org, linux-kernel@vger.kernel.org, mpe@ellerman.id.au, axboe@kernel.dk, tglx@linutronix.de, marc.zyngier@arm.com, hpa@zytor.com, keith.busch@intel.com, peterz@infradead.org Reply-To: mingo@kernel.org, mpe@ellerman.id.au, linux-kernel@vger.kernel.org, axboe@kernel.dk, hch@lst.de, keith.busch@intel.com, hpa@zytor.com, peterz@infradead.org, tglx@linutronix.de, marc.zyngier@arm.com In-Reply-To: <20170619235445.604565591@linutronix.de> References: <20170619235445.604565591@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:irq/core] genirq/cpuhotplug: Add support for conditional masking Git-Commit-ID: 47a06d3a783217acae02976f15ca07ddc1ac024f X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 47a06d3a783217acae02976f15ca07ddc1ac024f Gitweb: http://git.kernel.org/tip/47a06d3a783217acae02976f15ca07ddc1ac024f Author: Thomas Gleixner AuthorDate: Tue, 20 Jun 2017 01:37:30 +0200 Committer: Thomas Gleixner CommitDate: Thu, 22 Jun 2017 18:21:17 +0200 genirq/cpuhotplug: Add support for conditional masking Interrupts which cannot be migrated in process context, need to be masked before the affinity is changed forcefully. Add support for that. Will be compiled out for architectures which do not have this x86 specific issue. Signed-off-by: Thomas Gleixner Cc: Jens Axboe Cc: Marc Zyngier Cc: Michael Ellerman Cc: Keith Busch Cc: Peter Zijlstra Cc: Christoph Hellwig Link: http://lkml.kernel.org/r/20170619235445.604565591@linutronix.de --- kernel/irq/cpuhotplug.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/kernel/irq/cpuhotplug.c b/kernel/irq/cpuhotplug.c index 4be4bd6..6f46587 100644 --- a/kernel/irq/cpuhotplug.c +++ b/kernel/irq/cpuhotplug.c @@ -18,6 +18,7 @@ static bool migrate_one_irq(struct irq_desc *desc) { struct irq_data *d = irq_desc_get_irq_data(desc); struct irq_chip *chip = irq_data_get_irq_chip(d); + bool maskchip = !irq_can_move_pcntxt(d) && !irqd_irq_masked(d); const struct cpumask *affinity; bool brokeaff = false; int err; @@ -69,6 +70,10 @@ static bool migrate_one_irq(struct irq_desc *desc) if (irq_fixup_move_pending(desc, true)) affinity = irq_desc_get_pending_mask(desc); + /* Mask the chip for interrupts which cannot move in process context */ + if (maskchip && chip->irq_mask) + chip->irq_mask(d); + if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) { affinity = cpu_online_mask; brokeaff = true; @@ -78,8 +83,12 @@ static bool migrate_one_irq(struct irq_desc *desc) if (err) { pr_warn_ratelimited("IRQ%u: set affinity failed(%d).\n", d->irq, err); - return false; + brokeaff = false; } + + if (maskchip && chip->irq_unmask) + chip->irq_unmask(d); + return brokeaff; }