Skip to content

Commit d52dd44

Browse files
committed
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 <[email protected]> Cc: Jens Axboe <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: Keith Busch <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Christoph Hellwig <[email protected]> Link: http://lkml.kernel.org/r/[email protected]
1 parent c5cb83b commit d52dd44

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

include/linux/irq.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ struct irq_data {
209209
* IRQD_IRQ_STARTED - Startup state of the interrupt
210210
* IRQD_MANAGED_SHUTDOWN - Interrupt was shutdown due to empty affinity
211211
* mask. Applies only to affinity managed irqs.
212+
* IRQD_SINGLE_TARGET - IRQ allows only a single affinity target
212213
*/
213214
enum {
214215
IRQD_TRIGGER_MASK = 0xf,
@@ -228,6 +229,7 @@ enum {
228229
IRQD_AFFINITY_MANAGED = (1 << 21),
229230
IRQD_IRQ_STARTED = (1 << 22),
230231
IRQD_MANAGED_SHUTDOWN = (1 << 23),
232+
IRQD_SINGLE_TARGET = (1 << 24),
231233
};
232234

233235
#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)
276278
return __irqd_to_state(d) & IRQD_LEVEL;
277279
}
278280

281+
/*
282+
* Must only be called of irqchip.irq_set_affinity() or low level
283+
* hieararchy domain allocation functions.
284+
*/
285+
static inline void irqd_set_single_target(struct irq_data *d)
286+
{
287+
__irqd_to_state(d) |= IRQD_SINGLE_TARGET;
288+
}
289+
290+
static inline bool irqd_is_single_target(struct irq_data *d)
291+
{
292+
return __irqd_to_state(d) & IRQD_SINGLE_TARGET;
293+
}
294+
279295
static inline bool irqd_is_wakeup_set(struct irq_data *d)
280296
{
281297
return __irqd_to_state(d) & IRQD_WAKEUP_STATE;

kernel/irq/debugfs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ static const struct irq_bit_descr irqdata_states[] = {
105105
BIT_MASK_DESCR(IRQD_PER_CPU),
106106
BIT_MASK_DESCR(IRQD_NO_BALANCING),
107107

108+
BIT_MASK_DESCR(IRQD_SINGLE_TARGET),
108109
BIT_MASK_DESCR(IRQD_MOVE_PCNTXT),
109110
BIT_MASK_DESCR(IRQD_AFFINITY_SET),
110111
BIT_MASK_DESCR(IRQD_SETAFFINITY_PENDING),

0 commit comments

Comments
 (0)