]> git.hungrycats.org Git - linux/commitdiff
[PATCH] ppc64: interrupt code cleanup
authorAnton Blanchard <anton@samba.org>
Tue, 11 Jan 2005 09:44:23 +0000 (01:44 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 11 Jan 2005 09:44:23 +0000 (01:44 -0800)
- Move some function prototypes into header files.
- Remove late_setup_cpu, put the set indicator and vpa init into xics
  probe instead
- rtas-proc was doing weird stuff with the 9005 indicator. Get rid of
  it.
- Dont open code the set_indicator call in the hotplug code

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/ppc64/kernel/pSeries_smp.c
arch/ppc64/kernel/rtas-proc.c
arch/ppc64/kernel/smp.c
arch/ppc64/kernel/xics.c
include/asm-ppc64/machdep.h
include/asm-ppc64/rtas.h
include/asm-ppc64/xics.h

index 12da1cdf854e268bdb0b8651955d17f9b003f550..da4b63fbb7ae0aba248060bdb62f9308600bc9d3 100644 (file)
@@ -19,9 +19,7 @@
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/smp.h>
-#include <linux/smp_lock.h>
 #include <linux/interrupt.h>
-#include <linux/kernel_stat.h>
 #include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/spinlock.h>
@@ -40,7 +38,6 @@
 #include <asm/smp.h>
 #include <asm/paca.h>
 #include <asm/time.h>
-#include <asm/ppcdebug.h>
 #include <asm/machdep.h>
 #include <asm/xics.h>
 #include <asm/cputable.h>
@@ -89,9 +86,6 @@ static int query_cpu_stopped(unsigned int pcpu)
 
 int pSeries_cpu_disable(void)
 {
-       /* FIXME: go put this in a header somewhere */
-       extern void xics_migrate_irqs_away(void);
-
        systemcfg->processorCount--;
 
        /*fix boot_cpuid here*/
@@ -250,8 +244,6 @@ static void smp_xics_message_pass(int target, int msg)
        }
 }
 
-extern void xics_request_IPIs(void);
-
 static int __init smp_xics_probe(void)
 {
        xics_request_IPIs();
@@ -263,6 +255,18 @@ static void __devinit smp_xics_setup_cpu(int cpu)
 {
        if (cpu != boot_cpuid)
                xics_setup_cpu();
+
+       if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR)
+               vpa_init(cpu);
+
+#ifdef CONFIG_IRQ_ALL_CPUS
+       /*
+        * Put the calling processor into the GIQ.  This is really only
+        * necessary from a secondary thread as the OF start-cpu interface
+        * performs this function for us on primary threads.
+        */
+       rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE, default_distrib_server, 1);
+#endif
 }
 
 static spinlock_t timebase_lock = SPIN_LOCK_UNLOCKED;
@@ -290,26 +294,7 @@ static void __devinit pSeries_take_timebase(void)
        spin_unlock(&timebase_lock);
 }
 
-static void __devinit pSeries_late_setup_cpu(int cpu)
-{
-       extern unsigned int default_distrib_server;
-
-       if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) {
-               vpa_init(cpu); 
-       }
-
-#ifdef CONFIG_IRQ_ALL_CPUS
-       /* Put the calling processor into the GIQ.  This is really only
-        * necessary from a secondary thread as the OF start-cpu interface
-        * performs this function for us on primary threads.
-        */
-       /* TODO: 9005 is #defined in rtas-proc.c -- move to a header */
-       rtas_set_indicator(9005, default_distrib_server, 1);
-#endif
-}
-
-
-void __devinit smp_pSeries_kick_cpu(int nr)
+static void __devinit smp_pSeries_kick_cpu(int nr)
 {
        BUG_ON(nr < 0 || nr >= NR_CPUS);
 
@@ -329,7 +314,6 @@ static struct smp_ops_t pSeries_mpic_smp_ops = {
        .probe          = smp_mpic_probe,
        .kick_cpu       = smp_pSeries_kick_cpu,
        .setup_cpu      = smp_mpic_setup_cpu,
-       .late_setup_cpu = pSeries_late_setup_cpu,
 };
 
 static struct smp_ops_t pSeries_xics_smp_ops = {
@@ -337,7 +321,6 @@ static struct smp_ops_t pSeries_xics_smp_ops = {
        .probe          = smp_xics_probe,
        .kick_cpu       = smp_pSeries_kick_cpu,
        .setup_cpu      = smp_xics_setup_cpu,
-       .late_setup_cpu = pSeries_late_setup_cpu,
 };
 
 /* This is called very early */
@@ -372,9 +355,6 @@ void __init smp_init_pSeries(void)
                }
        }
 
