All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] [PATCH] x86/ipipe: reserve irq num we use for IRQ_MOVE_CLEANUP_VECTOR
@ 2015-08-26 17:01 Henning Schild
  2015-08-26 18:32 ` Jan Kiszka
  0 siblings, 1 reply; 8+ messages in thread
From: Henning Schild @ 2015-08-26 17:01 UTC (permalink / raw)
  To: xenomai

vector_irq must not contain the same irq number for two different
vectors because ipipe dispatches based on irq numbers.
For the special case of IRQ_MOVE_CLEANUP_VECTOR, the ipipe patch
inserts a new entry in vector_irq. To ensure the required uniqueness
we have to make sure Linux will never make a vector point to irq number
IRQ_MOVE_CLEANUP_VECTOR.

Before that patch ipipe did dispatch device interrupts that happened to
receive number 32 (IRQ_MOVE_CLEANUP_VECTOR) to the cleanup function, the
device effectively lost its interrupts. Up to 3.18 that was no problem
since the allocator did not hand out the number ipipe failed to reserve.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
 arch/x86/kernel/irqinit.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/x86/kernel/irqinit.c b/arch/x86/kernel/irqinit.c
index e850981..5ca0ec7 100644
--- a/arch/x86/kernel/irqinit.c
+++ b/arch/x86/kernel/irqinit.c
@@ -143,9 +143,12 @@ static void __init smp_intr_init(void)
 	/* Low priority IPI to cleanup after moving an irq */
 	set_intr_gate(IRQ_MOVE_CLEANUP_VECTOR, irq_move_cleanup_interrupt);
 	set_bit(IRQ_MOVE_CLEANUP_VECTOR, used_vectors);
+#ifdef CONFIG_IPIPE
+	BUG_ON(IRQ_MOVE_CLEANUP_VECTOR != irq_alloc_descs(IRQ_MOVE_CLEANUP_VECTOR, 0, 1, 0));
 	for_each_possible_cpu(cpu)
 		per_cpu(vector_irq, cpu)[IRQ_MOVE_CLEANUP_VECTOR] =
 			IRQ_MOVE_CLEANUP_VECTOR;
+#endif
 
 	/* IPI used for rebooting/stopping */
 	alloc_intr_gate(REBOOT_VECTOR, reboot_interrupt);
-- 
2.4.6



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-08-27 10:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-26 17:01 [Xenomai] [PATCH] x86/ipipe: reserve irq num we use for IRQ_MOVE_CLEANUP_VECTOR Henning Schild
2015-08-26 18:32 ` Jan Kiszka
2015-08-27  8:42   ` Henning Schild
2015-08-27  9:12     ` Gilles Chanteperdrix
2015-08-27  9:15       ` Jan Kiszka
2015-08-27  9:39       ` [Xenomai] [PATCHv2] " Henning Schild
2015-08-27  9:41         ` Jan Kiszka
2015-08-27 10:20           ` [Xenomai] [PATCHv3] " Henning Schild

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.