[2/2] hrtimer: Use pr_warn_deferred_once() in hrtimer_interrupt()
diff mbox series

Message ID 20210123233741.3614408-3-qais.yousef@arm.com
State New, archived
Headers show
Series
  • Fix BUG: Invalid wait context in hrtimer_interrupt()
Related show

Commit Message

Qais Yousef Jan. 23, 2021, 11:37 p.m. UTC
printk is not allowed in this context and causes a BUG: Invalid wait context.

Signed-off-by: Qais Yousef <qais.yousef@arm.com>
---
 kernel/time/hrtimer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index 743c852e10f2..2d9b7cf1d5e2 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -1700,7 +1700,8 @@  void hrtimer_interrupt(struct clock_event_device *dev)
 	else
 		expires_next = ktime_add(now, delta);
 	tick_program_event(expires_next, 1);
-	pr_warn_once("hrtimer: interrupt took %llu ns\n", ktime_to_ns(delta));
+	pr_warn_deferred_once("hrtimer: interrupt took %llu ns\n",
+			      ktime_to_ns(delta));
 }
 
 /* called with interrupts disabled */