Skip to content

Commit cffb717

Browse files
ozbenhmpe
authored andcommitted
powerpc/xive: Ensure active irqd when setting affinity
Ensure irqd is active before attempting to set affinity. This should make the set affinity code more robust. For instance, this prevents these messages seen on a 4.12 based kernel when taking cpus offline: [ 123.053037264,3] XIVE[ IC 00 ] ISN 2 lead to invalid IVE ! [ 77.885859] xive: Error -6 reconfiguring irq 17 [ 77.885862] IRQ17: set affinity failed(-6). That particular case has been fixed in 4.13-rc1 by commit 91f26cb ("genirq/cpuhotplug: Do not migrated shutdown irqs"). Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent 04019bf commit cffb717

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arch/powerpc/sysdev/xive/common.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,10 @@ static int xive_irq_set_affinity(struct irq_data *d,
672672
if (cpumask_any_and(cpumask, cpu_online_mask) >= nr_cpu_ids)
673673
return -EINVAL;
674674

675+
/* Don't do anything if the interrupt isn't started */
676+
if (!irqd_is_started(d))
677+
return IRQ_SET_MASK_OK;
678+
675679
/*
676680
* If existing target is already in the new mask, and is
677681
* online then do nothing.

0 commit comments

Comments
 (0)