Skip to contentSkip to conversation

ipipe: Restore root state before disabling hw irqs

PATCH New Jan Kiszka 1 participant 1 message Apr 29, 2011

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 ipipe: Restore root state before disabling hw irqs

root_stall_after_handler is a fixup for the root state, required when CONFIG_TRACE_IRQFLAGS is enabled. It then calls local_irq_disable which reenables hard irqs as a side effect. This causes all types of corruptions after return from __ipipe_sync_stage which is supposed to leave hard irqs off.

Fix it by reordering root_stall_after_handler and local_irq_disable_hw.

---
 kernel/ipipe/core.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
kernel/ipipe/core.c +2 -2
index 9ad7757..9aa4800 100644
@@ -1277,14 +1277,14 @@ void __ipipe_sync_stage(void)
 			irq_enter();
 			ipd->irqs[irq].handler(irq, ipd->irqs[irq].cookie);
 			irq_exit();
-			local_irq_disable_hw();
 			root_stall_after_handler();
+			local_irq_disable_hw();
 			while (__ipipe_check_root_resched())
 				__ipipe_preempt_schedule_irq();
 		} else {
 			__ipipe_do_root_xirq(ipd, irq);
-			local_irq_disable_hw();
 			root_stall_after_handler();
+			local_irq_disable_hw();
 		}
 
 		p = ipipe_cpudom_ptr(__ipipe_current_domain);
Signature · 1 line
1.7.1