Skip to content

Commit 47a06d3

Browse files
committed
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 <[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 f0383c2 commit 47a06d3

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

kernel/irq/cpuhotplug.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ static bool migrate_one_irq(struct irq_desc *desc)
1818
{
1919
struct irq_data *d = irq_desc_get_irq_data(desc);
2020
struct irq_chip *chip = irq_data_get_irq_chip(d);
21+
bool maskchip = !irq_can_move_pcntxt(d) && !irqd_irq_masked(d);
2122
const struct cpumask *affinity;
2223
bool brokeaff = false;
2324
int err;
@@ -69,6 +70,10 @@ static bool migrate_one_irq(struct irq_desc *desc)
6970
if (irq_fixup_move_pending(desc, true))
7071
affinity = irq_desc_get_pending_mask(desc);
7172

73+
/* Mask the chip for interrupts which cannot move in process context */
74+
if (maskchip && chip->irq_mask)
75+
chip->irq_mask(d);
76+
7277
if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) {
7378
affinity = cpu_online_mask;
7479
brokeaff = true;
@@ -78,8 +83,12 @@ static bool migrate_one_irq(struct irq_desc *desc)
7883
if (err) {
7984
pr_warn_ratelimited("IRQ%u: set affinity failed(%d).\n",
8085
d->irq, err);
81-
return false;
86+
brokeaff = false;
8287
}
88+
89+
if (maskchip && chip->irq_unmask)
90+
chip->irq_unmask(d);
91+
8392
return brokeaff;
8493
}
8594

0 commit comments

Comments
 (0)