* [PATCH] x86: I/O APIC: Add a 64-bit variation of replace_pin_at_irq()
@ 2008-07-01 0:19 Maciej W. Rozycki
2008-07-01 16:24 ` Cyrill Gorcunov
0 siblings, 1 reply; 2+ messages in thread
From: Maciej W. Rozycki @ 2008-07-01 0:19 UTC (permalink / raw)
To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin; +Cc: x86, linux-kernel
When an interrupt is rerouted to a different I/O APIC pin the relevant
entry of the irq_2_pin list should get updated accordingly so that
operations are performed on the correct redirection entry. This is
already done by the 32-bit variation of the code and here is a
complementing 64-bit implementation. Should make someone's decision less
tough when merging the two. ;)
Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
---
patch-2.6.26-rc1-20080505-ioapic-replace-0
diff -up --recursive --new-file linux-2.6.26-rc1-20080505.macro/arch/x86/kernel/io_apic_64.c linux-2.6.26-rc1-20080505/arch/x86/kernel/io_apic_64.c
--- linux-2.6.26-rc1-20080505.macro/arch/x86/kernel/io_apic_64.c 2008-06-18 03:24:54.000000000 +0000
+++ linux-2.6.26-rc1-20080505/arch/x86/kernel/io_apic_64.c 2008-06-19 23:15:58.000000000 +0000
@@ -360,6 +360,26 @@ static void add_pin_to_irq(unsigned int
entry->pin = pin;
}
+/*
+ * Reroute an IRQ to a different pin.
+ */
+static void __init replace_pin_at_irq(unsigned int irq,
+ int oldapic, int oldpin,
+ int newapic, int newpin)
+{
+ struct irq_pin_list *entry = irq_2_pin + irq;
+
+ while (1) {
+ if (entry->apic == oldapic && entry->pin == oldpin) {
+ entry->apic = newapic;
+ entry->pin = newpin;
+ }
+ if (!entry->next)
+ break;
+ entry = irq_2_pin + entry->next;
+ }
+}
+
#define DO_ACTION(name,R,ACTION, FINAL) \
\
@@ -1711,7 +1731,7 @@ static inline void __init check_timer(vo
/*
* legacy devices should be connected to IO APIC #0
*/
- /* replace_pin_at_irq(0, apic1, pin1, apic2, pin2); */
+ replace_pin_at_irq(0, apic1, pin1, apic2, pin2);
setup_timer_IRQ0_pin(apic2, pin2, cfg->vector);
unmask_IO_APIC_irq(0);
enable_8259A_irq(0);
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] x86: I/O APIC: Add a 64-bit variation of replace_pin_at_irq()
2008-07-01 0:19 [PATCH] x86: I/O APIC: Add a 64-bit variation of replace_pin_at_irq() Maciej W. Rozycki
@ 2008-07-01 16:24 ` Cyrill Gorcunov
0 siblings, 0 replies; 2+ messages in thread
From: Cyrill Gorcunov @ 2008-07-01 16:24 UTC (permalink / raw)
To: Maciej W. Rozycki
Cc: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, x86, linux-kernel
[Maciej W. Rozycki - Tue, Jul 01, 2008 at 01:19:31AM +0100]
| When an interrupt is rerouted to a different I/O APIC pin the relevant
| entry of the irq_2_pin list should get updated accordingly so that
| operations are performed on the correct redirection entry. This is
| already done by the 32-bit variation of the code and here is a
| complementing 64-bit implementation. Should make someone's decision less
| tough when merging the two. ;)
|
| Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
| ---
Thanks Maciej :-)
- Cyrill -
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-07-01 16:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-01 0:19 [PATCH] x86: I/O APIC: Add a 64-bit variation of replace_pin_at_irq() Maciej W. Rozycki
2008-07-01 16:24 ` Cyrill Gorcunov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox