Skip to content

Commit 2e05155

Browse files
committed
genirq: Move initial affinity setup to irq_startup()
The startup vs. setaffinity ordering of interrupts depends on the IRQF_NOAUTOEN flag. Chained interrupts are not getting any affinity assignment at all. A regular interrupt is started up and then the affinity is set. A IRQF_NOAUTOEN marked interrupt is not started up, but the affinity is set nevertheless. Move the affinity setup to startup_irq() so the ordering is always the same and chained interrupts get the proper default affinity assigned as well. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Jens Axboe <axboe@kernel.dk> Cc: Marc Zyngier <marc.zyngier@arm.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Keith Busch <keith.busch@intel.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Christoph Hellwig <hch@lst.de> Link: http://lkml.kernel.org/r/20170619235445.020534783@linutronix.de
1 parent 43564bd commit 2e05155

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

kernel/irq/chip.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,8 @@ int irq_startup(struct irq_desc *desc, bool resend)
213213
irq_enable(desc);
214214
}
215215
irq_state_set_started(desc);
216+
/* Set default affinity mask once everything is setup */
217+
irq_setup_affinity(desc);
216218
}
217219

218220
if (resend)

kernel/irq/manage.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1327,6 +1327,12 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
13271327
if (new->flags & IRQF_ONESHOT)
13281328
desc->istate |= IRQS_ONESHOT;
13291329

1330+
/* Exclude IRQ from balancing if requested */
1331+
if (new->flags & IRQF_NOBALANCING) {
1332+
irq_settings_set_no_balancing(desc);
1333+
irqd_set(&desc->irq_data, IRQD_NO_BALANCING);
1334+
}
1335+
13301336
if (irq_settings_can_autoenable(desc)) {
13311337
irq_startup(desc, true);
13321338
} else {
@@ -1341,15 +1347,6 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
13411347
desc->depth = 1;
13421348
}
13431349

1344-
/* Exclude IRQ from balancing if requested */
1345-
if (new->flags & IRQF_NOBALANCING) {
1346-
irq_settings_set_no_balancing(desc);
1347-
irqd_set(&desc->irq_data, IRQD_NO_BALANCING);
1348-
}
1349-
1350-
/* Set default affinity mask once everything is setup */
1351-
irq_setup_affinity(desc);
1352-
13531350
} else if (new->flags & IRQF_TRIGGER_MASK) {
13541351
unsigned int nmsk = new->flags & IRQF_TRIGGER_MASK;
13551352
unsigned int omsk = irqd_get_trigger_type(&desc->irq_data);

0 commit comments

Comments
 (0)