-       if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR)
-               vpa_init(boot_cpuid);
-
        /* Non-lpar has additional take/give timebase */
        if (rtas_token("freeze-time-base") != RTAS_UNKNOWN_SERVICE) {
                smp_ops->give_timebase = pSeries_give_timebase;
index ed07210b9917df8723feab6ef942fa3d5d7e7572..28b1f1521f2165be7612d4590a5e7a1e46c68692 100644 (file)
@@ -52,7 +52,6 @@
 #define IBM_VOLTAGE            0x232a /* 9002 */
 #define IBM_DRCONNECTOR                0x232b /* 9003 */
 #define IBM_POWERSUPPLY                0x232c /* 9004 */
-#define IBM_INTQUEUE           0x232d /* 9005 */
 
 /* Status return values */
 #define SENSOR_CRITICAL_HIGH   13
 #define DR_ACTION              0x2329 /* 9001 */
 #define DR_INDICATOR           0x232a /* 9002 */
 /* 9003 - 9004: Vendor specific */
-#define GLOBAL_INTERRUPT_QUEUE 0x232d /* 9005 */
 /* 9006 - 9999: Vendor specific */
 
 /* other */
@@ -553,7 +551,6 @@ static void ppc_rtas_process_sensor(struct seq_file *m,
                                                "No current flow" };
        const char * ibm_drconnector[]     = { "Empty", "Present", "Unusable", 
                                                "Exchange" };
-       const char * ibm_intqueue[]        = { "Disabled", "Enabled" };
 
        int have_strings = 0;
        int num_states = 0;
@@ -665,15 +662,6 @@ static void ppc_rtas_process_sensor(struct seq_file *m,
                case IBM_POWERSUPPLY:
                        seq_printf(m, "Powersupply:\t");
                        break;
-               case IBM_INTQUEUE:
-                       seq_printf(m, "Interrupt queue:\t");
-                       num_states = sizeof(ibm_intqueue) / sizeof(char *);
-                       if (state < num_states) {
-                               seq_printf(m, "%s\t", 
-                                               ibm_intqueue[state]);
-                               have_strings = 1;
-                       }
-                       break;
                default:
                        seq_printf(m,  "Unknown sensor (type %d), ignoring it\n",
                                        s->token);
index 808bb3d906c6df4db4169733e19b005adf2bc176..f5b4a8f295815d768fa75decc08edf41836754fa 100644 (file)
@@ -22,9 +22,7 @@
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/smp.h>
-#include <linux/smp_lock.h>
 #include <linux/interrupt.h>
-#include <linux/kernel_stat.h>
 #include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/spinlock.h>
 #include <asm/irq.h>
 #include <asm/page.h>
 #include <asm/pgtable.h>
-#include <asm/io.h>
 #include <asm/prom.h>
 #include <asm/smp.h>
 #include <asm/paca.h>
 #include <asm/time.h>
-#include <asm/ppcdebug.h>
 #include <asm/machdep.h>
 #include <asm/cputable.h>
 #include <asm/system.h>
@@ -58,7 +54,6 @@
 #endif
 
 int smp_threads_ready;
-unsigned long cache_decay_ticks;
 
 cpumask_t cpu_possible_map = CPU_MASK_NONE;
 cpumask_t cpu_online_map = CPU_MASK_NONE;
@@ -77,10 +72,6 @@ void smp_call_function_interrupt(void);
 
 int smt_enabled_at_boot = 1;
 
-/* Low level assembly function used to backup CPU 0 state */
-extern void __save_cpu_setup(void);
-
-
 #ifdef CONFIG_PPC_MULTIPLATFORM
 void smp_mpic_message_pass(int target, int msg)
 {
@@ -507,9 +498,6 @@ int __devinit start_secondary(void *unused)
        if (smp_ops->take_timebase)
                smp_ops->take_timebase();
 
-       if (smp_ops->late_setup_cpu)
-               smp_ops->late_setup_cpu(cpu);
-
        spin_lock(&call_lock);
        cpu_set(cpu, cpu_online_map);
        spin_unlock(&call_lock);
index b9fdcc60d6e8e028efd5355db3cb7cd5a133b120..dd88142ebf39a10458eb6609299c578e99ed7afb 100644 (file)
@@ -643,20 +643,16 @@ static void xics_set_affinity(unsigned int virq, cpumask_t cpumask)
 /* Interrupts are disabled. */
 void xics_migrate_irqs_away(void)
 {
-       int set_indicator = rtas_token("set-indicator");
-       const unsigned int giqs = 9005UL; /* Global Interrupt Queue Server */
-       int status = 0;
+       int status;
        unsigned int irq, virq, cpu = smp_processor_id();
 
-       BUG_ON(set_indicator == RTAS_UNKNOWN_SERVICE);
-
        /* Reject any interrupt that was queued to us... */
        ops->cppr_info(cpu, 0);
        iosync();
 
        /* Refuse any new interrupts... */
-       rtas_call(set_indicator, 3, 1, &status, giqs,
-                 hard_smp_processor_id(), 0);
+       status = rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE,
+                                   hard_smp_processor_id(), 0);
        WARN_ON(status != 0);
 
        /* Allow IPIs again... */
index a21a944d326fe5bddebd8af11e75545a8c5a7e75..476d2185ffd121bf55288793f18660c68a4cea2e 100644 (file)
@@ -28,7 +28,6 @@ struct smp_ops_t {
        int   (*probe)(void);
        void  (*kick_cpu)(int nr);
        void  (*setup_cpu)(int nr);
-       void  (*late_setup_cpu)(int nr);
        void  (*take_timebase)(void);
        void  (*give_timebase)(void);
        int   (*cpu_disable)(void);
index a405a871919ee2e76f168fb7cf5129c0b712a569..dc2879cc498139b9f690065a42839113865960bd 100644 (file)
@@ -241,4 +241,6 @@ extern void rtas_stop_self(void);
 /* RMO buffer reserved for user-space RTAS use */
 extern unsigned long rtas_rmo_buf;
 
+#define GLOBAL_INTERRUPT_QUEUE 9005
+
 #endif /* _PPC64_RTAS_H */
index 560f4fd99e21dc9d9f08146ab3153352ea5ea9d5..6b9aedc6eadb4805373317ab561d2b6956fc0cab 100644 (file)
@@ -18,6 +18,8 @@ void xics_init_IRQ(void);
 int xics_get_irq(struct pt_regs *);
 void xics_setup_cpu(void);
 void xics_cause_IPI(int cpu);
+void xics_request_IPIs(void);
+void xics_migrate_irqs_away(void);
 
 /* first argument is ignored for now*/
 void pSeriesLP_cppr_info(int n_cpu, u8 value);
@@ -28,4 +30,6 @@ struct xics_ipi_struct {
 
 extern struct xics_ipi_struct xics_ipi_message[NR_CPUS] __cacheline_aligned;
 
+extern unsigned int default_distrib_server;
+
 #endif /* _PPC64_KERNEL_XICS_H */