From f3ebfa2441f8d5e3642dda95b206a6e2c4d82302 Mon Sep 17 00:00:00 2001
From: Thomas Gleixner <tglx@linutronix.de>
Date: Wed, 13 Jul 2011 14:05:05 +0200
Subject: [PATCH 237/414] x86-no-perf-irq-work-rt.patch

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/kernel/irq_work.c | 2 ++
 kernel/irq_work.c          | 5 ++++-
 kernel/timer.c             | 6 +++++-
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/irq_work.c b/arch/x86/kernel/irq_work.c
index 1de84e3ab4e0..3d21f7bd7b42 100644
--- a/arch/x86/kernel/irq_work.c
+++ b/arch/x86/kernel/irq_work.c
@@ -38,6 +38,7 @@ __visible void smp_trace_irq_work_interrupt(struct pt_regs *regs)
 	exiting_irq();
 }
 
+#ifndef CONFIG_PREEMPT_RT_FULL
 void arch_irq_work_raise(void)
 {
 #ifdef CONFIG_X86_LOCAL_APIC
@@ -48,3 +49,4 @@ void arch_irq_work_raise(void)
 	apic_wait_icr_idle();
 #endif
 }
+#endif
diff --git a/kernel/irq_work.c b/kernel/irq_work.c
index 55fcce6065cf..f6e4377596f8 100644
--- a/kernel/irq_work.c
+++ b/kernel/irq_work.c
@@ -119,8 +119,9 @@ static void __irq_work_run(void)
 	if (llist_empty(this_list))
 		return;
 
+#ifndef CONFIG_PREEMPT_RT_FULL
 	BUG_ON(!irqs_disabled());
-
+#endif
 	llnode = llist_del_all(this_list);
 	while (llnode != NULL) {
 		work = llist_entry(llnode, struct irq_work, llnode);
@@ -152,7 +153,9 @@ static void __irq_work_run(void)
  */
 void irq_work_run(void)
 {
+#ifndef CONFIG_PREEMPT_RT_FULL
 	BUG_ON(!in_irq());
+#endif
 	__irq_work_run();
 }
 EXPORT_SYMBOL_GPL(irq_work_run);
diff --git a/kernel/timer.c b/kernel/timer.c
index 43e8bcfd10d4..6590d46148ff 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -1438,7 +1438,7 @@ void update_process_times(int user_tick)
 	scheduler_tick();
 	run_local_timers();
 	rcu_check_callbacks(cpu, user_tick);
-#ifdef CONFIG_IRQ_WORK
+#if defined(CONFIG_IRQ_WORK) && !defined(CONFIG_PREEMPT_RT_FULL)
 	if (in_irq())
 		irq_work_run();
 #endif
@@ -1452,6 +1452,10 @@ static void run_timer_softirq(struct softirq_action *h)
 {
 	struct tvec_base *base = __this_cpu_read(tvec_bases);
 
+#if defined(CONFIG_IRQ_WORK) && defined(CONFIG_PREEMPT_RT_FULL)
+	irq_work_run();
+#endif
+
 	if (time_after_eq(jiffies, base->timer_jiffies))
 		__run_timers(base);
 }
-- 
2.10.2

