From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753453AbdFVRNt (ORCPT ); Thu, 22 Jun 2017 13:13:49 -0400 Received: from terminus.zytor.com ([65.50.211.136]:59553 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752392AbdFVRNr (ORCPT ); Thu, 22 Jun 2017 13:13:47 -0400 Date: Thu, 22 Jun 2017 10:09:07 -0700 From: tip-bot for Thomas Gleixner Message-ID: Cc: mingo@kernel.org, linux-kernel@vger.kernel.org, hpa@zytor.com, axboe@kernel.dk, hch@lst.de, peterz@infradead.org, marc.zyngier@arm.com, mpe@ellerman.id.au, keith.busch@intel.com, tglx@linutronix.de Reply-To: linux-kernel@vger.kernel.org, mingo@kernel.org, peterz@infradead.org, hch@lst.de, axboe@kernel.dk, hpa@zytor.com, mpe@ellerman.id.au, marc.zyngier@arm.com, tglx@linutronix.de, keith.busch@intel.com In-Reply-To: <20170619235447.352343969@linutronix.de> References: <20170619235447.352343969@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:irq/core] genirq: Introduce IRQD_SINGLE_TARGET flag Git-Commit-ID: d52dd44175bd27ad9d8e34a994fb80877c1f6d61 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 Archived-At: List-Archive: List-Post: Commit-ID: d52dd44175bd27ad9d8e34a994fb80877c1f6d61 Gitweb: http://git.kernel.org/tip/d52dd44175bd27ad9d8e34a994fb80877c1f6d61 Author: Thomas Gleixner AuthorDate: Tue, 20 Jun 2017 01:37:52 +0200 Committer: Thomas Gleixner CommitDate: Thu, 22 Jun 2017 18:21:25 +0200 genirq: Introduce IRQD_SINGLE_TARGET flag Many interrupt chips allow only a single CPU as interrupt target. The core code has no knowledge about that. That's unfortunate as it could avoid trying to readd a newly online CPU to the effective affinity mask. Add the status flag and the necessary accessors. 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/20170619235447.352343969@linutronix.de --- include/linux/irq.h | 16 ++++++++++++++++ kernel/irq/debugfs.c | 1 + 2 files changed, 17 insertions(+) diff --git a/include/linux/irq.h b/include/linux/irq.h index 19cea63..00db35b 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h @@ -209,6 +209,7 @@ struct irq_data { * IRQD_IRQ_STARTED - Startup state of the interrupt * IRQD_MANAGED_SHUTDOWN - Interrupt was shutdown due to empty affinity * mask. Applies only to affinity managed irqs. + * IRQD_SINGLE_TARGET - IRQ allows only a single affinity target */ enum { IRQD_TRIGGER_MASK = 0xf, @@ -228,6 +229,7 @@ enum { IRQD_AFFINITY_MANAGED = (1 << 21), IRQD_IRQ_STARTED = (1 << 22), IRQD_MANAGED_SHUTDOWN = (1 << 23), + IRQD_SINGLE_TARGET = (1 << 24), }; #define __irqd_to_state(d) ACCESS_PRIVATE((d)->common, state_use_accessors) @@ -276,6 +278,20 @@ static inline bool irqd_is_level_type(struct irq_data *d) return __irqd_to_state(d) & IRQD_LEVEL; } +/* + * Must only be called of irqchip.irq_set_affinity() or low level + * hieararchy domain allocation functions. + */ +static inline void irqd_set_single_target(struct irq_data *d) +{ + __irqd_to_state(d) |= IRQD_SINGLE_TARGET; +} + +static inline bool irqd_is_single_target(struct irq_data *d) +{ + return __irqd_to_state(d) & IRQD_SINGLE_TARGET; +} + static inline bool irqd_is_wakeup_set(struct irq_data *d) { return __irqd_to_state(d) & IRQD_WAKEUP_STATE; diff --git a/kernel/irq/debugfs.c b/kernel/irq/debugfs.c index edbef25..dbd6e78 100644 --- a/kernel/irq/debugfs.c +++ b/kernel/irq/debugfs.c @@ -105,6 +105,7 @@ static const struct irq_bit_descr irqdata_states[] = { BIT_MASK_DESCR(IRQD_PER_CPU), BIT_MASK_DESCR(IRQD_NO_BALANCING), + BIT_MASK_DESCR(IRQD_SINGLE_TARGET), BIT_MASK_DESCR(IRQD_MOVE_PCNTXT), BIT_MASK_DESCR(IRQD_AFFINITY_SET), BIT_MASK_DESCR(IRQD_SETAFFINITY_PENDING),