Skip to content

Commit 08fb624

Browse files
abrestic-rivosKAGA-KOKO
authored andcommitted
irqchip/riscv-imsic: Start local sync timer on correct CPU
When starting the local sync timer to synchronize the state of a remote CPU it should be added on the CPU to be synchronized, not the initiating CPU. This results in interrupt delivery being delayed until the timer eventually runs (due to another mask/unmask/migrate operation) on the target CPU. Fixes: 0f67911 ("irqchip/riscv-imsic: Separate next and previous pointers in IMSIC vector") Signed-off-by: Andrew Bresticker <abrestic@rivosinc.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Anup Patel <anup@brainfault.org> Link: https://lore.kernel.org/all/20250514171320.3494917-1-abrestic@rivosinc.com
1 parent fb0ea6e commit 08fb624

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/irqchip/irq-riscv-imsic-state.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -208,17 +208,17 @@ static bool __imsic_local_sync(struct imsic_local_priv *lpriv)
208208
}
209209

210210
#ifdef CONFIG_SMP
211-
static void __imsic_local_timer_start(struct imsic_local_priv *lpriv)
211+
static void __imsic_local_timer_start(struct imsic_local_priv *lpriv, unsigned int cpu)
212212
{
213213
lockdep_assert_held(&lpriv->lock);
214214

215215
if (!timer_pending(&lpriv->timer)) {
216216
lpriv->timer.expires = jiffies + 1;
217-
add_timer_on(&lpriv->timer, smp_processor_id());
217+
add_timer_on(&lpriv->timer, cpu);
218218
}
219219
}
220220
#else
221-
static inline void __imsic_local_timer_start(struct imsic_local_priv *lpriv)
221+
static inline void __imsic_local_timer_start(struct imsic_local_priv *lpriv, unsigned int cpu)
222222
{
223223
}
224224
#endif
@@ -233,7 +233,7 @@ void imsic_local_sync_all(bool force_all)
233233
if (force_all)
234234
bitmap_fill(lpriv->dirty_bitmap, imsic->global.nr_ids + 1);
235235
if (!__imsic_local_sync(lpriv))
236-
__imsic_local_timer_start(lpriv);
236+
__imsic_local_timer_start(lpriv, smp_processor_id());
237237

238238
raw_spin_unlock_irqrestore(&lpriv->lock, flags);
239239
}
@@ -278,7 +278,7 @@ static void __imsic_remote_sync(struct imsic_local_priv *lpriv, unsigned int cpu
278278
return;
279279
}
280280

281-
__imsic_local_timer_start(lpriv);
281+
__imsic_local_timer_start(lpriv, cpu);
282282
}
283283
}
284284
#else

0 commit comments

Comments
 (0)