git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] x86_64: mce_amd relocate sysfs files
[pandora-kernel.git]
/
arch
/
x86_64
/
kernel
/
mce.c
diff --git
a/arch/x86_64/kernel/mce.c
b/arch/x86_64/kernel/mce.c
index
04282ef
..
acd5816
100644
(file)
--- a/
arch/x86_64/kernel/mce.c
+++ b/
arch/x86_64/kernel/mce.c
@@
-29,6
+29,8
@@
#define MISC_MCELOG_MINOR 227
#define NR_BANKS 6
#define MISC_MCELOG_MINOR 227
#define NR_BANKS 6
+atomic_t mce_entry;
+
static int mce_dont_init;
/* 0: always panic, 1: panic if deadlock possible, 2: try to avoid panic,
static int mce_dont_init;
/* 0: always panic, 1: panic if deadlock possible, 2: try to avoid panic,
@@
-172,10
+174,12
@@
void do_machine_check(struct pt_regs * regs, long error_code)
int i;
int panicm_found = 0;
int i;
int panicm_found = 0;
+ atomic_inc(&mce_entry);
+
if (regs)
notify_die(DIE_NMI, "machine check", regs, error_code, 18, SIGKILL);
if (!banks)
if (regs)
notify_die(DIE_NMI, "machine check", regs, error_code, 18, SIGKILL);
if (!banks)
-
return
;
+
goto out2
;
memset(&m, 0, sizeof(struct mce));
m.cpu = safe_smp_processor_id();
memset(&m, 0, sizeof(struct mce));
m.cpu = safe_smp_processor_id();
@@
-266,6
+270,8
@@
void do_machine_check(struct pt_regs * regs, long error_code)
out:
/* Last thing done in the machine check exception to clear state. */
wrmsrl(MSR_IA32_MCG_STATUS, 0);
out:
/* Last thing done in the machine check exception to clear state. */
wrmsrl(MSR_IA32_MCG_STATUS, 0);
+ out2:
+ atomic_dec(&mce_entry);
}
/*
}
/*
@@
-501,7
+507,7
@@
static struct miscdevice mce_log_device = {
static int __init mcheck_disable(char *str)
{
mce_dont_init = 1;
static int __init mcheck_disable(char *str)
{
mce_dont_init = 1;
- return
0
;
+ return
1
;
}
/* mce=off disables machine check. Note you can reenable it later
}
/* mce=off disables machine check. Note you can reenable it later
@@
-521,7
+527,7
@@
static int __init mcheck_enable(char *str)
get_option(&str, &tolerant);
else
printk("mce= argument %s ignored. Please use /sys", str);
get_option(&str, &tolerant);
else
printk("mce= argument %s ignored. Please use /sys", str);
- return
0
;
+ return
1
;
}
__setup("nomce", mcheck_disable);
}
__setup("nomce", mcheck_disable);
@@
-556,7
+562,7
@@
static struct sysdev_class mce_sysclass = {
set_kset_name("machinecheck"),
};
set_kset_name("machinecheck"),
};
-
static
DEFINE_PER_CPU(struct sys_device, device_mce);
+DEFINE_PER_CPU(struct sys_device, device_mce);
/* Why are there no generic functions for this? */
#define ACCESSOR(name, var, start) \
/* Why are there no generic functions for this? */
#define ACCESSOR(name, var, start) \
@@
-623,7
+629,7
@@
static __cpuinit void mce_remove_device(unsigned int cpu)
#endif
/* Get notified when a cpu comes on/off. Be hotplug friendly. */
#endif
/* Get notified when a cpu comes on/off. Be hotplug friendly. */
-static
__cpuinit
int
+static int
mce_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
{
unsigned int cpu = (unsigned long)hcpu;
mce_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
{
unsigned int cpu = (unsigned long)hcpu;