Skip to contentSkip to conversation

timers: replace in_irq() with

PATCH Applied [email protected] 3 participants 3 messages Oct 12, 2022 – Oct 17, 2022 High-resolution timers, timer wheel, clockevents

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 timers: replace in_irq() with

From: ye xingchen <[email protected]>

Replace the obsolete and ambiguos macro in_irq() with new macro in_hardirq().

---
v1 -> v2
Replace both instances of in_irq() in the flie.

 kernel/time/timer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/time/timer.c +1 -1
index 717fcb9fb14a..8872670a285e 100644
@@ -1422,7 +1422,7 @@ int del_timer_sync(struct timer_list *timer)
 	 * don't use it in hardirq context, because it
 	 * could lead to deadlock.
 	 */
-	WARN_ON(in_irq() && !(timer->flags & TIMER_IRQSAFE));
+	WARN_ON(in_hardirq() && !(timer->flags & TIMER_IRQSAFE));
 
 	/*
 	 * Must be able to sleep on PREEMPT_RT because of the slowpath

* in
@@ -1838,7 +1838,7 @@ void update_process_times(int user_tick)
run_local_timers(); rcu_sched_clock_irq(user_tick);
#ifdef CONFIG_IRQ_WORK
- if (in_irq())
+ if (in_hardirq())
irq_work_tick();
#endif
scheduler_tick();

Signature · 1 line
2.25.1
merge bot Applied
#2 lore raw

[tip: timers/core] timers: Replace in_irq() with in_hardirq()

In reply to [email protected]
The following commit has been merged into the timers/core branch of tip:

The following commit has been merged into the timers/core branch of tip:

Commit-ID:     8be3f96ceddb911539a53d87a66da84a04502366
Gitweb:        https://git.kernel.org/tip/8be3f96ceddb911539a53d87a66da84a04502366
Author:        ye xingchen <[email protected]>
AuthorDate:    Wed, 12 Oct 2022 01:26:29 
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Mon, 17 Oct 2022 16:00:04 +02:00

timers: Replace in_irq() with in_hardirq()

Replace the obsolete and ambiguous macro in_irq() with new macro in_hardirq().

---
 kernel/time/timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/time/timer.c +1 -1
index 717fcb9..f40c88c 100644
@@ -1422,7 +1422,7 @@ int del_timer_sync(struct timer_list *timer)
 	 * don't use it in hardirq context, because it
 	 * could lead to deadlock.
 	 */
-	WARN_ON(in_irq() && !(timer->flags & TIMER_IRQSAFE));
+	WARN_ON(in_hardirq() && !(timer->flags & TIMER_IRQSAFE));
 
 	/*
 	 * Must be able to sleep on PREEMPT_RT because of the slowpath in