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: 0f67911e821c ("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

authored by Andrew Bresticker and committed by Thomas Gleixner 08fb6248 fb0ea6e4

+5 -5
+5 -5
drivers/irqchip/irq-riscv-imsic-state.c
··· 208 } 209 210 #ifdef CONFIG_SMP 211 - static void __imsic_local_timer_start(struct imsic_local_priv *lpriv) 212 { 213 lockdep_assert_held(&lpriv->lock); 214 215 if (!timer_pending(&lpriv->timer)) { 216 lpriv->timer.expires = jiffies + 1; 217 - add_timer_on(&lpriv->timer, smp_processor_id()); 218 } 219 } 220 #else 221 - static inline void __imsic_local_timer_start(struct imsic_local_priv *lpriv) 222 { 223 } 224 #endif ··· 233 if (force_all) 234 bitmap_fill(lpriv->dirty_bitmap, imsic->global.nr_ids + 1); 235 if (!__imsic_local_sync(lpriv)) 236 - __imsic_local_timer_start(lpriv); 237 238 raw_spin_unlock_irqrestore(&lpriv->lock, flags); 239 } ··· 278 return; 279 } 280 281 - __imsic_local_timer_start(lpriv); 282 } 283 } 284 #else
··· 208 } 209 210 #ifdef CONFIG_SMP 211 + static void __imsic_local_timer_start(struct imsic_local_priv *lpriv, unsigned int cpu) 212 { 213 lockdep_assert_held(&lpriv->lock); 214 215 if (!timer_pending(&lpriv->timer)) { 216 lpriv->timer.expires = jiffies + 1; 217 + add_timer_on(&lpriv->timer, cpu); 218 } 219 } 220 #else 221 + static inline void __imsic_local_timer_start(struct imsic_local_priv *lpriv, unsigned int cpu) 222 { 223 } 224 #endif ··· 233 if (force_all) 234 bitmap_fill(lpriv->dirty_bitmap, imsic->global.nr_ids + 1); 235 if (!__imsic_local_sync(lpriv)) 236 + __imsic_local_timer_start(lpriv, smp_processor_id()); 237 238 raw_spin_unlock_irqrestore(&lpriv->lock, flags); 239 } ··· 278 return; 279 } 280 281 + __imsic_local_timer_start(lpriv, cpu); 282 } 283 } 284 #else