Commit fbf7fcc5 authored by Martin J. Bligh's avatar Martin J. Bligh Committed by Linus Torvalds

[PATCH] Fix interrupt dest mode / delivery mode confusion

Patch from James Cleverdon & John Stultz

Currently the naming for the IO-APIC fields is very confused, we assign
dest_LowestPrio to delivery_mode, and INT_DELIVERY_MODE to dest_mode.
The values are correct, but the naming is wrong - this patch corrects
that confusion. It also moves the definitions of those settings into
subarch, where they belong (we have to use fixed delivery mode for Summit
due to what seems to be an Intel IO-APIC bug with P4 clustered mode).
parent d1ae0ede
...@@ -719,8 +719,8 @@ void __init setup_IO_APIC_irqs(void) ...@@ -719,8 +719,8 @@ void __init setup_IO_APIC_irqs(void)
*/ */
memset(&entry,0,sizeof(entry)); memset(&entry,0,sizeof(entry));
entry.delivery_mode = dest_LowestPrio; entry.delivery_mode = INT_DELIVERY_MODE;
entry.dest_mode = INT_DELIVERY_MODE; entry.dest_mode = INT_DEST_MODE;
entry.mask = 0; /* enable IRQ */ entry.mask = 0; /* enable IRQ */
entry.dest.logical.logical_dest = TARGET_CPUS; entry.dest.logical.logical_dest = TARGET_CPUS;
...@@ -799,10 +799,10 @@ void __init setup_ExtINT_IRQ0_pin(unsigned int pin, int vector) ...@@ -799,10 +799,10 @@ void __init setup_ExtINT_IRQ0_pin(unsigned int pin, int vector)
* We use logical delivery to get the timer IRQ * We use logical delivery to get the timer IRQ
* to the first CPU. * to the first CPU.
*/ */
entry.dest_mode = INT_DELIVERY_MODE; entry.dest_mode = INT_DEST_MODE;
entry.mask = 0; /* unmask IRQ now */ entry.mask = 0; /* unmask IRQ now */
entry.dest.logical.logical_dest = TARGET_CPUS; entry.dest.logical.logical_dest = TARGET_CPUS;
entry.delivery_mode = dest_LowestPrio; entry.delivery_mode = INT_DELIVERY_MODE;
entry.polarity = 0; entry.polarity = 0;
entry.trigger = 0; entry.trigger = 0;
entry.vector = vector; entry.vector = vector;
...@@ -1880,8 +1880,8 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq) ...@@ -1880,8 +1880,8 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq)
memset(&entry,0,sizeof(entry)); memset(&entry,0,sizeof(entry));
entry.delivery_mode = dest_LowestPrio; entry.delivery_mode = INT_DELIVERY_MODE;
entry.dest_mode = INT_DELIVERY_MODE; entry.dest_mode = INT_DEST_MODE;
entry.dest.logical.logical_dest = TARGET_CPUS; entry.dest.logical.logical_dest = TARGET_CPUS;
entry.mask = 1; /* Disabled (masked) */ entry.mask = 1; /* Disabled (masked) */
entry.trigger = 1; /* Level sensitive */ entry.trigger = 1; /* Level sensitive */
......
...@@ -21,6 +21,9 @@ static inline int apic_id_registered(void) ...@@ -21,6 +21,9 @@ static inline int apic_id_registered(void)
#define APIC_DFR_VALUE (APIC_DFR_CLUSTER) #define APIC_DFR_VALUE (APIC_DFR_CLUSTER)
#define TARGET_CPUS ((cpu_online_map < 0xf)?cpu_online_map:0xf) #define TARGET_CPUS ((cpu_online_map < 0xf)?cpu_online_map:0xf)
#define INT_DELIVERY_MODE dest_LowestPrio
#define INT_DEST_MODE 1 /* logical delivery broadcast to all procs */
#define APIC_BROADCAST_ID (0x0f) #define APIC_BROADCAST_ID (0x0f)
#define check_apicid_used(bitmap, apicid) (0) #define check_apicid_used(bitmap, apicid) (0)
......
...@@ -12,6 +12,9 @@ ...@@ -12,6 +12,9 @@
#define no_balance_irq (0) #define no_balance_irq (0)
#define esr_disable (0) #define esr_disable (0)
#define INT_DELIVERY_MODE dest_LowestPrio
#define INT_DEST_MODE 1 /* logical delivery broadcast to all procs */
#define APIC_BROADCAST_ID 0x0F #define APIC_BROADCAST_ID 0x0F
#define check_apicid_used(bitmap, apicid) (bitmap & (1 << apicid)) #define check_apicid_used(bitmap, apicid) (bitmap & (1 << apicid))
......
...@@ -8,6 +8,9 @@ ...@@ -8,6 +8,9 @@
#define no_balance_irq (1) #define no_balance_irq (1)
#define esr_disable (1) #define esr_disable (1)
#define INT_DELIVERY_MODE dest_LowestPrio
#define INT_DEST_MODE 0 /* physical delivery on LOCAL quad */
#define APIC_BROADCAST_ID 0x0F #define APIC_BROADCAST_ID 0x0F
#define check_apicid_used(bitmap, apicid) ((bitmap) & (1 << (apicid))) #define check_apicid_used(bitmap, apicid) ((bitmap) & (1 << (apicid)))
......
...@@ -25,6 +25,9 @@ static inline unsigned long calculate_ldr(unsigned long old) ...@@ -25,6 +25,9 @@ static inline unsigned long calculate_ldr(unsigned long old)
#define APIC_DFR_VALUE (x86_summit ? APIC_DFR_CLUSTER : APIC_DFR_FLAT) #define APIC_DFR_VALUE (x86_summit ? APIC_DFR_CLUSTER : APIC_DFR_FLAT)
#define TARGET_CPUS (x86_summit ? XAPIC_DEST_CPUS_MASK : cpu_online_map) #define TARGET_CPUS (x86_summit ? XAPIC_DEST_CPUS_MASK : cpu_online_map)
#define INT_DELIVERY_MODE dest_Fixed
#define INT_DEST_MODE 1 /* logical delivery broadcast to all procs */
#define APIC_BROADCAST_ID (x86_summit ? 0xFF : 0x0F) #define APIC_BROADCAST_ID (x86_summit ? 0xFF : 0x0F)
#define check_apicid_used(bitmap, apicid) (0) #define check_apicid_used(bitmap, apicid) (0)
......
...@@ -22,12 +22,6 @@ ...@@ -22,12 +22,6 @@
#endif #endif
#endif #endif
#ifdef CONFIG_X86_NUMAQ
#define INT_DELIVERY_MODE 0 /* physical delivery on LOCAL quad */
#else
#define INT_DELIVERY_MODE 1 /* logical delivery broadcast to all procs */
#endif
#define BAD_APICID 0xFFu #define BAD_APICID 0xFFu
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment