]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
x86, apic: streamline the ->multi_timer_check() quirk
authorIngo Molnar <mingo@elte.hu>
Wed, 28 Jan 2009 06:17:26 +0000 (07:17 +0100)
committerIngo Molnar <mingo@elte.hu>
Wed, 28 Jan 2009 22:20:22 +0000 (23:20 +0100)
only NUMAQ uses this quirk: to prevent the timer IRQ from being added
on secondary nodes.

All other genapic templates can have a NULL ->multi_timer_check()
callback.

Also, extend the generic code to treat a NULL pointer accordingly.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
12 files changed:
arch/x86/include/asm/bigsmp/apic.h
arch/x86/include/asm/es7000/apic.h
arch/x86/include/asm/mach-default/mach_apic.h
arch/x86/include/asm/mach-generic/mach_apic.h
arch/x86/include/asm/numaq/apic.h
arch/x86/include/asm/summit/apic.h
arch/x86/kernel/io_apic.c
arch/x86/mach-generic/bigsmp.c
arch/x86/mach-generic/default.c
arch/x86/mach-generic/es7000.c
arch/x86/mach-generic/numaq.c
arch/x86/mach-generic/summit.c

index 321ea47b5dd1e43ac703ffd55b62f7431ad58827..df59298086c6743ee0064751655ede55b2a6e010 100644 (file)
@@ -62,11 +62,6 @@ static inline void bigsmp_setup_apic_routing(void)
                "Physflat", nr_ioapics);
 }
 
-static inline int multi_timer_check(int apic, int irq)
-{
-       return (0);
-}
-
 static inline int apicid_to_node(int logical_apicid)
 {
        return apicid_2_node[hard_smp_processor_id()];
index f1183000a940dc169c7d9193e00c16cf01770a78..632e4cd3f4fd7a9d517a3c3706ed9785b8c7d939 100644 (file)
@@ -82,11 +82,6 @@ static inline void es7000_setup_apic_routing(void)
                        nr_ioapics, cpus_addr(*es7000_target_cpus())[0]);
 }
 
-static inline int multi_timer_check(int apic, int irq)
-{
-       return 0;
-}
-
 static inline int apicid_to_node(int logical_apicid)
 {
        return 0;
index d4467746304655e302b38ca9f6bfda68ae6dd7c3..f418d470cf45a906d17778ad0a0b4c008fbd3212 100644 (file)
@@ -104,11 +104,6 @@ static inline physid_mask_t default_ioapic_phys_id_map(physid_mask_t phys_map)
        return phys_map;
 }
 
-static inline int multi_timer_check(int apic, int irq)
-{
-       return 0;
-}
-
 /* Mapping from cpu number to logical apicid */
 static inline int cpu_to_logical_apicid(int cpu)
 {
index ddf369248ab7defa4e1e9ec0d340d3cd6a863add..bdea0a759e8aea91432564d00615dcd3aa06aaa7 100644 (file)
@@ -3,7 +3,6 @@
 
 #include <asm/genapic.h>
 
-#define multi_timer_check (apic->multi_timer_check)
 #define apicid_to_node (apic->apicid_to_node)
 #define cpu_to_logical_apicid (apic->cpu_to_logical_apicid) 
 #define cpu_present_to_apicid (apic->cpu_present_to_apicid)
index 2feb7e72e9ea410ccd85429806f43714f590cd3e..22bdf3d4c0e3730dd2fcfebe306352e806d1947c 100644 (file)
@@ -43,7 +43,7 @@ static inline void numaq_setup_apic_routing(void)
  * Skip adding the timer int on secondary nodes, which causes
  * a small but painful rift in the time-space continuum.
  */
-static inline int multi_timer_check(int apic, int irq)
+static inline int numaq_multi_timer_check(int apic, int irq)
 {
        return apic != 0 && irq == 0;
 }
index 7ec2696bc9a04a1c054d7de1dd953704ea1a13bb..acb7bd1de8481f5c96a15e21a6b70626176e6161 100644 (file)
@@ -64,11 +64,6 @@ static inline void summit_init_apic_ldr(void)
        apic_write(APIC_LDR, val);
 }
 
