Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 347889
b: refs/heads/master
c: 891348c
h: refs/heads/master
i:
  347887: 7e1a772
v: v3
  • Loading branch information
Robin Holt authored and Linus Torvalds committed Dec 21, 2012
1 parent b83ddf3 commit 3403189
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c39540c6d1add1d0ad843b3d2437311924193359
refs/heads/master: 891348ca0f66206f1dc0e30d63757e3df1ae2d15
34 changes: 32 additions & 2 deletions trunk/drivers/misc/sgi-xp/xpc_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@
#include <linux/kthread.h>
#include "xpc.h"

#ifdef CONFIG_X86_64
#include <asm/traps.h>
#endif

/* define two XPC debug device structures to be used with dev_dbg() et al */

struct device_driver xpc_dbg_name = {
Expand Down Expand Up @@ -1079,6 +1083,9 @@ xpc_system_reboot(struct notifier_block *nb, unsigned long event, void *unused)
return NOTIFY_DONE;
}

/* Used to only allow one cpu to complete disconnect */
static unsigned int xpc_die_disconnecting;

/*
* Notify other partitions to deactivate from us by first disengaging from all
* references to our memory.
Expand All @@ -1092,6 +1099,9 @@ xpc_die_deactivate(void)
long keep_waiting;
long wait_to_print;

if (cmpxchg(&xpc_die_disconnecting, 0, 1))
return;

/* keep xpc_hb_checker thread from doing anything (just in case) */
xpc_exiting = 1;

Expand Down Expand Up @@ -1159,7 +1169,7 @@ xpc_die_deactivate(void)
* about the lack of a heartbeat.
*/
static int
xpc_system_die(struct notifier_block *nb, unsigned long event, void *unused)
xpc_system_die(struct notifier_block *nb, unsigned long event, void *_die_args)
{
#ifdef CONFIG_IA64 /* !!! temporary kludge */
switch (event) {
Expand Down Expand Up @@ -1191,7 +1201,27 @@ xpc_system_die(struct notifier_block *nb, unsigned long event, void *unused)
break;
}
#else
xpc_die_deactivate();
struct die_args *die_args = _die_args;

switch (event) {
case DIE_TRAP:
if (die_args->trapnr == X86_TRAP_DF)
xpc_die_deactivate();

if (((die_args->trapnr == X86_TRAP_MF) ||
(die_args->trapnr == X86_TRAP_XF)) &&
!user_mode_vm(die_args->regs))
xpc_die_deactivate();

break;
case DIE_INT3:
case DIE_DEBUG:
break;
case DIE_OOPS:
case DIE_GPF:
default:
xpc_die_deactivate();
}
#endif

return NOTIFY_DONE;
Expand Down

0 comments on commit 3403189

Please sign in to comment.