Skip to content

Commit 06efc7d

Browse files
committed
Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull irq fix from Thomas Gleixner: "Fix for a regression caused by the conversion of x86 to the generic hotplug code. Instead of doing a plain single line revert, this adds a pile of comments so the semantics of the force argument are clear" * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: genirq/cpuhotplug: Revert "Set force affinity flag on hotplug migration"
2 parents 0a07b23 + 8397913 commit 06efc7d

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

include/linux/irq.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,12 @@ static inline irq_hw_number_t irqd_to_hwirq(struct irq_data *d)
388388
* @irq_mask_ack: ack and mask an interrupt source
389389
* @irq_unmask: unmask an interrupt source
390390
* @irq_eoi: end of interrupt
391-
* @irq_set_affinity: set the CPU affinity on SMP machines
391+
* @irq_set_affinity: Set the CPU affinity on SMP machines. If the force
392+
* argument is true, it tells the driver to
393+
* unconditionally apply the affinity setting. Sanity
394+
* checks against the supplied affinity mask are not
395+
* required. This is used for CPU hotplug where the
396+
* target CPU is not yet set in the cpu_online_mask.
392397
* @irq_retrigger: resend an IRQ to the CPU
393398
* @irq_set_type: set the flow type (IRQ_TYPE_LEVEL/etc.) of an IRQ
394399
* @irq_set_wake: enable/disable power-management wake-on of an IRQ

kernel/irq/cpuhotplug.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,13 @@ static bool migrate_one_irq(struct irq_desc *desc)
9595
affinity = cpu_online_mask;
9696
brokeaff = true;
9797
}
98-
99-
err = irq_do_set_affinity(d, affinity, true);
98+
/*
99+
* Do not set the force argument of irq_do_set_affinity() as this
100+
* disables the masking of offline CPUs from the supplied affinity
101+
* mask and therefore might keep/reassign the irq to the outgoing
102+
* CPU.
103+
*/
104+
err = irq_do_set_affinity(d, affinity, false);
100105
if (err) {
101106
pr_warn_ratelimited("IRQ%u: set affinity failed(%d).\n",
102107
d->irq, err);

0 commit comments

Comments
 (0)