Skip to content

Commit ff67db0

Browse files
bypelwell
authored andcommitted
mfd: rp1: fix IRQ thread affinity on PREEMPT_RT
rp1_irq_set_affinity() delegates to msi_domain_set_affinity() but does not call irq_data_update_effective_affinity() and does not return IRQ_SET_MASK_OK_DONE. Without this, the generic IRQ core never calls irq_set_thread_affinity(), so on PREEMPT_RT the force-threaded handler remains pinned to its original CPU even though the hardware interrupt is steered correctly. This causes PPS timestamps to be captured on a non-isolated CPU, adding variable latency to precision timing applications. Fix by updating the effective affinity and returning IRQ_SET_MASK_OK_DONE on success. Fixes: #7301 Signed-off-by: Michael Byczkowski <by@by-online.de>
1 parent 23d84d1 commit ff67db0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/mfd/rp1.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,14 @@ static int rp1_irq_set_affinity(struct irq_data *irqd, const struct cpumask *des
145145
{
146146
struct rp1_dev *rp1 = irqd->domain->host_data;
147147
struct irq_data *pcie_irqd = rp1->pcie_irqds[irqd->hwirq];
148+
int ret;
148149

149-
return msi_domain_set_affinity(pcie_irqd, dest, force);
150+
ret = msi_domain_set_affinity(pcie_irqd, dest, force);
151+
if (ret >= 0) {
152+
irq_data_update_effective_affinity(irqd, dest);
153+
return IRQ_SET_MASK_OK_DONE;
154+
}
155+
return ret;
150156
}
151157

152158
static struct irq_chip rp1_irq_chip = {

0 commit comments

Comments
 (0)