blob: 35edbef1d2228b021b8e677f22a9bcf7a66d0eeb [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * arch/s390/kernel/smp.c
3 *
Heiko Carstens39ce0102007-04-27 16:02:00 +02004 * Copyright IBM Corp. 1999,2007
Linus Torvalds1da177e2005-04-16 15:20:36 -07005 * Author(s): Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com),
Heiko Carstens39ce0102007-04-27 16:02:00 +02006 * Martin Schwidefsky (schwidefsky@de.ibm.com)
7 * Heiko Carstens (heiko.carstens@de.ibm.com)
Linus Torvalds1da177e2005-04-16 15:20:36 -07008 *
Heiko Carstens39ce0102007-04-27 16:02:00 +02009 * based on other smp stuff by
Linus Torvalds1da177e2005-04-16 15:20:36 -070010 * (c) 1995 Alan Cox, CymruNET Ltd <alan@cymru.net>
11 * (c) 1998 Ingo Molnar
12 *
13 * We work with logical cpu numbering everywhere we can. The only
14 * functions using the real cpu address (got from STAP) are the sigp
15 * functions. For all other functions we use the identity mapping.
16 * That means that cpu_number_map[i] == i for every cpu. cpu_number_map is
17 * used e.g. to find the idle task belonging to a logical cpu. Every array
18 * in the kernel is sorted by the logical cpu number and not by the physical
19 * one which is causing all the confusion with __cpu_logical_map and
20 * cpu_number_map in other architectures.
21 */
22
23#include <linux/module.h>
24#include <linux/init.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070025#include <linux/mm.h>
Alexey Dobriyan4e950f62007-07-30 02:36:13 +040026#include <linux/err.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070027#include <linux/spinlock.h>
28#include <linux/kernel_stat.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070029#include <linux/delay.h>
30#include <linux/cache.h>
31#include <linux/interrupt.h>
32#include <linux/cpu.h>
Heiko Carstens2b67fc42007-02-05 21:16:47 +010033#include <linux/timex.h>
Michael Holzheu411ed322007-04-27 16:01:49 +020034#include <linux/bootmem.h>
Michael Holzheu46b05d22007-02-21 10:55:21 +010035#include <asm/ipl.h>
Heiko Carstens2b67fc42007-02-05 21:16:47 +010036#include <asm/setup.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070037#include <asm/sigp.h>
38#include <asm/pgalloc.h>
39#include <asm/irq.h>
40#include <asm/s390_ext.h>
41#include <asm/cpcmd.h>
42#include <asm/tlbflush.h>
Heiko Carstens2b67fc42007-02-05 21:16:47 +010043#include <asm/timer.h>
Michael Holzheu411ed322007-04-27 16:01:49 +020044#include <asm/lowcore.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070045
Linus Torvalds1da177e2005-04-16 15:20:36 -070046/*
47 * An array with a pointer the lowcore of every CPU.
48 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070049struct _lowcore *lowcore_ptr[NR_CPUS];
Heiko Carstens39ce0102007-04-27 16:02:00 +020050EXPORT_SYMBOL(lowcore_ptr);
Linus Torvalds1da177e2005-04-16 15:20:36 -070051
Heiko Carstens255acee2006-02-17 13:52:46 -080052cpumask_t cpu_online_map = CPU_MASK_NONE;
Heiko Carstens39ce0102007-04-27 16:02:00 +020053EXPORT_SYMBOL(cpu_online_map);
54
Heiko Carstens255acee2006-02-17 13:52:46 -080055cpumask_t cpu_possible_map = CPU_MASK_NONE;
Heiko Carstens39ce0102007-04-27 16:02:00 +020056EXPORT_SYMBOL(cpu_possible_map);
Linus Torvalds1da177e2005-04-16 15:20:36 -070057
58static struct task_struct *current_set[NR_CPUS];
59
Linus Torvalds1da177e2005-04-16 15:20:36 -070060static void smp_ext_bitcall(int, ec_bit_sig);
Linus Torvalds1da177e2005-04-16 15:20:36 -070061
62/*
Jan Glauber63db6e82007-02-21 10:55:06 +010063 * Structure and data for __smp_call_function_map(). This is designed to
64 * minimise static memory requirements. It also looks cleaner.
Linus Torvalds1da177e2005-04-16 15:20:36 -070065 */
66static DEFINE_SPINLOCK(call_lock);
67
68struct call_data_struct {
69 void (*func) (void *info);
70 void *info;
Jan Glauber63db6e82007-02-21 10:55:06 +010071 cpumask_t started;
72 cpumask_t finished;
Linus Torvalds1da177e2005-04-16 15:20:36 -070073 int wait;
74};
75
Heiko Carstens39ce0102007-04-27 16:02:00 +020076static struct call_data_struct *call_data;
Linus Torvalds1da177e2005-04-16 15:20:36 -070077
78/*
79 * 'Call function' interrupt callback
80 */
81static void do_call_function(void)
82{
83 void (*func) (void *info) = call_data->func;
84 void *info = call_data->info;
85 int wait = call_data->wait;
86
Jan Glauber63db6e82007-02-21 10:55:06 +010087 cpu_set(smp_processor_id(), call_data->started);
Linus Torvalds1da177e2005-04-16 15:20:36 -070088 (*func)(info);
89 if (wait)
Jan Glauber63db6e82007-02-21 10:55:06 +010090 cpu_set(smp_processor_id(), call_data->finished);;
Linus Torvalds1da177e2005-04-16 15:20:36 -070091}
92
Jan Glauber63db6e82007-02-21 10:55:06 +010093static void __smp_call_function_map(void (*func) (void *info), void *info,
94 int nonatomic, int wait, cpumask_t map)
Linus Torvalds1da177e2005-04-16 15:20:36 -070095{
96 struct call_data_struct data;
Jan Glauber63db6e82007-02-21 10:55:06 +010097 int cpu, local = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -070098
Jan Glauber63db6e82007-02-21 10:55:06 +010099 /*
Heiko Carstens25864162007-03-05 23:35:41 +0100100 * Can deadlock when interrupts are disabled or if in wrong context.
Jan Glauber63db6e82007-02-21 10:55:06 +0100101 */
Heiko Carstens25864162007-03-05 23:35:41 +0100102 WARN_ON(irqs_disabled() || in_irq());
Linus Torvalds1da177e2005-04-16 15:20:36 -0700103
Jan Glauber63db6e82007-02-21 10:55:06 +0100104 /*
105 * Check for local function call. We have to have the same call order
106 * as in on_each_cpu() because of machine_restart_smp().
107 */
108 if (cpu_isset(smp_processor_id(), map)) {
109 local = 1;
110 cpu_clear(smp_processor_id(), map);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700111 }
112
Jan Glauber63db6e82007-02-21 10:55:06 +0100113 cpus_and(map, map, cpu_online_map);
114 if (cpus_empty(map))
115 goto out;
116
Linus Torvalds1da177e2005-04-16 15:20:36 -0700117 data.func = func;
118 data.info = info;
Jan Glauber63db6e82007-02-21 10:55:06 +0100119 data.started = CPU_MASK_NONE;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700120 data.wait = wait;
121 if (wait)
Jan Glauber63db6e82007-02-21 10:55:06 +0100122 data.finished = CPU_MASK_NONE;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700123
Heiko Carstens8da1aec2007-07-27 12:29:09 +0200124 spin_lock(&call_lock);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700125 call_data = &data;
Jan Glauber63db6e82007-02-21 10:55:06 +0100126
127 for_each_cpu_mask(cpu, map)
128 smp_ext_bitcall(cpu, ec_call_function);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700129
130 /* Wait for response */
Jan Glauber63db6e82007-02-21 10:55:06 +0100131 while (!cpus_equal(map, data.started))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700132 cpu_relax();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700133 if (wait)
Jan Glauber63db6e82007-02-21 10:55:06 +0100134 while (!cpus_equal(map, data.finished))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700135 cpu_relax();
Heiko Carstens8da1aec2007-07-27 12:29:09 +0200136 spin_unlock(&call_lock);
Jan Glauber63db6e82007-02-21 10:55:06 +0100137out:
Heiko Carstens8da1aec2007-07-27 12:29:09 +0200138 if (local) {
139 local_irq_disable();
Jan Glauber63db6e82007-02-21 10:55:06 +0100140 func(info);
Heiko Carstens8da1aec2007-07-27 12:29:09 +0200141 local_irq_enable();
142 }
Jan Glauber63db6e82007-02-21 10:55:06 +0100143}
144
145/*
146 * smp_call_function:
147 * @func: the function to run; this must be fast and non-blocking
148 * @info: an arbitrary pointer to pass to the function
149 * @nonatomic: unused
150 * @wait: if true, wait (atomically) until function has completed on other CPUs
151 *
152 * Run a function on all other CPUs.
153 *
Heiko Carstens39ce0102007-04-27 16:02:00 +0200154 * You must not call this function with disabled interrupts, from a
155 * hardware interrupt handler or from a bottom half.
Jan Glauber63db6e82007-02-21 10:55:06 +0100156 */
157int smp_call_function(void (*func) (void *info), void *info, int nonatomic,
158 int wait)
159{
160 cpumask_t map;
161
Heiko Carstens25864162007-03-05 23:35:41 +0100162 preempt_disable();
Jan Glauber63db6e82007-02-21 10:55:06 +0100163 map = cpu_online_map;
164 cpu_clear(smp_processor_id(), map);
165 __smp_call_function_map(func, info, nonatomic, wait, map);
Heiko Carstens25864162007-03-05 23:35:41 +0100166 preempt_enable();
Jan Glauber63db6e82007-02-21 10:55:06 +0100167 return 0;
168}
169EXPORT_SYMBOL(smp_call_function);
170
171/*
Heiko Carstens3bb447f2007-07-27 12:29:08 +0200172 * smp_call_function_single:
173 * @cpu: the CPU where func should run
Jan Glauber63db6e82007-02-21 10:55:06 +0100174 * @func: the function to run; this must be fast and non-blocking
175 * @info: an arbitrary pointer to pass to the function
176 * @nonatomic: unused
177 * @wait: if true, wait (atomically) until function has completed on other CPUs
Jan Glauber63db6e82007-02-21 10:55:06 +0100178 *
179 * Run a function on one processor.
180 *
Heiko Carstens39ce0102007-04-27 16:02:00 +0200181 * You must not call this function with disabled interrupts, from a
182 * hardware interrupt handler or from a bottom half.
Jan Glauber63db6e82007-02-21 10:55:06 +0100183 */
Heiko Carstens3bb447f2007-07-27 12:29:08 +0200184int smp_call_function_single(int cpu, void (*func) (void *info), void *info,
185 int nonatomic, int wait)
Jan Glauber63db6e82007-02-21 10:55:06 +0100186{
Heiko Carstens25864162007-03-05 23:35:41 +0100187 preempt_disable();
Heiko Carstens3bb447f2007-07-27 12:29:08 +0200188 __smp_call_function_map(func, info, nonatomic, wait,
189 cpumask_of_cpu(cpu));
Heiko Carstens25864162007-03-05 23:35:41 +0100190 preempt_enable();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700191 return 0;
192}
Heiko Carstens3bb447f2007-07-27 12:29:08 +0200193EXPORT_SYMBOL(smp_call_function_single);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700194
Heiko Carstens4d284ca2007-02-05 21:18:53 +0100195static void do_send_stop(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700196{
Heiko Carstens39ce0102007-04-27 16:02:00 +0200197 int cpu, rc;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700198
Heiko Carstens39ce0102007-04-27 16:02:00 +0200199 /* stop all processors */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700200 for_each_online_cpu(cpu) {
201 if (cpu == smp_processor_id())
202 continue;
203 do {
204 rc = signal_processor(cpu, sigp_stop);
205 } while (rc == sigp_busy);
206 }
207}
208
Heiko Carstens4d284ca2007-02-05 21:18:53 +0100209static void do_store_status(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700210{
Heiko Carstens39ce0102007-04-27 16:02:00 +0200211 int cpu, rc;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700212
Heiko Carstens39ce0102007-04-27 16:02:00 +0200213 /* store status of all processors in their lowcores (real 0) */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700214 for_each_online_cpu(cpu) {
215 if (cpu == smp_processor_id())
216 continue;
217 do {
218 rc = signal_processor_p(
219 (__u32)(unsigned long) lowcore_ptr[cpu], cpu,
220 sigp_store_status_at_address);
Heiko Carstens39ce0102007-04-27 16:02:00 +0200221 } while (rc == sigp_busy);
222 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700223}
224
Heiko Carstens4d284ca2007-02-05 21:18:53 +0100225static void do_wait_for_stop(void)
Heiko Carstensc6b5b842006-12-04 15:40:33 +0100226{
227 int cpu;
228
229 /* Wait for all other cpus to enter stopped state */
230 for_each_online_cpu(cpu) {
231 if (cpu == smp_processor_id())
232 continue;
Heiko Carstens39ce0102007-04-27 16:02:00 +0200233 while (!smp_cpu_not_running(cpu))
Heiko Carstensc6b5b842006-12-04 15:40:33 +0100234 cpu_relax();
235 }
236}
237
Linus Torvalds1da177e2005-04-16 15:20:36 -0700238/*
239 * this function sends a 'stop' sigp to all other CPUs in the system.
240 * it goes straight through.
241 */
242void smp_send_stop(void)
243{
Heiko Carstensc6b5b842006-12-04 15:40:33 +0100244 /* Disable all interrupts/machine checks */
Gerald Schaeferc1821c22007-02-05 21:18:17 +0100245 __load_psw_mask(psw_kernel_bits & ~PSW_MASK_MCHECK);
Heiko Carstensc6b5b842006-12-04 15:40:33 +0100246
Heiko Carstens39ce0102007-04-27 16:02:00 +0200247 /* write magic number to zero page (absolute 0) */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700248 lowcore_ptr[smp_processor_id()]->panic_magic = __PANIC_MAGIC;
249
250 /* stop other processors. */
251 do_send_stop();
252
Heiko Carstensc6b5b842006-12-04 15:40:33 +0100253 /* wait until other processors are stopped */
254 do_wait_for_stop();
255
Linus Torvalds1da177e2005-04-16 15:20:36 -0700256 /* store status of other processors. */
257 do_store_status();
258}
259
260/*
261 * Reboot, halt and power_off routines for SMP.
262 */
Heiko Carstens39ce0102007-04-27 16:02:00 +0200263void machine_restart_smp(char *__unused)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700264{
Heiko Carstensc6b5b842006-12-04 15:40:33 +0100265 smp_send_stop();
266 do_reipl();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700267}
268
269void machine_halt_smp(void)
270{
Heiko Carstensc6b5b842006-12-04 15:40:33 +0100271 smp_send_stop();
272 if (MACHINE_IS_VM && strlen(vmhalt_cmd) > 0)
273 __cpcmd(vmhalt_cmd, NULL, 0, NULL);
274 signal_processor(smp_processor_id(), sigp_stop_and_store_status);
275 for (;;);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700276}
277
278void machine_power_off_smp(void)
279{
Heiko Carstensc6b5b842006-12-04 15:40:33 +0100280 smp_send_stop();
281 if (MACHINE_IS_VM && strlen(vmpoff_cmd) > 0)
282 __cpcmd(vmpoff_cmd, NULL, 0, NULL);
283 signal_processor(smp_processor_id(), sigp_stop_and_store_status);
284 for (;;);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700285}
286
287/*
288 * This is the main routine where commands issued by other
289 * cpus are handled.
290 */
291
Heiko Carstens2b67fc42007-02-05 21:16:47 +0100292static void do_ext_call_interrupt(__u16 code)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700293{
Heiko Carstens39ce0102007-04-27 16:02:00 +0200294 unsigned long bits;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700295
Heiko Carstens39ce0102007-04-27 16:02:00 +0200296 /*
297 * handle bit signal external calls
298 *
299 * For the ec_schedule signal we have to do nothing. All the work
300 * is done automatically when we return from the interrupt.
301 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700302 bits = xchg(&S390_lowcore.ext_call_fast, 0);
303
Heiko Carstens39ce0102007-04-27 16:02:00 +0200304 if (test_bit(ec_call_function, &bits))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700305 do_call_function();
306}
307
308/*
309 * Send an external call sigp to another cpu and return without waiting
310 * for its completion.
311 */
312static void smp_ext_bitcall(int cpu, ec_bit_sig sig)
313{
Heiko Carstens39ce0102007-04-27 16:02:00 +0200314 /*
315 * Set signaling bit in lowcore of target cpu and kick it
316 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700317 set_bit(sig, (unsigned long *) &lowcore_ptr[cpu]->ext_call_fast);
Heiko Carstens39ce0102007-04-27 16:02:00 +0200318 while (signal_processor(cpu, sigp_emergency_signal) == sigp_busy)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700319 udelay(10);
320}
321
Martin Schwidefsky347a8dc2006-01-06 00:19:28 -0800322#ifndef CONFIG_64BIT
Linus Torvalds1da177e2005-04-16 15:20:36 -0700323/*
324 * this function sends a 'purge tlb' signal to another CPU.
325 */
326void smp_ptlb_callback(void *info)
327{
328 local_flush_tlb();
329}
330
331void smp_ptlb_all(void)
332{
Heiko Carstens39ce0102007-04-27 16:02:00 +0200333 on_each_cpu(smp_ptlb_callback, NULL, 0, 1);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700334}
335EXPORT_SYMBOL(smp_ptlb_all);
Martin Schwidefsky347a8dc2006-01-06 00:19:28 -0800336#endif /* ! CONFIG_64BIT */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700337
338/*
339 * this function sends a 'reschedule' IPI to another CPU.
340 * it goes straight through and wastes no time serializing
341 * anything. Worst case is that we lose a reschedule ...
342 */
343void smp_send_reschedule(int cpu)
344{
Heiko Carstens39ce0102007-04-27 16:02:00 +0200345 smp_ext_bitcall(cpu, ec_schedule);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700346}
347
348/*
349 * parameter area for the set/clear control bit callbacks
350 */
Martin Schwidefsky94c12cc2006-09-28 16:56:43 +0200351struct ec_creg_mask_parms {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700352 unsigned long orvals[16];
353 unsigned long andvals[16];
Martin Schwidefsky94c12cc2006-09-28 16:56:43 +0200354};
Linus Torvalds1da177e2005-04-16 15:20:36 -0700355
356/*
357 * callback for setting/clearing control bits
358 */
Heiko Carstens39ce0102007-04-27 16:02:00 +0200359static void smp_ctl_bit_callback(void *info)
360{
Martin Schwidefsky94c12cc2006-09-28 16:56:43 +0200361 struct ec_creg_mask_parms *pp = info;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700362 unsigned long cregs[16];
363 int i;
Heiko Carstens39ce0102007-04-27 16:02:00 +0200364
Martin Schwidefsky94c12cc2006-09-28 16:56:43 +0200365 __ctl_store(cregs, 0, 15);
366 for (i = 0; i <= 15; i++)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700367 cregs[i] = (cregs[i] & pp->andvals[i]) | pp->orvals[i];
Martin Schwidefsky94c12cc2006-09-28 16:56:43 +0200368 __ctl_load(cregs, 0, 15);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700369}
370
371/*
372 * Set a bit in a control register of all cpus
373 */
Martin Schwidefsky94c12cc2006-09-28 16:56:43 +0200374void smp_ctl_set_bit(int cr, int bit)
375{
376 struct ec_creg_mask_parms parms;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700377
Martin Schwidefsky94c12cc2006-09-28 16:56:43 +0200378 memset(&parms.orvals, 0, sizeof(parms.orvals));
379 memset(&parms.andvals, 0xff, sizeof(parms.andvals));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700380 parms.orvals[cr] = 1 << bit;
Martin Schwidefsky94c12cc2006-09-28 16:56:43 +0200381 on_each_cpu(smp_ctl_bit_callback, &parms, 0, 1);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700382}
Heiko Carstens39ce0102007-04-27 16:02:00 +0200383EXPORT_SYMBOL(smp_ctl_set_bit);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700384
385/*
386 * Clear a bit in a control register of all cpus
387 */
Martin Schwidefsky94c12cc2006-09-28 16:56:43 +0200388void smp_ctl_clear_bit(int cr, int bit)
389{
390 struct ec_creg_mask_parms parms;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700391
Martin Schwidefsky94c12cc2006-09-28 16:56:43 +0200392 memset(&parms.orvals, 0, sizeof(parms.orvals));
393 memset(&parms.andvals, 0xff, sizeof(parms.andvals));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700394 parms.andvals[cr] = ~(1L << bit);
Martin Schwidefsky94c12cc2006-09-28 16:56:43 +0200395 on_each_cpu(smp_ctl_bit_callback, &parms, 0, 1);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700396}
Heiko Carstens39ce0102007-04-27 16:02:00 +0200397EXPORT_SYMBOL(smp_ctl_clear_bit);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700398
Michael Holzheu411ed322007-04-27 16:01:49 +0200399#if defined(CONFIG_ZFCPDUMP) || defined(CONFIG_ZFCPDUMP_MODULE)
400
401/*
402 * zfcpdump_prefix_array holds prefix registers for the following scenario:
403 * 64 bit zfcpdump kernel and 31 bit kernel which is to be dumped. We have to
404 * save its prefix registers, since they get lost, when switching from 31 bit
405 * to 64 bit.
406 */
407unsigned int zfcpdump_prefix_array[NR_CPUS + 1] \
408 __attribute__((__section__(".data")));
409
Heiko Carstens285f6722007-07-10 11:24:13 +0200410static void __init smp_get_save_area(unsigned int cpu, unsigned int phy_cpu)
Michael Holzheu411ed322007-04-27 16:01:49 +0200411{
Michael Holzheu411ed322007-04-27 16:01:49 +0200412 if (ipl_info.type != IPL_TYPE_FCP_DUMP)
413 return;
Heiko Carstens285f6722007-07-10 11:24:13 +0200414 if (cpu >= NR_CPUS) {
415 printk(KERN_WARNING "Registers for cpu %i not saved since dump "
416 "kernel was compiled with NR_CPUS=%i\n", cpu, NR_CPUS);
417 return;
Michael Holzheu411ed322007-04-27 16:01:49 +0200418 }
Heiko Carstens285f6722007-07-10 11:24:13 +0200419 zfcpdump_save_areas[cpu] = alloc_bootmem(sizeof(union save_area));
420 __cpu_logical_map[1] = (__u16) phy_cpu;
421 while (signal_processor(1, sigp_stop_and_store_status) == sigp_busy)
422 cpu_relax();
423 memcpy(zfcpdump_save_areas[cpu],
424 (void *)(unsigned long) store_prefix() + SAVE_AREA_BASE,
425 SAVE_AREA_SIZE);
426#ifdef CONFIG_64BIT
427 /* copy original prefix register */
428 zfcpdump_save_areas[cpu]->s390x.pref_reg = zfcpdump_prefix_array[cpu];
429#endif
Michael Holzheu411ed322007-04-27 16:01:49 +0200430}
431
432union save_area *zfcpdump_save_areas[NR_CPUS + 1];
433EXPORT_SYMBOL_GPL(zfcpdump_save_areas);
434
435#else
Heiko Carstens285f6722007-07-10 11:24:13 +0200436
437static inline void smp_get_save_area(unsigned int cpu, unsigned int phy_cpu) { }
438
439#endif /* CONFIG_ZFCPDUMP || CONFIG_ZFCPDUMP_MODULE */
Michael Holzheu411ed322007-04-27 16:01:49 +0200440
Linus Torvalds1da177e2005-04-16 15:20:36 -0700441/*
442 * Lets check how many CPUs we have.
443 */
Heiko Carstens39ce0102007-04-27 16:02:00 +0200444static unsigned int __init smp_count_cpus(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700445{
Heiko Carstens255acee2006-02-17 13:52:46 -0800446 unsigned int cpu, num_cpus;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700447 __u16 boot_cpu_addr;
448
449 /*
450 * cpu 0 is the boot cpu. See smp_prepare_boot_cpu.
451 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700452 boot_cpu_addr = S390_lowcore.cpu_data.cpu_addr;
453 current_thread_info()->cpu = 0;
454 num_cpus = 1;
Heiko Carstens255acee2006-02-17 13:52:46 -0800455 for (cpu = 0; cpu <= 65535; cpu++) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700456 if ((__u16) cpu == boot_cpu_addr)
457 continue;
Heiko Carstens255acee2006-02-17 13:52:46 -0800458 __cpu_logical_map[1] = (__u16) cpu;
Heiko Carstens39ce0102007-04-27 16:02:00 +0200459 if (signal_processor(1, sigp_sense) == sigp_not_operational)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700460 continue;
Heiko Carstens285f6722007-07-10 11:24:13 +0200461 smp_get_save_area(num_cpus, cpu);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700462 num_cpus++;
463 }
Heiko Carstens39ce0102007-04-27 16:02:00 +0200464 printk("Detected %d CPU's\n", (int) num_cpus);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700465 printk("Boot cpu address %2X\n", boot_cpu_addr);
Heiko Carstens255acee2006-02-17 13:52:46 -0800466 return num_cpus;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700467}
468
469/*
Heiko Carstens39ce0102007-04-27 16:02:00 +0200470 * Activate a secondary processor.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700471 */
Heiko Carstensea1f4ee2007-05-31 17:38:05 +0200472int __cpuinit start_secondary(void *cpuvoid)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700473{
Heiko Carstens39ce0102007-04-27 16:02:00 +0200474 /* Setup the cpu */
475 cpu_init();
Nick Piggin5bfb5d62005-11-08 21:39:01 -0800476 preempt_disable();
Martin Schwidefskyd54853e2007-02-05 21:18:19 +0100477 /* Enable TOD clock interrupts on the secondary cpu. */
Heiko Carstens39ce0102007-04-27 16:02:00 +0200478 init_cpu_timer();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700479#ifdef CONFIG_VIRT_TIMER
Martin Schwidefskyd54853e2007-02-05 21:18:19 +0100480 /* Enable cpu timer interrupts on the secondary cpu. */
Heiko Carstens39ce0102007-04-27 16:02:00 +0200481 init_cpu_vtimer();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700482#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700483 /* Enable pfault pseudo page faults on this cpu. */
Heiko Carstens29b08d22006-12-04 15:40:40 +0100484 pfault_init();
485
Linus Torvalds1da177e2005-04-16 15:20:36 -0700486 /* Mark this cpu as online */
487 cpu_set(smp_processor_id(), cpu_online_map);
488 /* Switch on interrupts */
489 local_irq_enable();
Heiko Carstens39ce0102007-04-27 16:02:00 +0200490 /* Print info about this processor */
491 print_cpu_info(&S390_lowcore.cpu_data);
492 /* cpu_idle will call schedule for us */
493 cpu_idle();
494 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700495}
496
497static void __init smp_create_idle(unsigned int cpu)
498{
499 struct task_struct *p;
500
501 /*
502 * don't care about the psw and regs settings since we'll never
503 * reschedule the forked task.
504 */
505 p = fork_idle(cpu);
506 if (IS_ERR(p))
507 panic("failed fork for CPU %u: %li", cpu, PTR_ERR(p));
508 current_set[cpu] = p;
509}
510
Heiko Carstens39ce0102007-04-27 16:02:00 +0200511static int cpu_stopped(int cpu)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700512{
513 __u32 status;
514
515 /* Check for stopped state */
Heiko Carstens39ce0102007-04-27 16:02:00 +0200516 if (signal_processor_ps(&status, 0, cpu, sigp_sense) ==
517 sigp_status_stored) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700518 if (status & 0x40)
519 return 1;
520 }
521 return 0;
522}
523
524/* Upping and downing of CPUs */
525
Heiko Carstens39ce0102007-04-27 16:02:00 +0200526int __cpu_up(unsigned int cpu)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700527{
528 struct task_struct *idle;
Heiko Carstens39ce0102007-04-27 16:02:00 +0200529 struct _lowcore *cpu_lowcore;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700530 struct stack_frame *sf;
Heiko Carstens39ce0102007-04-27 16:02:00 +0200531 sigp_ccode ccode;
532 int curr_cpu;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700533
534 for (curr_cpu = 0; curr_cpu <= 65535; curr_cpu++) {
535 __cpu_logical_map[cpu] = (__u16) curr_cpu;
536 if (cpu_stopped(cpu))
537 break;
538 }
539
540 if (!cpu_stopped(cpu))
541 return -ENODEV;
542
543 ccode = signal_processor_p((__u32)(unsigned long)(lowcore_ptr[cpu]),
544 cpu, sigp_set_prefix);
Heiko Carstens39ce0102007-04-27 16:02:00 +0200545 if (ccode) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700546 printk("sigp_set_prefix failed for cpu %d "
547 "with condition code %d\n",
548 (int) cpu, (int) ccode);
549 return -EIO;
550 }
551
552 idle = current_set[cpu];
Heiko Carstens39ce0102007-04-27 16:02:00 +0200553 cpu_lowcore = lowcore_ptr[cpu];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700554 cpu_lowcore->kernel_stack = (unsigned long)
Heiko Carstens39ce0102007-04-27 16:02:00 +0200555 task_stack_page(idle) + THREAD_SIZE;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700556 sf = (struct stack_frame *) (cpu_lowcore->kernel_stack
557 - sizeof(struct pt_regs)
558 - sizeof(struct stack_frame));
559 memset(sf, 0, sizeof(struct stack_frame));
560 sf->gprs[9] = (unsigned long) sf;
561 cpu_lowcore->save_area[15] = (unsigned long) sf;
562 __ctl_store(cpu_lowcore->cregs_save_area[0], 0, 15);
Martin Schwidefsky94c12cc2006-09-28 16:56:43 +0200563 asm volatile(
564 " stam 0,15,0(%0)"
565 : : "a" (&cpu_lowcore->access_regs_save_area) : "memory");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700566 cpu_lowcore->percpu_offset = __per_cpu_offset[cpu];
Heiko Carstens39ce0102007-04-27 16:02:00 +0200567 cpu_lowcore->current_task = (unsigned long) idle;
568 cpu_lowcore->cpu_data.cpu_nr = cpu;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700569 eieio();
Michael Ryan699ff132006-03-24 03:15:17 -0800570
Heiko Carstens39ce0102007-04-27 16:02:00 +0200571 while (signal_processor(cpu, sigp_restart) == sigp_busy)
Michael Ryan699ff132006-03-24 03:15:17 -0800572 udelay(10);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700573
574 while (!cpu_online(cpu))
575 cpu_relax();
576 return 0;
577}
578
Heiko Carstens255acee2006-02-17 13:52:46 -0800579static unsigned int __initdata additional_cpus;
Heiko Carstens37a33022006-02-17 13:52:47 -0800580static unsigned int __initdata possible_cpus;
Heiko Carstens255acee2006-02-17 13:52:46 -0800581
582void __init smp_setup_cpu_possible_map(void)
583{
Heiko Carstens54330452006-02-17 13:52:48 -0800584 unsigned int phy_cpus, pos_cpus, cpu;
Heiko Carstens255acee2006-02-17 13:52:46 -0800585
Heiko Carstens54330452006-02-17 13:52:48 -0800586 phy_cpus = smp_count_cpus();
587 pos_cpus = min(phy_cpus + additional_cpus, (unsigned int) NR_CPUS);
Heiko Carstens255acee2006-02-17 13:52:46 -0800588
Heiko Carstens37a33022006-02-17 13:52:47 -0800589 if (possible_cpus)
Heiko Carstens54330452006-02-17 13:52:48 -0800590 pos_cpus = min(possible_cpus, (unsigned int) NR_CPUS);
Heiko Carstens255acee2006-02-17 13:52:46 -0800591
Heiko Carstens54330452006-02-17 13:52:48 -0800592 for (cpu = 0; cpu < pos_cpus; cpu++)
Heiko Carstens255acee2006-02-17 13:52:46 -0800593 cpu_set(cpu, cpu_possible_map);
594
Heiko Carstens54330452006-02-17 13:52:48 -0800595 phy_cpus = min(phy_cpus, pos_cpus);
596
597 for (cpu = 0; cpu < phy_cpus; cpu++)
598 cpu_set(cpu, cpu_present_map);
Heiko Carstens255acee2006-02-17 13:52:46 -0800599}
600
601#ifdef CONFIG_HOTPLUG_CPU
602
603static int __init setup_additional_cpus(char *s)
604{
605 additional_cpus = simple_strtoul(s, NULL, 0);
606 return 0;
607}
608early_param("additional_cpus", setup_additional_cpus);
609
Heiko Carstens37a33022006-02-17 13:52:47 -0800610static int __init setup_possible_cpus(char *s)
611{
612 possible_cpus = simple_strtoul(s, NULL, 0);
613 return 0;
614}
615early_param("possible_cpus", setup_possible_cpus);
616
Heiko Carstens39ce0102007-04-27 16:02:00 +0200617int __cpu_disable(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700618{
Martin Schwidefsky94c12cc2006-09-28 16:56:43 +0200619 struct ec_creg_mask_parms cr_parms;
Zwane Mwaikambof3705132005-06-25 14:54:50 -0700620 int cpu = smp_processor_id();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700621
Zwane Mwaikambof3705132005-06-25 14:54:50 -0700622 cpu_clear(cpu, cpu_online_map);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700623
Linus Torvalds1da177e2005-04-16 15:20:36 -0700624 /* Disable pfault pseudo page faults on this cpu. */
Heiko Carstens29b08d22006-12-04 15:40:40 +0100625 pfault_fini();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700626
Martin Schwidefsky94c12cc2006-09-28 16:56:43 +0200627 memset(&cr_parms.orvals, 0, sizeof(cr_parms.orvals));
628 memset(&cr_parms.andvals, 0xff, sizeof(cr_parms.andvals));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700629
Martin Schwidefsky94c12cc2006-09-28 16:56:43 +0200630 /* disable all external interrupts */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700631 cr_parms.orvals[0] = 0;
Heiko Carstens39ce0102007-04-27 16:02:00 +0200632 cr_parms.andvals[0] = ~(1 << 15 | 1 << 14 | 1 << 13 | 1 << 12 |
633 1 << 11 | 1 << 10 | 1 << 6 | 1 << 4);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700634 /* disable all I/O interrupts */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700635 cr_parms.orvals[6] = 0;
Heiko Carstens39ce0102007-04-27 16:02:00 +0200636 cr_parms.andvals[6] = ~(1 << 31 | 1 << 30 | 1 << 29 | 1 << 28 |
637 1 << 27 | 1 << 26 | 1 << 25 | 1 << 24);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700638 /* disable most machine checks */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700639 cr_parms.orvals[14] = 0;
Heiko Carstens39ce0102007-04-27 16:02:00 +0200640 cr_parms.andvals[14] = ~(1 << 28 | 1 << 27 | 1 << 26 |
641 1 << 25 | 1 << 24);
Martin Schwidefsky94c12cc2006-09-28 16:56:43 +0200642
Linus Torvalds1da177e2005-04-16 15:20:36 -0700643 smp_ctl_bit_callback(&cr_parms);
644
Linus Torvalds1da177e2005-04-16 15:20:36 -0700645 return 0;
646}
647
Heiko Carstens39ce0102007-04-27 16:02:00 +0200648void __cpu_die(unsigned int cpu)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700649{
650 /* Wait until target cpu is down */
651 while (!smp_cpu_not_running(cpu))
652 cpu_relax();
653 printk("Processor %d spun down\n", cpu);
654}
655
Heiko Carstens39ce0102007-04-27 16:02:00 +0200656void cpu_die(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700657{
658 idle_task_exit();
659 signal_processor(smp_processor_id(), sigp_stop);
660 BUG();
Heiko Carstens39ce0102007-04-27 16:02:00 +0200661 for (;;);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700662}
663
Heiko Carstens255acee2006-02-17 13:52:46 -0800664#endif /* CONFIG_HOTPLUG_CPU */
665
Linus Torvalds1da177e2005-04-16 15:20:36 -0700666/*
667 * Cycle through the processors and setup structures.
668 */
669
670void __init smp_prepare_cpus(unsigned int max_cpus)
671{
672 unsigned long stack;
673 unsigned int cpu;
Heiko Carstens39ce0102007-04-27 16:02:00 +0200674 int i;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700675
Heiko Carstens39ce0102007-04-27 16:02:00 +0200676 /* request the 0x1201 emergency signal external interrupt */
677 if (register_external_interrupt(0x1201, do_ext_call_interrupt) != 0)
678 panic("Couldn't request external interrupt 0x1201");
679 memset(lowcore_ptr, 0, sizeof(lowcore_ptr));
680 /*
681 * Initialize prefix pages and stacks for all possible cpus
682 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700683 print_cpu_info(&S390_lowcore.cpu_data);
684
Heiko Carstens39ce0102007-04-27 16:02:00 +0200685 for_each_possible_cpu(i) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700686 lowcore_ptr[i] = (struct _lowcore *)
Heiko Carstens39ce0102007-04-27 16:02:00 +0200687 __get_free_pages(GFP_KERNEL | GFP_DMA,
688 sizeof(void*) == 8 ? 1 : 0);
689 stack = __get_free_pages(GFP_KERNEL, ASYNC_ORDER);
690 if (!lowcore_ptr[i] || !stack)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700691 panic("smp_boot_cpus failed to allocate memory\n");
692
693 *(lowcore_ptr[i]) = S390_lowcore;
Heiko Carstens39ce0102007-04-27 16:02:00 +0200694 lowcore_ptr[i]->async_stack = stack + ASYNC_SIZE;
695 stack = __get_free_pages(GFP_KERNEL, 0);
696 if (!stack)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700697 panic("smp_boot_cpus failed to allocate memory\n");
Heiko Carstens39ce0102007-04-27 16:02:00 +0200698 lowcore_ptr[i]->panic_stack = stack + PAGE_SIZE;
Martin Schwidefsky347a8dc2006-01-06 00:19:28 -0800699#ifndef CONFIG_64BIT
Heiko Carstens77fa2242005-06-25 14:55:30 -0700700 if (MACHINE_HAS_IEEE) {
701 lowcore_ptr[i]->extended_save_area_addr =
Heiko Carstens39ce0102007-04-27 16:02:00 +0200702 (__u32) __get_free_pages(GFP_KERNEL, 0);
703 if (!lowcore_ptr[i]->extended_save_area_addr)
Heiko Carstens77fa2242005-06-25 14:55:30 -0700704 panic("smp_boot_cpus failed to "
705 "allocate memory\n");
706 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700707#endif
708 }
Martin Schwidefsky347a8dc2006-01-06 00:19:28 -0800709#ifndef CONFIG_64BIT
Heiko Carstens77fa2242005-06-25 14:55:30 -0700710 if (MACHINE_HAS_IEEE)
711 ctl_set_bit(14, 29); /* enable extended save area */
712#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700713 set_prefix((u32)(unsigned long) lowcore_ptr[smp_processor_id()]);
714
KAMEZAWA Hiroyuki97db7fb2006-03-31 02:30:26 -0800715 for_each_possible_cpu(cpu)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700716 if (cpu != smp_processor_id())
717 smp_create_idle(cpu);
718}
719
Heiko Carstensea1f4ee2007-05-31 17:38:05 +0200720void __init smp_prepare_boot_cpu(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700721{
722 BUG_ON(smp_processor_id() != 0);
723
724 cpu_set(0, cpu_online_map);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700725 S390_lowcore.percpu_offset = __per_cpu_offset[0];
726 current_set[0] = current;
727}
728
Heiko Carstensea1f4ee2007-05-31 17:38:05 +0200729void __init smp_cpus_done(unsigned int max_cpus)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700730{
Heiko Carstens54330452006-02-17 13:52:48 -0800731 cpu_present_map = cpu_possible_map;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700732}
733
734/*
735 * the frequency of the profiling timer can be changed
736 * by writing a multiplier value into /proc/profile.
737 *
738 * usually you want to run this on all CPUs ;)
739 */
740int setup_profiling_timer(unsigned int multiplier)
741{
Heiko Carstens39ce0102007-04-27 16:02:00 +0200742 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700743}
744
745static DEFINE_PER_CPU(struct cpu, cpu_devices);
746
Heiko Carstens2fc2d1e2007-04-27 16:01:56 +0200747static ssize_t show_capability(struct sys_device *dev, char *buf)
748{
749 unsigned int capability;
750 int rc;
751
752 rc = get_cpu_capability(&capability);
753 if (rc)
754 return rc;
755 return sprintf(buf, "%u\n", capability);
756}
757static SYSDEV_ATTR(capability, 0444, show_capability, NULL);
758
759static int __cpuinit smp_cpu_notify(struct notifier_block *self,
760 unsigned long action, void *hcpu)
761{
762 unsigned int cpu = (unsigned int)(long)hcpu;
763 struct cpu *c = &per_cpu(cpu_devices, cpu);
764 struct sys_device *s = &c->sysdev;
765
766 switch (action) {
767 case CPU_ONLINE:
Rafael J. Wysocki8bb78442007-05-09 02:35:10 -0700768 case CPU_ONLINE_FROZEN:
Heiko Carstens2fc2d1e2007-04-27 16:01:56 +0200769 if (sysdev_create_file(s, &attr_capability))
770 return NOTIFY_BAD;
771 break;
772 case CPU_DEAD:
Rafael J. Wysocki8bb78442007-05-09 02:35:10 -0700773 case CPU_DEAD_FROZEN:
Heiko Carstens2fc2d1e2007-04-27 16:01:56 +0200774 sysdev_remove_file(s, &attr_capability);
775 break;
776 }
777 return NOTIFY_OK;
778}
779
780static struct notifier_block __cpuinitdata smp_cpu_nb = {
Heiko Carstens39ce0102007-04-27 16:02:00 +0200781 .notifier_call = smp_cpu_notify,
Heiko Carstens2fc2d1e2007-04-27 16:01:56 +0200782};
783
Linus Torvalds1da177e2005-04-16 15:20:36 -0700784static int __init topology_init(void)
785{
786 int cpu;
Heiko Carstens2fc2d1e2007-04-27 16:01:56 +0200787
788 register_cpu_notifier(&smp_cpu_nb);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700789
KAMEZAWA Hiroyuki97db7fb2006-03-31 02:30:26 -0800790 for_each_possible_cpu(cpu) {
Heiko Carstens6721f772007-01-09 10:18:44 +0100791 struct cpu *c = &per_cpu(cpu_devices, cpu);
Heiko Carstens2fc2d1e2007-04-27 16:01:56 +0200792 struct sys_device *s = &c->sysdev;
Heiko Carstens6721f772007-01-09 10:18:44 +0100793
794 c->hotpluggable = 1;
Heiko Carstens2fc2d1e2007-04-27 16:01:56 +0200795 register_cpu(c, cpu);
796 if (!cpu_online(cpu))
797 continue;
798 s = &c->sysdev;
799 sysdev_create_file(s, &attr_capability);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700800 }
801 return 0;
802}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700803subsys_initcall(topology_init);