blob: d81a2dd787ac11676b4d1000ffa948bb226f4c6b [file] [log] [blame]
Dean Nelson89eb8eb2005-03-23 19:50:00 -07001/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
Dean Nelson45d9ca42008-04-22 14:46:56 -05006 * Copyright (c) 2004-2008 Silicon Graphics, Inc. All Rights Reserved.
Dean Nelson89eb8eb2005-03-23 19:50:00 -07007 */
8
Dean Nelson89eb8eb2005-03-23 19:50:00 -07009/*
10 * Cross Partition Communication (XPC) support - standard version.
11 *
12 * XPC provides a message passing capability that crosses partition
13 * boundaries. This module is made up of two parts:
14 *
15 * partition This part detects the presence/absence of other
16 * partitions. It provides a heartbeat and monitors
17 * the heartbeats of other partitions.
18 *
19 * channel This part manages the channels and sends/receives
20 * messages across them to/from other partitions.
21 *
22 * There are a couple of additional functions residing in XP, which
23 * provide an interface to XPC for its users.
24 *
25 *
26 * Caveats:
27 *
28 * . We currently have no way to determine which nasid an IPI came
29 * from. Thus, xpc_IPI_send() does a remote AMO write followed by
30 * an IPI. The AMO indicates where data is to be pulled from, so
31 * after the IPI arrives, the remote partition checks the AMO word.
32 * The IPI can actually arrive before the AMO however, so other code
33 * must periodically check for this case. Also, remote AMO operations
34 * do not reliably time out. Thus we do a remote PIO read solely to
35 * know whether the remote partition is down and whether we should
36 * stop sending IPIs to it. This remote PIO read operation is set up
37 * in a special nofault region so SAL knows to ignore (and cleanup)
38 * any errors due to the remote AMO write, PIO read, and/or PIO
39 * write operations.
40 *
41 * If/when new hardware solves this IPI problem, we should abandon
42 * the current approach.
43 *
44 */
45
Dean Nelson89eb8eb2005-03-23 19:50:00 -070046#include <linux/kernel.h>
47#include <linux/module.h>
48#include <linux/init.h>
49#include <linux/sched.h>
50#include <linux/syscalls.h>
51#include <linux/cache.h>
52#include <linux/interrupt.h>
Nishanth Aravamudan69913922005-07-08 17:10:00 -070053#include <linux/delay.h>
Dean Nelsona607c382005-09-01 14:01:37 -050054#include <linux/reboot.h>
Jes Sorensenf9e505a2006-01-17 12:52:21 -050055#include <linux/completion.h>
Christoph Hellwig1eeb66a2007-05-08 00:27:03 -070056#include <linux/kdebug.h>
Dean Nelson89eb8eb2005-03-23 19:50:00 -070057#include <asm/sn/intr.h>
58#include <asm/sn/sn_sal.h>
59#include <asm/uaccess.h>
Dean Nelson45d9ca42008-04-22 14:46:56 -050060#include "xpc.h"
Dean Nelson89eb8eb2005-03-23 19:50:00 -070061
Dean Nelson89eb8eb2005-03-23 19:50:00 -070062/* define two XPC debug device structures to be used with dev_dbg() et al */
63
64struct device_driver xpc_dbg_name = {
65 .name = "xpc"
66};
67
68struct device xpc_part_dbg_subname = {
69 .bus_id = {0}, /* set to "part" at xpc_init() time */
70 .driver = &xpc_dbg_name
71};
72
73struct device xpc_chan_dbg_subname = {
74 .bus_id = {0}, /* set to "chan" at xpc_init() time */
75 .driver = &xpc_dbg_name
76};
77
78struct device *xpc_part = &xpc_part_dbg_subname;
79struct device *xpc_chan = &xpc_chan_dbg_subname;
80
Dean Nelson1f4674b2006-01-10 11:08:00 -060081static int xpc_kdebug_ignore;
82
Dean Nelson89eb8eb2005-03-23 19:50:00 -070083/* systune related variables for /proc/sys directories */
84
Dean Nelsona607c382005-09-01 14:01:37 -050085static int xpc_hb_interval = XPC_HB_DEFAULT_INTERVAL;
86static int xpc_hb_min_interval = 1;
87static int xpc_hb_max_interval = 10;
Dean Nelson89eb8eb2005-03-23 19:50:00 -070088
Dean Nelsona607c382005-09-01 14:01:37 -050089static int xpc_hb_check_interval = XPC_HB_CHECK_DEFAULT_INTERVAL;
90static int xpc_hb_check_min_interval = 10;
91static int xpc_hb_check_max_interval = 120;
Dean Nelson89eb8eb2005-03-23 19:50:00 -070092
Dean Nelsone54af722005-10-25 14:07:43 -050093int xpc_disengage_request_timelimit = XPC_DISENGAGE_REQUEST_DEFAULT_TIMELIMIT;
94static int xpc_disengage_request_min_timelimit = 0;
95static int xpc_disengage_request_max_timelimit = 120;
Dean Nelson89eb8eb2005-03-23 19:50:00 -070096
97static ctl_table xpc_sys_xpc_hb_dir[] = {
98 {
Dean Nelson35190502008-04-22 14:48:55 -050099 .ctl_name = CTL_UNNUMBERED,
100 .procname = "hb_interval",
101 .data = &xpc_hb_interval,
102 .maxlen = sizeof(int),
103 .mode = 0644,
104 .proc_handler = &proc_dointvec_minmax,
105 .strategy = &sysctl_intvec,
106 .extra1 = &xpc_hb_min_interval,
107 .extra2 = &xpc_hb_max_interval},
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700108 {
Dean Nelson35190502008-04-22 14:48:55 -0500109 .ctl_name = CTL_UNNUMBERED,
110 .procname = "hb_check_interval",
111 .data = &xpc_hb_check_interval,
112 .maxlen = sizeof(int),
113 .mode = 0644,
114 .proc_handler = &proc_dointvec_minmax,
115 .strategy = &sysctl_intvec,
116 .extra1 = &xpc_hb_check_min_interval,
117 .extra2 = &xpc_hb_check_max_interval},
Eric W. Biederman68cbf072007-02-14 00:33:41 -0800118 {}
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700119};
120static ctl_table xpc_sys_xpc_dir[] = {
121 {
Dean Nelson35190502008-04-22 14:48:55 -0500122 .ctl_name = CTL_UNNUMBERED,
123 .procname = "hb",
124 .mode = 0555,
125 .child = xpc_sys_xpc_hb_dir},
Dean Nelsone54af722005-10-25 14:07:43 -0500126 {
Dean Nelson35190502008-04-22 14:48:55 -0500127 .ctl_name = CTL_UNNUMBERED,
128 .procname = "disengage_request_timelimit",
129 .data = &xpc_disengage_request_timelimit,
130 .maxlen = sizeof(int),
131 .mode = 0644,
132 .proc_handler = &proc_dointvec_minmax,
133 .strategy = &sysctl_intvec,
134 .extra1 = &xpc_disengage_request_min_timelimit,
135 .extra2 = &xpc_disengage_request_max_timelimit},
Eric W. Biederman68cbf072007-02-14 00:33:41 -0800136 {}
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700137};
138static ctl_table xpc_sys_dir[] = {
139 {
Dean Nelson35190502008-04-22 14:48:55 -0500140 .ctl_name = CTL_UNNUMBERED,
141 .procname = "xpc",
142 .mode = 0555,
143 .child = xpc_sys_xpc_dir},
Eric W. Biederman68cbf072007-02-14 00:33:41 -0800144 {}
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700145};
146static struct ctl_table_header *xpc_sysctl;
147
Dean Nelson1ecaded2006-01-06 09:48:21 -0600148/* non-zero if any remote partition disengage request was timed out */
149int xpc_disengage_request_timedout;
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700150
151/* #of IRQs received */
152static atomic_t xpc_act_IRQ_rcvd;
153
154/* IRQ handler notifies this wait queue on receipt of an IRQ */
155static DECLARE_WAIT_QUEUE_HEAD(xpc_act_IRQ_wq);
156
157static unsigned long xpc_hb_check_timeout;
158
Dean Nelsone54af722005-10-25 14:07:43 -0500159/* notification that the xpc_hb_checker thread has exited */
Jes Sorensenf9e505a2006-01-17 12:52:21 -0500160static DECLARE_COMPLETION(xpc_hb_checker_exited);
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700161
Dean Nelsone54af722005-10-25 14:07:43 -0500162/* notification that the xpc_discovery thread has exited */
Jes Sorensenf9e505a2006-01-17 12:52:21 -0500163static DECLARE_COMPLETION(xpc_discovery_exited);
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700164
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700165static struct timer_list xpc_hb_timer;
166
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700167static void xpc_kthread_waitmsgs(struct xpc_partition *, struct xpc_channel *);
168
Dean Nelsona607c382005-09-01 14:01:37 -0500169static int xpc_system_reboot(struct notifier_block *, unsigned long, void *);
170static struct notifier_block xpc_reboot_notifier = {
171 .notifier_call = xpc_system_reboot,
172};
173
Dean Nelson780d09e2005-11-09 14:41:57 -0600174static int xpc_system_die(struct notifier_block *, unsigned long, void *);
175static struct notifier_block xpc_die_notifier = {
176 .notifier_call = xpc_system_die,
177};
178
Dean Nelsona607c382005-09-01 14:01:37 -0500179/*
180 * Timer function to enforce the timelimit on the partition disengage request.
181 */
182static void
183xpc_timeout_partition_disengage_request(unsigned long data)
184{
Dean Nelson35190502008-04-22 14:48:55 -0500185 struct xpc_partition *part = (struct xpc_partition *)data;
Dean Nelsona607c382005-09-01 14:01:37 -0500186
Robert P. J. Dayd167cb82008-03-29 10:05:30 -0400187 DBUG_ON(time_before(jiffies, part->disengage_request_timeout));
Dean Nelsona607c382005-09-01 14:01:37 -0500188
Dean Nelson35190502008-04-22 14:48:55 -0500189 (void)xpc_partition_disengaged(part);
Dean Nelsona607c382005-09-01 14:01:37 -0500190
191 DBUG_ON(part->disengage_request_timeout != 0);
192 DBUG_ON(xpc_partition_engaged(1UL << XPC_PARTID(part)) != 0);
193}
194
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700195/*
196 * Notify the heartbeat check thread that an IRQ has been received.
197 */
198static irqreturn_t
Al Viro5dcded12006-10-08 14:59:19 +0100199xpc_act_IRQ_handler(int irq, void *dev_id)
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700200{
201 atomic_inc(&xpc_act_IRQ_rcvd);
202 wake_up_interruptible(&xpc_act_IRQ_wq);
203 return IRQ_HANDLED;
204}
205
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700206/*
207 * Timer to produce the heartbeat. The timer structures function is
208 * already set when this is initially called. A tunable is used to
209 * specify when the next timeout should occur.
210 */
211static void
212xpc_hb_beater(unsigned long dummy)
213{
214 xpc_vars->heartbeat++;
215
Robert P. J. Dayd167cb82008-03-29 10:05:30 -0400216 if (time_after_eq(jiffies, xpc_hb_check_timeout)) {
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700217 wake_up_interruptible(&xpc_act_IRQ_wq);
218 }
219
220 xpc_hb_timer.expires = jiffies + (xpc_hb_interval * HZ);
221 add_timer(&xpc_hb_timer);
222}
223
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700224/*
225 * This thread is responsible for nearly all of the partition
226 * activation/deactivation.
227 */
228static int
229xpc_hb_checker(void *ignore)
230{
231 int last_IRQ_count = 0;
232 int new_IRQ_count;
Dean Nelson35190502008-04-22 14:48:55 -0500233 int force_IRQ = 0;
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700234
235 /* this thread was marked active by xpc_hb_init() */
236
237 daemonize(XPC_HB_CHECK_THREAD_NAME);
238
239 set_cpus_allowed(current, cpumask_of_cpu(XPC_HB_CHECK_CPU));
240
Dean Nelson4c013f52007-11-07 07:53:06 -0600241 /* set our heartbeating to other partitions into motion */
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700242 xpc_hb_check_timeout = jiffies + (xpc_hb_check_interval * HZ);
Dean Nelson4c013f52007-11-07 07:53:06 -0600243 xpc_hb_beater(0);
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700244
Dean Nelson35190502008-04-22 14:48:55 -0500245 while (!(volatile int)xpc_exiting) {
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700246
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700247 dev_dbg(xpc_part, "woke up with %d ticks rem; %d IRQs have "
248 "been received\n",
Dean Nelson35190502008-04-22 14:48:55 -0500249 (int)(xpc_hb_check_timeout - jiffies),
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700250 atomic_read(&xpc_act_IRQ_rcvd) - last_IRQ_count);
251
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700252 /* checking of remote heartbeats is skewed by IRQ handling */
Robert P. J. Dayd167cb82008-03-29 10:05:30 -0400253 if (time_after_eq(jiffies, xpc_hb_check_timeout)) {
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700254 dev_dbg(xpc_part, "checking remote heartbeats\n");
255 xpc_check_remote_hb();
256
257 /*
258 * We need to periodically recheck to ensure no
259 * IPI/AMO pairs have been missed. That check
260 * must always reset xpc_hb_check_timeout.
261 */
262 force_IRQ = 1;
263 }
264
Dean Nelsona607c382005-09-01 14:01:37 -0500265 /* check for outstanding IRQs */
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700266 new_IRQ_count = atomic_read(&xpc_act_IRQ_rcvd);
267 if (last_IRQ_count < new_IRQ_count || force_IRQ != 0) {
268 force_IRQ = 0;
269
270 dev_dbg(xpc_part, "found an IRQ to process; will be "
271 "resetting xpc_hb_check_timeout\n");
272
273 last_IRQ_count += xpc_identify_act_IRQ_sender();
274 if (last_IRQ_count < new_IRQ_count) {
275 /* retry once to help avoid missing AMO */
Dean Nelson35190502008-04-22 14:48:55 -0500276 (void)xpc_identify_act_IRQ_sender();
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700277 }
278 last_IRQ_count = new_IRQ_count;
279
280 xpc_hb_check_timeout = jiffies +
Dean Nelson35190502008-04-22 14:48:55 -0500281 (xpc_hb_check_interval * HZ);
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700282 }
Dean Nelsona607c382005-09-01 14:01:37 -0500283
284 /* wait for IRQ or timeout */
Dean Nelson35190502008-04-22 14:48:55 -0500285 (void)wait_event_interruptible(xpc_act_IRQ_wq,
286 (last_IRQ_count <
287 atomic_read(&xpc_act_IRQ_rcvd)
288 || time_after_eq(jiffies,
289 xpc_hb_check_timeout) ||
290 (volatile int)xpc_exiting));
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700291 }
292
293 dev_dbg(xpc_part, "heartbeat checker is exiting\n");
294
Dean Nelsone54af722005-10-25 14:07:43 -0500295 /* mark this thread as having exited */
Jes Sorensenf9e505a2006-01-17 12:52:21 -0500296 complete(&xpc_hb_checker_exited);
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700297 return 0;
298}
299
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700300/*
301 * This thread will attempt to discover other partitions to activate
302 * based on info provided by SAL. This new thread is short lived and
303 * will exit once discovery is complete.
304 */
305static int
306xpc_initiate_discovery(void *ignore)
307{
308 daemonize(XPC_DISCOVERY_THREAD_NAME);
309
310 xpc_discovery();
311
312 dev_dbg(xpc_part, "discovery thread is exiting\n");
313
Dean Nelsone54af722005-10-25 14:07:43 -0500314 /* mark this thread as having exited */
Jes Sorensenf9e505a2006-01-17 12:52:21 -0500315 complete(&xpc_discovery_exited);
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700316 return 0;
317}
318
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700319/*
320 * Establish first contact with the remote partititon. This involves pulling
321 * the XPC per partition variables from the remote partition and waiting for
322 * the remote partition to pull ours.
323 */
324static enum xpc_retval
325xpc_make_first_contact(struct xpc_partition *part)
326{
327 enum xpc_retval ret;
328
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700329 while ((ret = xpc_pull_remote_vars_part(part)) != xpcSuccess) {
330 if (ret != xpcRetry) {
331 XPC_DEACTIVATE_PARTITION(part, ret);
332 return ret;
333 }
334
335 dev_dbg(xpc_chan, "waiting to make first contact with "
336 "partition %d\n", XPC_PARTID(part));
337
338 /* wait a 1/4 of a second or so */
Dean Nelson35190502008-04-22 14:48:55 -0500339 (void)msleep_interruptible(250);
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700340
341 if (part->act_state == XPC_P_DEACTIVATING) {
342 return part->reason;
343 }
344 }
345
346 return xpc_mark_partition_active(part);
347}
348
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700349/*
350 * The first kthread assigned to a newly activated partition is the one
351 * created by XPC HB with which it calls xpc_partition_up(). XPC hangs on to
352 * that kthread until the partition is brought down, at which time that kthread
353 * returns back to XPC HB. (The return of that kthread will signify to XPC HB
354 * that XPC has dismantled all communication infrastructure for the associated
355 * partition.) This kthread becomes the channel manager for that partition.
356 *
357 * Each active partition has a channel manager, who, besides connecting and
358 * disconnecting channels, will ensure that each of the partition's connected
359 * channels has the required number of assigned kthreads to get the work done.
360 */
361static void
362xpc_channel_mgr(struct xpc_partition *part)
363{
364 while (part->act_state != XPC_P_DEACTIVATING ||
Dean Nelson35190502008-04-22 14:48:55 -0500365 atomic_read(&part->nchannels_active) > 0 ||
366 !xpc_partition_disengaged(part)) {
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700367
368 xpc_process_channel_activity(part);
369
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700370 /*
371 * Wait until we've been requested to activate kthreads or
372 * all of the channel's message queues have been torn down or
373 * a signal is pending.
374 *
375 * The channel_mgr_requests is set to 1 after being awakened,
376 * This is done to prevent the channel mgr from making one pass
377 * through the loop for each request, since he will
378 * be servicing all the requests in one pass. The reason it's
379 * set to 1 instead of 0 is so that other kthreads will know
380 * that the channel mgr is running and won't bother trying to
381 * wake him up.
382 */
383 atomic_dec(&part->channel_mgr_requests);
Dean Nelson35190502008-04-22 14:48:55 -0500384 (void)wait_event_interruptible(part->channel_mgr_wq,
385 (atomic_read
386 (&part->channel_mgr_requests) >
387 0 ||
388 (volatile u64)part->
389 local_IPI_amo != 0 ||
390 ((volatile u8)part->act_state ==
391 XPC_P_DEACTIVATING &&
392 atomic_read(&part->
393 nchannels_active)
394 == 0 &&
395 xpc_partition_disengaged
396 (part))));
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700397 atomic_set(&part->channel_mgr_requests, 1);
398
399 // >>> Does it need to wakeup periodically as well? In case we
400 // >>> miscalculated the #of kthreads to wakeup or create?
401 }
402}
403
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700404/*
405 * When XPC HB determines that a partition has come up, it will create a new
406 * kthread and that kthread will call this function to attempt to set up the
407 * basic infrastructure used for Cross Partition Communication with the newly
408 * upped partition.
409 *
410 * The kthread that was created by XPC HB and which setup the XPC
411 * infrastructure will remain assigned to the partition until the partition
412 * goes down. At which time the kthread will teardown the XPC infrastructure
413 * and then exit.
414 *
415 * XPC HB will put the remote partition's XPC per partition specific variables
416 * physical address into xpc_partitions[partid].remote_vars_part_pa prior to
417 * calling xpc_partition_up().
418 */
419static void
420xpc_partition_up(struct xpc_partition *part)
421{
422 DBUG_ON(part->channels != NULL);
423
424 dev_dbg(xpc_chan, "activating partition %d\n", XPC_PARTID(part));
425
426 if (xpc_setup_infrastructure(part) != xpcSuccess) {
427 return;
428 }
429
430 /*
431 * The kthread that XPC HB called us with will become the
432 * channel manager for this partition. It will not return
433 * back to XPC HB until the partition's XPC infrastructure
434 * has been dismantled.
435 */
436
Dean Nelson35190502008-04-22 14:48:55 -0500437 (void)xpc_part_ref(part); /* this will always succeed */
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700438
439 if (xpc_make_first_contact(part) == xpcSuccess) {
440 xpc_channel_mgr(part);
441 }
442
443 xpc_part_deref(part);
444
445 xpc_teardown_infrastructure(part);
446}
447
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700448static int
449xpc_activating(void *__partid)
450{
Dean Nelson35190502008-04-22 14:48:55 -0500451 partid_t partid = (u64)__partid;
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700452 struct xpc_partition *part = &xpc_partitions[partid];
453 unsigned long irq_flags;
Dean Nelson35190502008-04-22 14:48:55 -0500454 struct sched_param param = {.sched_priority = MAX_RT_PRIO - 1 };
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700455 int ret;
456
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700457 DBUG_ON(partid <= 0 || partid >= XP_MAX_PARTITIONS);
458
459 spin_lock_irqsave(&part->act_lock, irq_flags);
460
461 if (part->act_state == XPC_P_DEACTIVATING) {
462 part->act_state = XPC_P_INACTIVE;
463 spin_unlock_irqrestore(&part->act_lock, irq_flags);
464 part->remote_rp_pa = 0;
465 return 0;
466 }
467
468 /* indicate the thread is activating */
469 DBUG_ON(part->act_state != XPC_P_ACTIVATION_REQ);
470 part->act_state = XPC_P_ACTIVATING;
471
472 XPC_SET_REASON(part, 0, 0);
473 spin_unlock_irqrestore(&part->act_lock, irq_flags);
474
475 dev_dbg(xpc_part, "bringing partition %d up\n", partid);
476
477 daemonize("xpc%02d", partid);
478
479 /*
480 * This thread needs to run at a realtime priority to prevent a
481 * significant performance degradation.
482 */
483 ret = sched_setscheduler(current, SCHED_FIFO, &param);
484 if (ret != 0) {
485 dev_warn(xpc_part, "unable to set pid %d to a realtime "
Dean Nelson35190502008-04-22 14:48:55 -0500486 "priority, ret=%d\n", current->pid, ret);
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700487 }
488
489 /* allow this thread and its children to run on any CPU */
490 set_cpus_allowed(current, CPU_MASK_ALL);
491
492 /*
493 * Register the remote partition's AMOs with SAL so it can handle
494 * and cleanup errors within that address range should the remote
495 * partition go down. We don't unregister this range because it is
496 * difficult to tell when outstanding writes to the remote partition
497 * are finished and thus when it is safe to unregister. This should
498 * not result in wasted space in the SAL xp_addr_region table because
499 * we should get the same page for remote_amos_page_pa after module
500 * reloads and system reboots.
501 */
502 if (sn_register_xp_addr_region(part->remote_amos_page_pa,
Dean Nelson35190502008-04-22 14:48:55 -0500503 PAGE_SIZE, 1) < 0) {
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700504 dev_warn(xpc_part, "xpc_partition_up(%d) failed to register "
Dean Nelson35190502008-04-22 14:48:55 -0500505 "xp_addr region\n", partid);
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700506
507 spin_lock_irqsave(&part->act_lock, irq_flags);
508 part->act_state = XPC_P_INACTIVE;
509 XPC_SET_REASON(part, xpcPhysAddrRegFailed, __LINE__);
510 spin_unlock_irqrestore(&part->act_lock, irq_flags);
511 part->remote_rp_pa = 0;
512 return 0;
513 }
514
Dean Nelsona607c382005-09-01 14:01:37 -0500515 xpc_allow_hb(partid, xpc_vars);
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700516 xpc_IPI_send_activated(part);
517
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700518 /*
519 * xpc_partition_up() holds this thread and marks this partition as
520 * XPC_P_ACTIVE by calling xpc_hb_mark_active().
521 */
Dean Nelson35190502008-04-22 14:48:55 -0500522 (void)xpc_partition_up(part);
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700523
Dean Nelsona607c382005-09-01 14:01:37 -0500524 xpc_disallow_hb(partid, xpc_vars);
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700525 xpc_mark_partition_inactive(part);
526
527 if (part->reason == xpcReactivating) {
528 /* interrupting ourselves results in activating partition */
529 xpc_IPI_send_reactivate(part);
530 }
531
532 return 0;
533}
534
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700535void
536xpc_activate_partition(struct xpc_partition *part)
537{
538 partid_t partid = XPC_PARTID(part);
539 unsigned long irq_flags;
540 pid_t pid;
541
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700542 spin_lock_irqsave(&part->act_lock, irq_flags);
543
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700544 DBUG_ON(part->act_state != XPC_P_INACTIVE);
545
Robin Holt7c6c6632006-02-02 12:30:21 -0600546 part->act_state = XPC_P_ACTIVATION_REQ;
547 XPC_SET_REASON(part, xpcCloneKThread, __LINE__);
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700548
549 spin_unlock_irqrestore(&part->act_lock, irq_flags);
Robin Holt7c6c6632006-02-02 12:30:21 -0600550
Dean Nelson35190502008-04-22 14:48:55 -0500551 pid = kernel_thread(xpc_activating, (void *)((u64)partid), 0);
Robin Holt7c6c6632006-02-02 12:30:21 -0600552
553 if (unlikely(pid <= 0)) {
554 spin_lock_irqsave(&part->act_lock, irq_flags);
555 part->act_state = XPC_P_INACTIVE;
556 XPC_SET_REASON(part, xpcCloneKThreadFailed, __LINE__);
557 spin_unlock_irqrestore(&part->act_lock, irq_flags);
558 }
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700559}
560
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700561/*
562 * Handle the receipt of a SGI_XPC_NOTIFY IRQ by seeing whether the specified
563 * partition actually sent it. Since SGI_XPC_NOTIFY IRQs may be shared by more
564 * than one partition, we use an AMO_t structure per partition to indicate
565 * whether a partition has sent an IPI or not. >>> If it has, then wake up the
566 * associated kthread to handle it.
567 *
568 * All SGI_XPC_NOTIFY IRQs received by XPC are the result of IPIs sent by XPC
569 * running on other partitions.
570 *
571 * Noteworthy Arguments:
572 *
573 * irq - Interrupt ReQuest number. NOT USED.
574 *
575 * dev_id - partid of IPI's potential sender.
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700576 */
577irqreturn_t
Al Viro5dcded12006-10-08 14:59:19 +0100578xpc_notify_IRQ_handler(int irq, void *dev_id)
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700579{
Dean Nelson35190502008-04-22 14:48:55 -0500580 partid_t partid = (partid_t) (u64)dev_id;
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700581 struct xpc_partition *part = &xpc_partitions[partid];
582
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700583 DBUG_ON(partid <= 0 || partid >= XP_MAX_PARTITIONS);
584
585 if (xpc_part_ref(part)) {
586 xpc_check_for_channel_activity(part);
587
588 xpc_part_deref(part);
589 }
590 return IRQ_HANDLED;
591}
592
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700593/*
594 * Check to see if xpc_notify_IRQ_handler() dropped any IPIs on the floor
595 * because the write to their associated IPI amo completed after the IRQ/IPI
596 * was received.
597 */
598void
599xpc_dropped_IPI_check(struct xpc_partition *part)
600{
601 if (xpc_part_ref(part)) {
602 xpc_check_for_channel_activity(part);
603
604 part->dropped_IPI_timer.expires = jiffies +
Dean Nelson35190502008-04-22 14:48:55 -0500605 XPC_P_DROPPED_IPI_WAIT;
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700606 add_timer(&part->dropped_IPI_timer);
607 xpc_part_deref(part);
608 }
609}
610
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700611void
612xpc_activate_kthreads(struct xpc_channel *ch, int needed)
613{
614 int idle = atomic_read(&ch->kthreads_idle);
615 int assigned = atomic_read(&ch->kthreads_assigned);
616 int wakeup;
617
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700618 DBUG_ON(needed <= 0);
619
620 if (idle > 0) {
621 wakeup = (needed > idle) ? idle : needed;
622 needed -= wakeup;
623
624 dev_dbg(xpc_chan, "wakeup %d idle kthreads, partid=%d, "
625 "channel=%d\n", wakeup, ch->partid, ch->number);
626
627 /* only wakeup the requested number of kthreads */
628 wake_up_nr(&ch->idle_wq, wakeup);
629 }
630
631 if (needed <= 0) {
632 return;
633 }
634
635 if (needed + assigned > ch->kthreads_assigned_limit) {
636 needed = ch->kthreads_assigned_limit - assigned;
637 // >>>should never be less than 0
638 if (needed <= 0) {
639 return;
640 }
641 }
642
643 dev_dbg(xpc_chan, "create %d new kthreads, partid=%d, channel=%d\n",
644 needed, ch->partid, ch->number);
645
Dean Nelsona460ef82006-11-22 08:25:00 -0600646 xpc_create_kthreads(ch, needed, 0);
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700647}
648
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700649/*
650 * This function is where XPC's kthreads wait for messages to deliver.
651 */
652static void
653xpc_kthread_waitmsgs(struct xpc_partition *part, struct xpc_channel *ch)
654{
655 do {
656 /* deliver messages to their intended recipients */
657
Dean Nelson35190502008-04-22 14:48:55 -0500658 while ((volatile s64)ch->w_local_GP.get <
659 (volatile s64)ch->w_remote_GP.put &&
660 !((volatile u32)ch->flags & XPC_C_DISCONNECTING)) {
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700661 xpc_deliver_msg(ch);
662 }
663
664 if (atomic_inc_return(&ch->kthreads_idle) >
Dean Nelson35190502008-04-22 14:48:55 -0500665 ch->kthreads_idle_limit) {
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700666 /* too many idle kthreads on this channel */
667 atomic_dec(&ch->kthreads_idle);
668 break;
669 }
670
671 dev_dbg(xpc_chan, "idle kthread calling "
672 "wait_event_interruptible_exclusive()\n");
673
Dean Nelson35190502008-04-22 14:48:55 -0500674 (void)wait_event_interruptible_exclusive(ch->idle_wq,
675 ((volatile s64)ch->
676 w_local_GP.get <
677 (volatile s64)ch->
678 w_remote_GP.put ||
679 ((volatile u32)ch->
680 flags &
681 XPC_C_DISCONNECTING)));
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700682
683 atomic_dec(&ch->kthreads_idle);
684
Dean Nelson35190502008-04-22 14:48:55 -0500685 } while (!((volatile u32)ch->flags & XPC_C_DISCONNECTING));
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700686}
687
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700688static int
689xpc_daemonize_kthread(void *args)
690{
691 partid_t partid = XPC_UNPACK_ARG1(args);
692 u16 ch_number = XPC_UNPACK_ARG2(args);
693 struct xpc_partition *part = &xpc_partitions[partid];
694 struct xpc_channel *ch;
695 int n_needed;
Dean Nelsone54af722005-10-25 14:07:43 -0500696 unsigned long irq_flags;
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700697
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700698 daemonize("xpc%02dc%d", partid, ch_number);
699
700 dev_dbg(xpc_chan, "kthread starting, partid=%d, channel=%d\n",
701 partid, ch_number);
702
703 ch = &part->channels[ch_number];
704
705 if (!(ch->flags & XPC_C_DISCONNECTING)) {
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700706
707 /* let registerer know that connection has been established */
708
Dean Nelsone54af722005-10-25 14:07:43 -0500709 spin_lock_irqsave(&ch->lock, irq_flags);
Dean Nelson4c2cd962006-02-15 08:02:21 -0600710 if (!(ch->flags & XPC_C_CONNECTEDCALLOUT)) {
711 ch->flags |= XPC_C_CONNECTEDCALLOUT;
Dean Nelsone54af722005-10-25 14:07:43 -0500712 spin_unlock_irqrestore(&ch->lock, irq_flags);
713
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700714 xpc_connected_callout(ch);
715
Dean Nelson4c2cd962006-02-15 08:02:21 -0600716 spin_lock_irqsave(&ch->lock, irq_flags);
717 ch->flags |= XPC_C_CONNECTEDCALLOUT_MADE;
718 spin_unlock_irqrestore(&ch->lock, irq_flags);
719
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700720 /*
721 * It is possible that while the callout was being
722 * made that the remote partition sent some messages.
723 * If that is the case, we may need to activate
724 * additional kthreads to help deliver them. We only
725 * need one less than total #of messages to deliver.
726 */
727 n_needed = ch->w_remote_GP.put - ch->w_local_GP.get - 1;
Dean Nelson35190502008-04-22 14:48:55 -0500728 if (n_needed > 0 && !(ch->flags & XPC_C_DISCONNECTING)) {
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700729 xpc_activate_kthreads(ch, n_needed);
730 }
Dean Nelsone54af722005-10-25 14:07:43 -0500731 } else {
732 spin_unlock_irqrestore(&ch->lock, irq_flags);
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700733 }
734
735 xpc_kthread_waitmsgs(part, ch);
736 }
737
Dean Nelsona460ef82006-11-22 08:25:00 -0600738 /* let registerer know that connection is disconnecting */
Dean Nelsone54af722005-10-25 14:07:43 -0500739
Dean Nelsona460ef82006-11-22 08:25:00 -0600740 spin_lock_irqsave(&ch->lock, irq_flags);
741 if ((ch->flags & XPC_C_CONNECTEDCALLOUT_MADE) &&
Dean Nelson35190502008-04-22 14:48:55 -0500742 !(ch->flags & XPC_C_DISCONNECTINGCALLOUT)) {
Dean Nelsona460ef82006-11-22 08:25:00 -0600743 ch->flags |= XPC_C_DISCONNECTINGCALLOUT;
Dean Nelson4c2cd962006-02-15 08:02:21 -0600744 spin_unlock_irqrestore(&ch->lock, irq_flags);
Dean Nelsona460ef82006-11-22 08:25:00 -0600745
746 xpc_disconnect_callout(ch, xpcDisconnecting);
747
748 spin_lock_irqsave(&ch->lock, irq_flags);
749 ch->flags |= XPC_C_DISCONNECTINGCALLOUT_MADE;
750 }
751 spin_unlock_irqrestore(&ch->lock, irq_flags);
752
753 if (atomic_dec_return(&ch->kthreads_assigned) == 0) {
Dean Nelsona607c382005-09-01 14:01:37 -0500754 if (atomic_dec_return(&part->nchannels_engaged) == 0) {
755 xpc_mark_partition_disengaged(part);
756 xpc_IPI_send_disengage(part);
757 }
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700758 }
759
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700760 xpc_msgqueue_deref(ch);
761
762 dev_dbg(xpc_chan, "kthread exiting, partid=%d, channel=%d\n",
763 partid, ch_number);
764
765 xpc_part_deref(part);
766 return 0;
767}
768
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700769/*
770 * For each partition that XPC has established communications with, there is
771 * a minimum of one kernel thread assigned to perform any operation that
772 * may potentially sleep or block (basically the callouts to the asynchronous
773 * functions registered via xpc_connect()).
774 *
775 * Additional kthreads are created and destroyed by XPC as the workload
776 * demands.
777 *
778 * A kthread is assigned to one of the active channels that exists for a given
779 * partition.
780 */
781void
Dean Nelsona460ef82006-11-22 08:25:00 -0600782xpc_create_kthreads(struct xpc_channel *ch, int needed,
Dean Nelson35190502008-04-22 14:48:55 -0500783 int ignore_disconnecting)
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700784{
785 unsigned long irq_flags;
786 pid_t pid;
787 u64 args = XPC_PACK_ARGS(ch->partid, ch->number);
Dean Nelsona607c382005-09-01 14:01:37 -0500788 struct xpc_partition *part = &xpc_partitions[ch->partid];
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700789
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700790 while (needed-- > 0) {
Dean Nelsone54af722005-10-25 14:07:43 -0500791
792 /*
793 * The following is done on behalf of the newly created
794 * kthread. That kthread is responsible for doing the
795 * counterpart to the following before it exits.
796 */
Dean Nelsona460ef82006-11-22 08:25:00 -0600797 if (ignore_disconnecting) {
798 if (!atomic_inc_not_zero(&ch->kthreads_assigned)) {
799 /* kthreads assigned had gone to zero */
800 BUG_ON(!(ch->flags &
Dean Nelson35190502008-04-22 14:48:55 -0500801 XPC_C_DISCONNECTINGCALLOUT_MADE));
Dean Nelsona460ef82006-11-22 08:25:00 -0600802 break;
803 }
804
805 } else if (ch->flags & XPC_C_DISCONNECTING) {
806 break;
807
808 } else if (atomic_inc_return(&ch->kthreads_assigned) == 1) {
809 if (atomic_inc_return(&part->nchannels_engaged) == 1)
810 xpc_mark_partition_engaged(part);
811 }
Dean Nelson35190502008-04-22 14:48:55 -0500812 (void)xpc_part_ref(part);
Dean Nelsone54af722005-10-25 14:07:43 -0500813 xpc_msgqueue_ref(ch);
Dean Nelsone54af722005-10-25 14:07:43 -0500814
Dean Nelson35190502008-04-22 14:48:55 -0500815 pid = kernel_thread(xpc_daemonize_kthread, (void *)args, 0);
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700816 if (pid < 0) {
817 /* the fork failed */
Dean Nelsona460ef82006-11-22 08:25:00 -0600818
819 /*
820 * NOTE: if (ignore_disconnecting &&
821 * !(ch->flags & XPC_C_DISCONNECTINGCALLOUT)) is true,
822 * then we'll deadlock if all other kthreads assigned
823 * to this channel are blocked in the channel's
824 * registerer, because the only thing that will unblock
825 * them is the xpcDisconnecting callout that this
826 * failed kernel_thread would have made.
827 */
828
Dean Nelsone54af722005-10-25 14:07:43 -0500829 if (atomic_dec_return(&ch->kthreads_assigned) == 0 &&
830 atomic_dec_return(&part->nchannels_engaged) == 0) {
831 xpc_mark_partition_disengaged(part);
832 xpc_IPI_send_disengage(part);
833 }
834 xpc_msgqueue_deref(ch);
835 xpc_part_deref(part);
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700836
837 if (atomic_read(&ch->kthreads_assigned) <
Dean Nelson35190502008-04-22 14:48:55 -0500838 ch->kthreads_idle_limit) {
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700839 /*
840 * Flag this as an error only if we have an
841 * insufficient #of kthreads for the channel
842 * to function.
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700843 */
844 spin_lock_irqsave(&ch->lock, irq_flags);
845 XPC_DISCONNECT_CHANNEL(ch, xpcLackOfResources,
Dean Nelson35190502008-04-22 14:48:55 -0500846 &irq_flags);
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700847 spin_unlock_irqrestore(&ch->lock, irq_flags);
848 }
849 break;
850 }
851
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700852 ch->kthreads_created++; // >>> temporary debug only!!!
853 }
854}
855
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700856void
857xpc_disconnect_wait(int ch_number)
858{
Dean Nelsona607c382005-09-01 14:01:37 -0500859 unsigned long irq_flags;
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700860 partid_t partid;
861 struct xpc_partition *part;
862 struct xpc_channel *ch;
Dean Nelsone54af722005-10-25 14:07:43 -0500863 int wakeup_channel_mgr;
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700864
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700865 /* now wait for all callouts to the caller's function to cease */
866 for (partid = 1; partid < XP_MAX_PARTITIONS; partid++) {
867 part = &xpc_partitions[partid];
868
Dean Nelsone54af722005-10-25 14:07:43 -0500869 if (!xpc_part_ref(part)) {
870 continue;
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700871 }
Dean Nelsone54af722005-10-25 14:07:43 -0500872
873 ch = &part->channels[ch_number];
874
875 if (!(ch->flags & XPC_C_WDISCONNECT)) {
876 xpc_part_deref(part);
877 continue;
878 }
879
Jes Sorensenf9e505a2006-01-17 12:52:21 -0500880 wait_for_completion(&ch->wdisconnect_wait);
Dean Nelsone54af722005-10-25 14:07:43 -0500881
882 spin_lock_irqsave(&ch->lock, irq_flags);
883 DBUG_ON(!(ch->flags & XPC_C_DISCONNECTED));
884 wakeup_channel_mgr = 0;
885
886 if (ch->delayed_IPI_flags) {
887 if (part->act_state != XPC_P_DEACTIVATING) {
888 spin_lock(&part->IPI_lock);
889 XPC_SET_IPI_FLAGS(part->local_IPI_amo,
Dean Nelson35190502008-04-22 14:48:55 -0500890 ch->number,
891 ch->delayed_IPI_flags);
Dean Nelsone54af722005-10-25 14:07:43 -0500892 spin_unlock(&part->IPI_lock);
893 wakeup_channel_mgr = 1;
894 }
895 ch->delayed_IPI_flags = 0;
896 }
897
898 ch->flags &= ~XPC_C_WDISCONNECT;
899 spin_unlock_irqrestore(&ch->lock, irq_flags);
900
901 if (wakeup_channel_mgr) {
902 xpc_wakeup_channel_mgr(part);
903 }
904
905 xpc_part_deref(part);
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700906 }
907}
908
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700909static void
Dean Nelsona607c382005-09-01 14:01:37 -0500910xpc_do_exit(enum xpc_retval reason)
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700911{
912 partid_t partid;
Dean Nelson1ecaded2006-01-06 09:48:21 -0600913 int active_part_count, printed_waiting_msg = 0;
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700914 struct xpc_partition *part;
Dean Nelson1ecaded2006-01-06 09:48:21 -0600915 unsigned long printmsg_time, disengage_request_timeout = 0;
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700916
Dean Nelsona607c382005-09-01 14:01:37 -0500917 /* a 'rmmod XPC' and a 'reboot' cannot both end up here together */
918 DBUG_ON(xpc_exiting == 1);
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700919
920 /*
Dean Nelsona607c382005-09-01 14:01:37 -0500921 * Let the heartbeat checker thread and the discovery thread
922 * (if one is running) know that they should exit. Also wake up
923 * the heartbeat checker thread in case it's sleeping.
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700924 */
925 xpc_exiting = 1;
926 wake_up_interruptible(&xpc_act_IRQ_wq);
927
Dean Nelsona607c382005-09-01 14:01:37 -0500928 /* ignore all incoming interrupts */
929 free_irq(SGI_XPC_ACTIVATE, NULL);
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700930
Dean Nelsone54af722005-10-25 14:07:43 -0500931 /* wait for the discovery thread to exit */
Jes Sorensenf9e505a2006-01-17 12:52:21 -0500932 wait_for_completion(&xpc_discovery_exited);
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700933
Dean Nelsone54af722005-10-25 14:07:43 -0500934 /* wait for the heartbeat checker thread to exit */
Jes Sorensenf9e505a2006-01-17 12:52:21 -0500935 wait_for_completion(&xpc_hb_checker_exited);
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700936
Dean Nelsona607c382005-09-01 14:01:37 -0500937 /* sleep for a 1/3 of a second or so */
Dean Nelson35190502008-04-22 14:48:55 -0500938 (void)msleep_interruptible(300);
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700939
940 /* wait for all partitions to become inactive */
941
Dean Nelson1ecaded2006-01-06 09:48:21 -0600942 printmsg_time = jiffies + (XPC_DISENGAGE_PRINTMSG_INTERVAL * HZ);
943 xpc_disengage_request_timedout = 0;
Dean Nelsona607c382005-09-01 14:01:37 -0500944
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700945 do {
946 active_part_count = 0;
947
948 for (partid = 1; partid < XP_MAX_PARTITIONS; partid++) {
949 part = &xpc_partitions[partid];
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700950
Dean Nelsona607c382005-09-01 14:01:37 -0500951 if (xpc_partition_disengaged(part) &&
Dean Nelson35190502008-04-22 14:48:55 -0500952 part->act_state == XPC_P_INACTIVE) {
Dean Nelsona607c382005-09-01 14:01:37 -0500953 continue;
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700954 }
Dean Nelsona607c382005-09-01 14:01:37 -0500955
956 active_part_count++;
957
958 XPC_DEACTIVATE_PARTITION(part, reason);
Dean Nelson1ecaded2006-01-06 09:48:21 -0600959
960 if (part->disengage_request_timeout >
Dean Nelson35190502008-04-22 14:48:55 -0500961 disengage_request_timeout) {
Dean Nelson1ecaded2006-01-06 09:48:21 -0600962 disengage_request_timeout =
Dean Nelson35190502008-04-22 14:48:55 -0500963 part->disengage_request_timeout;
Dean Nelson1ecaded2006-01-06 09:48:21 -0600964 }
Dean Nelson89eb8eb2005-03-23 19:50:00 -0700965 }
966
Dean Nelson1ecaded2006-01-06 09:48:21 -0600967 if (xpc_partition_engaged(-1UL)) {
968 if (time_after(jiffies, printmsg_time)) {
969 dev_info(xpc_part, "waiting for remote "
Dean Nelson35190502008-04-22 14:48:55 -0500970 "partitions to disengage, timeout in "
971 "%ld seconds\n",
972 (disengage_request_timeout - jiffies)
973 / HZ);
Dean Nelson1ecaded2006-01-06 09:48:21 -0600974 printmsg_time = jiffies +
Dean Nelson35190502008-04-22 14:48:55 -0500975 (XPC_DISENGAGE_PRINTMSG_INTERVAL * HZ);
Dean Nelson1ecaded2006-01-06 09:48:21 -0600976 printed_waiting_msg = 1;
977 }
978
979 } else if (active_part_count > 0) {
980 if (printed_waiting_msg) {
981 dev_info(xpc_part, "waiting for local partition"
Dean Nelson35190502008-04-22 14:48:55 -0500982 " to disengage\n");
Dean Nelson1ecaded2006-01-06 09:48:21 -0600983 printed_waiting_msg = 0;
984 }
985
986 } else {
987 if (!xpc_disengage_request_timedout) {
988 dev_info(xpc_part, "all partitions have "
Dean Nelson35190502008-04-22 14:48:55 -0500989 "disengaged\n");
Dean Nelson1ecaded2006-01-06 09:48:21 -0600990 }
991 break;
Dean Nelsona607c382005-09-01 14:01:37 -0500992 }
993
994 /* sleep for a 1/3 of a second or so */
Dean Nelson35190502008-04-22 14:48:55 -0500995 (void)msleep_interruptible(300);
Dean Nelsona607c382005-09-01 14:01:37 -0500996
997 } while (1);
998
999 DBUG_ON(xpc_partition_engaged(-1UL));
1000
Dean Nelsona607c382005-09-01 14:01:37 -05001001 /* indicate to others that our reserved page is uninitialized */
1002 xpc_rsvd_page->vars_pa = 0;
1003
1004 /* now it's time to eliminate our heartbeat */
1005 del_timer_sync(&xpc_hb_timer);
Dean Nelsone54af722005-10-25 14:07:43 -05001006 DBUG_ON(xpc_vars->heartbeating_to_mask != 0);
Dean Nelsona607c382005-09-01 14:01:37 -05001007
Dean Nelson0752c672006-01-10 11:07:19 -06001008 if (reason == xpcUnloading) {
1009 /* take ourselves off of the reboot_notifier_list */
Dean Nelson35190502008-04-22 14:48:55 -05001010 (void)unregister_reboot_notifier(&xpc_reboot_notifier);
Dean Nelson89eb8eb2005-03-23 19:50:00 -07001011
Dean Nelson0752c672006-01-10 11:07:19 -06001012 /* take ourselves off of the die_notifier list */
Dean Nelson35190502008-04-22 14:48:55 -05001013 (void)unregister_die_notifier(&xpc_die_notifier);
Dean Nelson0752c672006-01-10 11:07:19 -06001014 }
Dean Nelson780d09e2005-11-09 14:41:57 -06001015
Dean Nelson89eb8eb2005-03-23 19:50:00 -07001016 /* close down protections for IPI operations */
1017 xpc_restrict_IPI_ops();
1018
Dean Nelson89eb8eb2005-03-23 19:50:00 -07001019 /* clear the interface to XPC's functions */
1020 xpc_clear_interface();
1021
1022 if (xpc_sysctl) {
1023 unregister_sysctl_table(xpc_sysctl);
1024 }
Dean Nelson7682a4c2006-08-08 15:03:29 -05001025
1026 kfree(xpc_remote_copy_buffer_base);
Dean Nelson89eb8eb2005-03-23 19:50:00 -07001027}
1028
Dean Nelsona607c382005-09-01 14:01:37 -05001029/*
Dean Nelsond6ad0332006-01-10 11:08:55 -06001030 * This function is called when the system is being rebooted.
1031 */
1032static int
1033xpc_system_reboot(struct notifier_block *nb, unsigned long event, void *unused)
1034{
1035 enum xpc_retval reason;
1036
Dean Nelsond6ad0332006-01-10 11:08:55 -06001037 switch (event) {
1038 case SYS_RESTART:
1039 reason = xpcSystemReboot;
1040 break;
1041 case SYS_HALT:
1042 reason = xpcSystemHalt;
1043 break;
1044 case SYS_POWER_OFF:
1045 reason = xpcSystemPoweroff;
1046 break;
1047 default:
1048 reason = xpcSystemGoingDown;
1049 }
1050
1051 xpc_do_exit(reason);
1052 return NOTIFY_DONE;
1053}
1054
Dean Nelsond6ad0332006-01-10 11:08:55 -06001055/*
1056 * Notify other partitions to disengage from all references to our memory.
Dean Nelson780d09e2005-11-09 14:41:57 -06001057 */
1058static void
1059xpc_die_disengage(void)
1060{
1061 struct xpc_partition *part;
1062 partid_t partid;
1063 unsigned long engaged;
Dean Nelson1ecaded2006-01-06 09:48:21 -06001064 long time, printmsg_time, disengage_request_timeout;
Dean Nelson780d09e2005-11-09 14:41:57 -06001065
Dean Nelson780d09e2005-11-09 14:41:57 -06001066 /* keep xpc_hb_checker thread from doing anything (just in case) */
1067 xpc_exiting = 1;
1068
Dean Nelson35190502008-04-22 14:48:55 -05001069 xpc_vars->heartbeating_to_mask = 0; /* indicate we're deactivated */
Dean Nelson780d09e2005-11-09 14:41:57 -06001070
1071 for (partid = 1; partid < XP_MAX_PARTITIONS; partid++) {
1072 part = &xpc_partitions[partid];
1073
Dean Nelson35190502008-04-22 14:48:55 -05001074 if (!XPC_SUPPORTS_DISENGAGE_REQUEST(part->remote_vars_version)) {
Dean Nelson780d09e2005-11-09 14:41:57 -06001075
1076 /* just in case it was left set by an earlier XPC */
1077 xpc_clear_partition_engaged(1UL << partid);
1078 continue;
1079 }
1080
1081 if (xpc_partition_engaged(1UL << partid) ||
Dean Nelson35190502008-04-22 14:48:55 -05001082 part->act_state != XPC_P_INACTIVE) {
Dean Nelson780d09e2005-11-09 14:41:57 -06001083 xpc_request_partition_disengage(part);
1084 xpc_mark_partition_disengaged(part);
1085 xpc_IPI_send_disengage(part);
1086 }
1087 }
1088
Dean Nelson1ecaded2006-01-06 09:48:21 -06001089 time = rtc_time();
1090 printmsg_time = time +
Dean Nelson35190502008-04-22 14:48:55 -05001091 (XPC_DISENGAGE_PRINTMSG_INTERVAL * sn_rtc_cycles_per_second);
Dean Nelson1ecaded2006-01-06 09:48:21 -06001092 disengage_request_timeout = time +
Dean Nelson35190502008-04-22 14:48:55 -05001093 (xpc_disengage_request_timelimit * sn_rtc_cycles_per_second);
Dean Nelson780d09e2005-11-09 14:41:57 -06001094
1095 /* wait for all other partitions to disengage from us */
1096
Dean Nelson1ecaded2006-01-06 09:48:21 -06001097 while (1) {
1098 engaged = xpc_partition_engaged(-1UL);
1099 if (!engaged) {
1100 dev_info(xpc_part, "all partitions have disengaged\n");
1101 break;
1102 }
Dean Nelson780d09e2005-11-09 14:41:57 -06001103
Dean Nelson1ecaded2006-01-06 09:48:21 -06001104 time = rtc_time();
1105 if (time >= disengage_request_timeout) {
1106 for (partid = 1; partid < XP_MAX_PARTITIONS; partid++) {
1107 if (engaged & (1UL << partid)) {
1108 dev_info(xpc_part, "disengage from "
Dean Nelson35190502008-04-22 14:48:55 -05001109 "remote partition %d timed "
1110 "out\n", partid);
Dean Nelson1ecaded2006-01-06 09:48:21 -06001111 }
1112 }
1113 break;
1114 }
1115
1116 if (time >= printmsg_time) {
Dean Nelson780d09e2005-11-09 14:41:57 -06001117 dev_info(xpc_part, "waiting for remote partitions to "
Dean Nelson35190502008-04-22 14:48:55 -05001118 "disengage, timeout in %ld seconds\n",
1119 (disengage_request_timeout - time) /
1120 sn_rtc_cycles_per_second);
Dean Nelson1ecaded2006-01-06 09:48:21 -06001121 printmsg_time = time +
Dean Nelson35190502008-04-22 14:48:55 -05001122 (XPC_DISENGAGE_PRINTMSG_INTERVAL *
1123 sn_rtc_cycles_per_second);
Dean Nelson780d09e2005-11-09 14:41:57 -06001124 }
1125 }
Dean Nelson780d09e2005-11-09 14:41:57 -06001126}
1127
Dean Nelson780d09e2005-11-09 14:41:57 -06001128/*
Dean Nelson1f4674b2006-01-10 11:08:00 -06001129 * This function is called when the system is being restarted or halted due
1130 * to some sort of system failure. If this is the case we need to notify the
1131 * other partitions to disengage from all references to our memory.
1132 * This function can also be called when our heartbeater could be offlined
1133 * for a time. In this case we need to notify other partitions to not worry
1134 * about the lack of a heartbeat.
Dean Nelson780d09e2005-11-09 14:41:57 -06001135 */
1136static int
1137xpc_system_die(struct notifier_block *nb, unsigned long event, void *unused)
1138{
1139 switch (event) {
1140 case DIE_MACHINE_RESTART:
1141 case DIE_MACHINE_HALT:
1142 xpc_die_disengage();
1143 break;
Dean Nelson1f4674b2006-01-10 11:08:00 -06001144
1145 case DIE_KDEBUG_ENTER:
1146 /* Should lack of heartbeat be ignored by other partitions? */
1147 if (!xpc_kdebug_ignore) {
1148 break;
1149 }
1150 /* fall through */
Dean Nelson780d09e2005-11-09 14:41:57 -06001151 case DIE_MCA_MONARCH_ENTER:
1152 case DIE_INIT_MONARCH_ENTER:
1153 xpc_vars->heartbeat++;
1154 xpc_vars->heartbeat_offline = 1;
1155 break;
Dean Nelson1f4674b2006-01-10 11:08:00 -06001156
1157 case DIE_KDEBUG_LEAVE:
1158 /* Is lack of heartbeat being ignored by other partitions? */
1159 if (!xpc_kdebug_ignore) {
1160 break;
1161 }
1162 /* fall through */
Dean Nelson780d09e2005-11-09 14:41:57 -06001163 case DIE_MCA_MONARCH_LEAVE:
1164 case DIE_INIT_MONARCH_LEAVE:
1165 xpc_vars->heartbeat++;
1166 xpc_vars->heartbeat_offline = 0;
1167 break;
1168 }
1169
1170 return NOTIFY_DONE;
1171}
1172
Dean Nelson89eb8eb2005-03-23 19:50:00 -07001173int __init
1174xpc_init(void)
1175{
1176 int ret;
1177 partid_t partid;
1178 struct xpc_partition *part;
1179 pid_t pid;
Dean Nelson7682a4c2006-08-08 15:03:29 -05001180 size_t buf_size;
Dean Nelson89eb8eb2005-03-23 19:50:00 -07001181
Dean Nelson408865c2005-09-08 10:46:58 -05001182 if (!ia64_platform_is("sn2")) {
1183 return -ENODEV;
1184 }
1185
Dean Nelson7682a4c2006-08-08 15:03:29 -05001186 buf_size = max(XPC_RP_VARS_SIZE,
Dean Nelson35190502008-04-22 14:48:55 -05001187 XPC_RP_HEADER_SIZE + XP_NASID_MASK_BYTES);
Dean Nelson7682a4c2006-08-08 15:03:29 -05001188 xpc_remote_copy_buffer = xpc_kmalloc_cacheline_aligned(buf_size,
Dean Nelson35190502008-04-22 14:48:55 -05001189 GFP_KERNEL,
1190 &xpc_remote_copy_buffer_base);
Dean Nelson7682a4c2006-08-08 15:03:29 -05001191 if (xpc_remote_copy_buffer == NULL)
1192 return -ENOMEM;
Dean Nelson89eb8eb2005-03-23 19:50:00 -07001193
1194 snprintf(xpc_part->bus_id, BUS_ID_SIZE, "part");
1195 snprintf(xpc_chan->bus_id, BUS_ID_SIZE, "chan");
1196
Eric W. Biederman0b4d4142007-02-14 00:34:09 -08001197 xpc_sysctl = register_sysctl_table(xpc_sys_dir);
Dean Nelson89eb8eb2005-03-23 19:50:00 -07001198
1199 /*
1200 * The first few fields of each entry of xpc_partitions[] need to
1201 * be initialized now so that calls to xpc_connect() and
1202 * xpc_disconnect() can be made prior to the activation of any remote
1203 * partition. NOTE THAT NONE OF THE OTHER FIELDS BELONGING TO THESE
1204 * ENTRIES ARE MEANINGFUL UNTIL AFTER AN ENTRY'S CORRESPONDING
1205 * PARTITION HAS BEEN ACTIVATED.
1206 */
1207 for (partid = 1; partid < XP_MAX_PARTITIONS; partid++) {
1208 part = &xpc_partitions[partid];
1209
Dean Nelson35190502008-04-22 14:48:55 -05001210 DBUG_ON((u64)part != L1_CACHE_ALIGN((u64)part));
Dean Nelson89eb8eb2005-03-23 19:50:00 -07001211
1212 part->act_IRQ_rcvd = 0;
1213 spin_lock_init(&part->act_lock);
1214 part->act_state = XPC_P_INACTIVE;
1215 XPC_SET_REASON(part, 0, 0);
Dean Nelsona607c382005-09-01 14:01:37 -05001216
1217 init_timer(&part->disengage_request_timer);
1218 part->disengage_request_timer.function =
Dean Nelson35190502008-04-22 14:48:55 -05001219 xpc_timeout_partition_disengage_request;
1220 part->disengage_request_timer.data = (unsigned long)part;
Dean Nelsona607c382005-09-01 14:01:37 -05001221
Dean Nelson89eb8eb2005-03-23 19:50:00 -07001222 part->setup_state = XPC_P_UNSET;
1223 init_waitqueue_head(&part->teardown_wq);
1224 atomic_set(&part->references, 0);
1225 }
1226
1227 /*
1228 * Open up protections for IPI operations (and AMO operations on
1229 * Shub 1.1 systems).
1230 */
1231 xpc_allow_IPI_ops();
1232
1233 /*
1234 * Interrupts being processed will increment this atomic variable and
1235 * awaken the heartbeat thread which will process the interrupts.
1236 */
1237 atomic_set(&xpc_act_IRQ_rcvd, 0);
1238
1239 /*
1240 * This is safe to do before the xpc_hb_checker thread has started
1241 * because the handler releases a wait queue. If an interrupt is
1242 * received before the thread is waiting, it will not go to sleep,
1243 * but rather immediately process the interrupt.
1244 */
1245 ret = request_irq(SGI_XPC_ACTIVATE, xpc_act_IRQ_handler, 0,
Dean Nelson35190502008-04-22 14:48:55 -05001246 "xpc hb", NULL);
Dean Nelson89eb8eb2005-03-23 19:50:00 -07001247 if (ret != 0) {
1248 dev_err(xpc_part, "can't register ACTIVATE IRQ handler, "
1249 "errno=%d\n", -ret);
1250
1251 xpc_restrict_IPI_ops();
1252
1253 if (xpc_sysctl) {
1254 unregister_sysctl_table(xpc_sysctl);
1255 }
Dean Nelson7682a4c2006-08-08 15:03:29 -05001256
1257 kfree(xpc_remote_copy_buffer_base);
Dean Nelson89eb8eb2005-03-23 19:50:00 -07001258 return -EBUSY;
1259 }
1260
1261 /*
1262 * Fill the partition reserved page with the information needed by
1263 * other partitions to discover we are alive and establish initial
1264 * communications.
1265 */
1266 xpc_rsvd_page = xpc_rsvd_page_init();
1267 if (xpc_rsvd_page == NULL) {
1268 dev_err(xpc_part, "could not setup our reserved page\n");
1269
1270 free_irq(SGI_XPC_ACTIVATE, NULL);
1271 xpc_restrict_IPI_ops();
1272
1273 if (xpc_sysctl) {
1274 unregister_sysctl_table(xpc_sysctl);
1275 }
Dean Nelson7682a4c2006-08-08 15:03:29 -05001276
1277 kfree(xpc_remote_copy_buffer_base);
Dean Nelson89eb8eb2005-03-23 19:50:00 -07001278 return -EBUSY;
1279 }
1280
Dean Nelsona607c382005-09-01 14:01:37 -05001281 /* add ourselves to the reboot_notifier_list */
1282 ret = register_reboot_notifier(&xpc_reboot_notifier);
1283 if (ret != 0) {
1284 dev_warn(xpc_part, "can't register reboot notifier\n");
1285 }
1286
Christoph Hellwig1eeb66a2007-05-08 00:27:03 -07001287 /* add ourselves to the die_notifier list */
Dean Nelson780d09e2005-11-09 14:41:57 -06001288 ret = register_die_notifier(&xpc_die_notifier);
1289 if (ret != 0) {
1290 dev_warn(xpc_part, "can't register die notifier\n");
1291 }
1292
Dean Nelson89eb8eb2005-03-23 19:50:00 -07001293 init_timer(&xpc_hb_timer);
1294 xpc_hb_timer.function = xpc_hb_beater;
Dean Nelson89eb8eb2005-03-23 19:50:00 -07001295
1296 /*
1297 * The real work-horse behind xpc. This processes incoming
1298 * interrupts and monitors remote heartbeats.
1299 */
1300 pid = kernel_thread(xpc_hb_checker, NULL, 0);
1301 if (pid < 0) {
1302 dev_err(xpc_part, "failed while forking hb check thread\n");
1303
1304 /* indicate to others that our reserved page is uninitialized */
1305 xpc_rsvd_page->vars_pa = 0;
1306
Dean Nelsona607c382005-09-01 14:01:37 -05001307 /* take ourselves off of the reboot_notifier_list */
Dean Nelson35190502008-04-22 14:48:55 -05001308 (void)unregister_reboot_notifier(&xpc_reboot_notifier);
Dean Nelsona607c382005-09-01 14:01:37 -05001309
Dean Nelson780d09e2005-11-09 14:41:57 -06001310 /* take ourselves off of the die_notifier list */
Dean Nelson35190502008-04-22 14:48:55 -05001311 (void)unregister_die_notifier(&xpc_die_notifier);
Dean Nelson780d09e2005-11-09 14:41:57 -06001312
Dean Nelson89eb8eb2005-03-23 19:50:00 -07001313 del_timer_sync(&xpc_hb_timer);
1314 free_irq(SGI_XPC_ACTIVATE, NULL);
1315 xpc_restrict_IPI_ops();
1316
1317 if (xpc_sysctl) {
1318 unregister_sysctl_table(xpc_sysctl);
1319 }
Dean Nelson7682a4c2006-08-08 15:03:29 -05001320
1321 kfree(xpc_remote_copy_buffer_base);
Dean Nelson89eb8eb2005-03-23 19:50:00 -07001322 return -EBUSY;
1323 }
1324
Dean Nelson89eb8eb2005-03-23 19:50:00 -07001325 /*
1326 * Startup a thread that will attempt to discover other partitions to
1327 * activate based on info provided by SAL. This new thread is short
1328 * lived and will exit once discovery is complete.
1329 */
1330 pid = kernel_thread(xpc_initiate_discovery, NULL, 0);
1331 if (pid < 0) {
1332 dev_err(xpc_part, "failed while forking discovery thread\n");
1333
1334 /* mark this new thread as a non-starter */
Jes Sorensenf9e505a2006-01-17 12:52:21 -05001335 complete(&xpc_discovery_exited);
Dean Nelson89eb8eb2005-03-23 19:50:00 -07001336
Dean Nelsona607c382005-09-01 14:01:37 -05001337 xpc_do_exit(xpcUnloading);
Dean Nelson89eb8eb2005-03-23 19:50:00 -07001338 return -EBUSY;
1339 }
1340
Dean Nelson89eb8eb2005-03-23 19:50:00 -07001341 /* set the interface to point at XPC's functions */
1342 xpc_set_interface(xpc_initiate_connect, xpc_initiate_disconnect,
1343 xpc_initiate_allocate, xpc_initiate_send,
1344 xpc_initiate_send_notify, xpc_initiate_received,
1345 xpc_initiate_partid_to_nasids);
1346
1347 return 0;
1348}
Dean Nelson89eb8eb2005-03-23 19:50:00 -07001349
Dean Nelson35190502008-04-22 14:48:55 -05001350module_init(xpc_init);
Dean Nelson89eb8eb2005-03-23 19:50:00 -07001351
1352void __exit
1353xpc_exit(void)
1354{
Dean Nelsona607c382005-09-01 14:01:37 -05001355 xpc_do_exit(xpcUnloading);
Dean Nelson89eb8eb2005-03-23 19:50:00 -07001356}
Dean Nelson89eb8eb2005-03-23 19:50:00 -07001357
Dean Nelson35190502008-04-22 14:48:55 -05001358module_exit(xpc_exit);
Dean Nelson89eb8eb2005-03-23 19:50:00 -07001359
1360MODULE_AUTHOR("Silicon Graphics, Inc.");
1361MODULE_DESCRIPTION("Cross Partition Communication (XPC) support");
1362MODULE_LICENSE("GPL");
1363
1364module_param(xpc_hb_interval, int, 0);
1365MODULE_PARM_DESC(xpc_hb_interval, "Number of seconds between "
Dean Nelson35190502008-04-22 14:48:55 -05001366 "heartbeat increments.");
Dean Nelson89eb8eb2005-03-23 19:50:00 -07001367
1368module_param(xpc_hb_check_interval, int, 0);
1369MODULE_PARM_DESC(xpc_hb_check_interval, "Number of seconds between "
Dean Nelson35190502008-04-22 14:48:55 -05001370 "heartbeat checks.");
Dean Nelson89eb8eb2005-03-23 19:50:00 -07001371
Dean Nelsone54af722005-10-25 14:07:43 -05001372module_param(xpc_disengage_request_timelimit, int, 0);
1373MODULE_PARM_DESC(xpc_disengage_request_timelimit, "Number of seconds to wait "
Dean Nelson35190502008-04-22 14:48:55 -05001374 "for disengage request to complete.");
Dean Nelsone54af722005-10-25 14:07:43 -05001375
Dean Nelson1f4674b2006-01-10 11:08:00 -06001376module_param(xpc_kdebug_ignore, int, 0);
1377MODULE_PARM_DESC(xpc_kdebug_ignore, "Should lack of heartbeat be ignored by "
Dean Nelson35190502008-04-22 14:48:55 -05001378 "other partitions when dropping into kdebug.");