irqchip/riscv-imsic: Start local sync timer on correct CPU
Subsystems (3)
PATCH 1/1 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.
--- drivers/irqchip/irq-riscv-imsic-state.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/irqchip/irq-riscv-imsic-state.c +5 -5
@@ -208,17 +208,17 @@ static bool __imsic_local_sync(struct imsic_local_priv *lpriv) }#ifdef CONFIG_SMP -static void __imsic_local_timer_start (struct imsic_local_priv *lpriv) +static void __imsic_local_timer_start (struct imsic_local_priv *lpriv,unsigned int cpu) {lockdep_assert_held (&lpriv->lock);if (!timer_pending (&lpriv->timer)) { lpriv->timer.expires = jiffies +1 ; -add_timer_on (&lpriv->timer,smp_processor_id ()); +add_timer_on (&lpriv->timer, cpu); } }#else -static inline void __imsic_local_timer_start (struct imsic_local_priv *lpriv) +static inline void __imsic_local_timer_start (struct imsic_local_priv *lpriv,unsigned int cpu) { }#endif
@@ -233,7 +233,7 @@ void imsic_local_sync_all(bool force_all)if (force_all)bitmap_fill (lpriv->dirty_bitmap, imsic->global.nr_ids +1 );if (!__imsic_local_sync (lpriv)) -__imsic_local_timer_start (lpriv); +__imsic_local_timer_start (lpriv,smp_processor_id ());raw_spin_unlock_irqrestore (&lpriv->lock, flags); }
@@ -278,7 +278,7 @@ static void __imsic_remote_sync(struct imsic_local_priv *lpriv, unsigned int cpu return; } -__imsic_local_timer_start (lpriv); +__imsic_local_timer_start (lpriv, cpu); } }#else
Signature · 1 line
2.43.0
Quoted 9 lines · Andrew Bresticker
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 <[email protected]>
My bad. Thanks for catching the issue.
Regards,
Anup
Quoted 50 lines
--- drivers/irqchip/irq-riscv-imsic-state.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)drivers/irqchip/irq-riscv-imsic-state.c +5
-6@@ -208,17 +208,17 @@ static bool __imsic_local_sync(struct imsic_local_priv *lpriv) }#ifdef CONFIG_SMP -static void __imsic_local_timer_start (struct imsic_local_priv *lpriv) +static void __imsic_local_timer_start (struct imsic_local_priv *lpriv,unsigned int cpu) {lockdep_assert_held (&lpriv->lock);if (!timer_pending (&lpriv->timer)) { lpriv->timer.expires = jiffies +1 ; -add_timer_on (&lpriv->timer,smp_processor_id ()); +add_timer_on (&lpriv->timer, cpu); } }#else -static inline void __imsic_local_timer_start (struct imsic_local_priv *lpriv) +static inline void __imsic_local_timer_start (struct imsic_local_priv *lpriv,unsigned int cpu) { }#endif @@ -233,7 +233,7 @@ void imsic_local_sync_all(bool force_all)if (force_all)bitmap_fill (lpriv->dirty_bitmap, imsic->global.nr_ids +1 );if (!__imsic_local_sync (lpriv)) -__imsic_local_timer_start (lpriv); +__imsic_local_timer_start (lpriv,smp_processor_id ());raw_spin_unlock_irqrestore (&lpriv->lock, flags); }@@ -278,7 +278,7 @@ static void __imsic_remote_sync(struct imsic_local_priv *lpriv, unsigned int cpu return; } -__imsic_local_timer_start (lpriv); +__imsic_local_timer_start (lpriv, cpu); } }#else --2.43.0
The following commit has been merged into the irq/urgent branch of tip:
The following commit has been merged into the irq/urgent branch of tip:
Commit-ID: 08fb624802d8786253994d8ebdbbcdaa186f04f5 Gitweb: https://git.kernel.org/tip/08fb624802d8786253994d8ebdbbcdaa186f04f5 Author: Andrew Bresticker <[email protected]> AuthorDate: Wed, 14 May 2025 10:13:20 -07:00 Committer: Thomas Gleixner <[email protected]> CommitterDate: Thu, 15 May 2025 16:01:50 +02:00
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.
--- drivers/irqchip/irq-riscv-imsic-state.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/irqchip/irq-riscv-imsic-state.c +5 -5
@@ -208,17 +208,17 @@ skip: }#ifdef CONFIG_SMP -static void __imsic_local_timer_start (struct imsic_local_priv *lpriv) +static void __imsic_local_timer_start (struct imsic_local_priv *lpriv,unsigned int cpu) {lockdep_assert_held (&lpriv->lock);if (!timer_pending (&lpriv->timer)) { lpriv->timer.expires = jiffies +1 ; -add_timer_on (&lpriv->timer,smp_processor_id ()); +add_timer_on (&lpriv->timer, cpu); } }#else -static inline void __imsic_local_timer_start (struct imsic_local_priv *lpriv) +static inline void __imsic_local_timer_start (struct imsic_local_priv *lpriv,unsigned int cpu) { }#endif
@@ -233,7 +233,7 @@ void imsic_local_sync_all(bool force_all)if (force_all)bitmap_fill (lpriv->dirty_bitmap, imsic->global.nr_ids +1 );if (!__imsic_local_sync (lpriv)) -__imsic_local_timer_start (lpriv); +__imsic_local_timer_start (lpriv,smp_processor_id ());raw_spin_unlock_irqrestore (&lpriv->lock, flags); }
@@ -278,7 +278,7 @@ static void __imsic_remote_sync(struct imsic_local_priv *lpriv, unsigned int cpu return; } -__imsic_local_timer_start (lpriv); +__imsic_local_timer_start (lpriv, cpu); } }#else
This patch was applied to riscv/linux.git (fixes) by Thomas Gleixner <[email protected]>:
Hello:
This patch was applied to riscv/linux.git (fixes)
by Thomas Gleixner <[email protected]>:
Quoted 10 lines · On Wed, 14 May 2025 10:13:20 -0700 you wrote:
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 <[email protected]>[...]
Here is the summary with links:
- irqchip/riscv-imsic: Start local sync timer on correct CPU
https://git.kernel.org/riscv/c/08fb624802d8
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
Quoted 4 lines · patchwork-bot
Hello:
This patch was applied to riscv/linux.git (fixes)
by Thomas Gleixner <[email protected]>:
No. I never apply patches to the riscv tree :)
Quoted 10 lines · On Wed, 14 May 2025 10:13:20 -0700 you wrote:
Quoted 9 lines
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 <[email protected]>
Quoted 7 lines
Quoted 1 line
[...]
Here is the summary with links:
- irqchip/riscv-imsic: Start local sync timer on correct CPUhttps://git.kernel.org/riscv/c/08fb624802d8You are awesome, thank you!
That patch has been committed to the tip tree and is already upstream.
Can you fix your bot scripts please?