-static inline int multi_timer_check(int apic, int irq)
-{
-       return 0;
-}
-
 static inline int summit_apic_id_registered(void)
 {
        return 1;
index db79ad9a7646da96574505784cae8d90eb252503..282ea112f3cfc2c52cb0b966cf6be9a4d9e1c390 100644 (file)
@@ -1618,10 +1618,15 @@ static void __init setup_IO_APIC_irqs(void)
                        }
 
                        irq = pin_2_irq(idx, apic_id, pin);
-#ifdef CONFIG_X86_32
-                       if (multi_timer_check(apic_id, irq))
+
+                       /*
+                        * Skip the timer IRQ if there's a quirk handler
+                        * installed and if it returns 1:
+                        */
+                       if (apic->multi_timer_check &&
+                                       apic->multi_timer_check(apic_id, irq))
                                continue;
-#endif
+
                        desc = irq_to_desc_alloc_cpu(irq, cpu);
                        if (!desc) {
                                printk(KERN_INFO "can not get irq_desc for %d\n", irq);
index ad3837a59bd4f6d3d84e1330a06eea6b7f8060c0..d0749569cdf78cb70d56a7a560f20297bb01129c 100644 (file)
@@ -79,7 +79,7 @@ struct genapic apic_bigsmp = {
 
        .ioapic_phys_id_map             = bigsmp_ioapic_phys_id_map,
        .setup_apic_routing             = bigsmp_setup_apic_routing,
-       .multi_timer_check              = multi_timer_check,
+       .multi_timer_check              = NULL,
        .apicid_to_node                 = apicid_to_node,
        .cpu_to_logical_apicid          = cpu_to_logical_apicid,
        .cpu_present_to_apicid          = cpu_present_to_apicid,
index 67f287fc12df656590e29e462329eaebd7d618ab..6a21aa7c0c6dc6b0d9bac8deca72db999d5722d5 100644 (file)
@@ -60,7 +60,7 @@ struct genapic apic_default = {
 
        .ioapic_phys_id_map             = default_ioapic_phys_id_map,
        .setup_apic_routing             = default_setup_apic_routing,
-       .multi_timer_check              = multi_timer_check,
+       .multi_timer_check              = NULL,
        .apicid_to_node                 = apicid_to_node,
        .cpu_to_logical_apicid          = cpu_to_logical_apicid,
        .cpu_present_to_apicid          = cpu_present_to_apicid,
index f611729394611581978ba24ced80dc05b2a9a022..0be59a51df2fe1a62e5f7a624b4a749d52224ee6 100644 (file)
@@ -121,7 +121,7 @@ struct genapic apic_es7000 = {
 
        .ioapic_phys_id_map             = es7000_ioapic_phys_id_map,
        .setup_apic_routing             = es7000_setup_apic_routing,
-       .multi_timer_check              = multi_timer_check,
+       .multi_timer_check              = NULL,
        .apicid_to_node                 = apicid_to_node,
        .cpu_to_logical_apicid          = cpu_to_logical_apicid,
        .cpu_present_to_apicid          = cpu_present_to_apicid,
index 8c137f413485e602ffbb609b4979095bf46f2f00..da4ed653506a3dd9f303b9bcfd0484988ea1e7bd 100644 (file)
@@ -66,7 +66,7 @@ struct genapic apic_numaq = {
 
        .ioapic_phys_id_map             = numaq_ioapic_phys_id_map,
        .setup_apic_routing             = numaq_setup_apic_routing,
-       .multi_timer_check              = multi_timer_check,
+       .multi_timer_check              = numaq_multi_timer_check,
        .apicid_to_node                 = apicid_to_node,
        .cpu_to_logical_apicid          = cpu_to_logical_apicid,
        .cpu_present_to_apicid          = cpu_present_to_apicid,
index 0698566dc7b49e711a13b41dcf4e3a6af3d193dd..b618a186f1e2de47e1e52a38813f7d9650f42d54 100644 (file)
@@ -59,7 +59,7 @@ struct genapic apic_summit = {
 
        .ioapic_phys_id_map             = summit_ioapic_phys_id_map,
        .setup_apic_routing             = summit_setup_apic_routing,
-       .multi_timer_check              = multi_timer_check,
+       .multi_timer_check              = NULL,
        .apicid_to_node                 = apicid_to_node,
        .cpu_to_logical_apicid          = cpu_to_logical_apicid,
        .cpu_present_to_apicid          = cpu_present_to_apicid,