dect
/
linux-2.6
Archived
13
0
Fork 0

x86, mce: Fix up MCE naming nomenclature

Prefix global/setup routines with "mcheck_" thus differentiating
from the internal facilities prefixed with "mce_". Also, prefix
the per cpu calls with mcheck_cpu and rename them to reflect the
MCE setup hierarchy of calls better.

There should be no functionality change resulting from this
patch.

Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Cc: Andi Kleen <andi@firstfloor.org>
LKML-Reference: <1255689093-26921-1-git-send-email-borislav.petkov@amd.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
Borislav Petkov 2009-10-16 12:31:32 +02:00 committed by Ingo Molnar
parent 6b50f5c7c7
commit 5e09954a9a
3 changed files with 29 additions and 29 deletions

View File

@ -120,9 +120,9 @@ extern int mce_disabled;
extern int mce_p5_enabled; extern int mce_p5_enabled;
#ifdef CONFIG_X86_MCE #ifdef CONFIG_X86_MCE
void mcheck_init(struct cpuinfo_x86 *c); void mcheck_cpu_init(struct cpuinfo_x86 *c);
#else #else
static inline void mcheck_init(struct cpuinfo_x86 *c) {} static inline void mcheck_cpu_init(struct cpuinfo_x86 *c) {}
#endif #endif
#ifdef CONFIG_X86_ANCIENT_MCE #ifdef CONFIG_X86_ANCIENT_MCE

View File

@ -839,7 +839,7 @@ static void __cpuinit identify_cpu(struct cpuinfo_x86 *c)
#ifdef CONFIG_X86_MCE #ifdef CONFIG_X86_MCE
/* Init Machine Check Exception if available. */ /* Init Machine Check Exception if available. */
mcheck_init(c); mcheck_cpu_init(c);
#endif #endif
select_idle_routine(c); select_idle_routine(c);

View File

@ -1136,7 +1136,7 @@ static int check_interval = 5 * 60; /* 5 minutes */
static DEFINE_PER_CPU(int, mce_next_interval); /* in jiffies */ static DEFINE_PER_CPU(int, mce_next_interval); /* in jiffies */
static DEFINE_PER_CPU(struct timer_list, mce_timer); static DEFINE_PER_CPU(struct timer_list, mce_timer);
static void mcheck_timer(unsigned long data) static void mce_start_timer(unsigned long data)
{ {
struct timer_list *t = &per_cpu(mce_timer, data); struct timer_list *t = &per_cpu(mce_timer, data);
int *n; int *n;
@ -1220,7 +1220,7 @@ static int mce_banks_init(void)
/* /*
* Initialize Machine Checks for a CPU. * Initialize Machine Checks for a CPU.
*/ */
static int __cpuinit mce_cap_init(void) static int __cpuinit __mcheck_cpu_cap_init(void)
{ {
unsigned b; unsigned b;
u64 cap; u64 cap;
@ -1258,7 +1258,7 @@ static int __cpuinit mce_cap_init(void)
return 0; return 0;
} }
static void mce_init(void) static void __mcheck_cpu_init_generic(void)
{ {
mce_banks_t all_banks; mce_banks_t all_banks;
u64 cap; u64 cap;
@ -1287,7 +1287,7 @@ static void mce_init(void)
} }
/* Add per CPU specific workarounds here */ /* Add per CPU specific workarounds here */
static int __cpuinit mce_cpu_quirks(struct cpuinfo_x86 *c) static int __cpuinit __mcheck_cpu_apply_quirks(struct cpuinfo_x86 *c)
{ {
if (c->x86_vendor == X86_VENDOR_UNKNOWN) { if (c->x86_vendor == X86_VENDOR_UNKNOWN) {
pr_info("MCE: unknown CPU type - not enabling MCE support.\n"); pr_info("MCE: unknown CPU type - not enabling MCE support.\n");
@ -1355,7 +1355,7 @@ static int __cpuinit mce_cpu_quirks(struct cpuinfo_x86 *c)
return 0; return 0;
} }
static void __cpuinit mce_ancient_init(struct cpuinfo_x86 *c) static void __cpuinit __mcheck_cpu_ancient_init(struct cpuinfo_x86 *c)
{ {
if (c->x86 != 5) if (c->x86 != 5)
return; return;
@ -1369,7 +1369,7 @@ static void __cpuinit mce_ancient_init(struct cpuinfo_x86 *c)
} }
} }
static void mce_cpu_features(struct cpuinfo_x86 *c) static void __mcheck_cpu_init_vendor(struct cpuinfo_x86 *c)
{ {
switch (c->x86_vendor) { switch (c->x86_vendor) {
case X86_VENDOR_INTEL: case X86_VENDOR_INTEL:
@ -1383,7 +1383,7 @@ static void mce_cpu_features(struct cpuinfo_x86 *c)
} }
} }
static void mce_init_timer(void) static void __mcheck_cpu_init_timer(void)
{ {
struct timer_list *t = &__get_cpu_var(mce_timer); struct timer_list *t = &__get_cpu_var(mce_timer);
int *n = &__get_cpu_var(mce_next_interval); int *n = &__get_cpu_var(mce_next_interval);
@ -1394,7 +1394,7 @@ static void mce_init_timer(void)
*n = check_interval * HZ; *n = check_interval * HZ;
if (!*n) if (!*n)
return; return;
setup_timer(t, mcheck_timer, smp_processor_id()); setup_timer(t, mce_start_timer, smp_processor_id());
t->expires = round_jiffies(jiffies + *n); t->expires = round_jiffies(jiffies + *n);
add_timer_on(t, smp_processor_id()); add_timer_on(t, smp_processor_id());
} }
@ -1414,26 +1414,26 @@ void (*machine_check_vector)(struct pt_regs *, long error_code) =
* Called for each booted CPU to set up machine checks. * Called for each booted CPU to set up machine checks.
* Must be called with preempt off: * Must be called with preempt off:
*/ */
void __cpuinit mcheck_init(struct cpuinfo_x86 *c) void __cpuinit mcheck_cpu_init(struct cpuinfo_x86 *c)
{ {
if (mce_disabled) if (mce_disabled)
return; return;
mce_ancient_init(c); __mcheck_cpu_ancient_init(c);
if (!mce_available(c)) if (!mce_available(c))
return; return;
if (mce_cap_init() < 0 || mce_cpu_quirks(c) < 0) { if (__mcheck_cpu_cap_init() < 0 || __mcheck_cpu_apply_quirks(c) < 0) {
mce_disabled = 1; mce_disabled = 1;
return; return;
} }
machine_check_vector = do_machine_check; machine_check_vector = do_machine_check;
mce_init(); __mcheck_cpu_init_generic();
mce_cpu_features(c); __mcheck_cpu_init_vendor(c);
mce_init_timer(); __mcheck_cpu_init_timer();
INIT_WORK(&__get_cpu_var(mce_work), mce_process_work); INIT_WORK(&__get_cpu_var(mce_work), mce_process_work);
if (raw_smp_processor_id() == 0) if (raw_smp_processor_id() == 0)
@ -1665,7 +1665,7 @@ __setup("mce", mcheck_enable);
* Disable machine checks on suspend and shutdown. We can't really handle * Disable machine checks on suspend and shutdown. We can't really handle
* them later. * them later.
*/ */
static int mce_disable(void) static int mce_disable_error_reporting(void)
{ {
int i; int i;
@ -1680,12 +1680,12 @@ static int mce_disable(void)
static int mce_suspend(struct sys_device *dev, pm_message_t state) static int mce_suspend(struct sys_device *dev, pm_message_t state)
{ {
return mce_disable(); return mce_disable_error_reporting();
} }
static int mce_shutdown(struct sys_device *dev) static int mce_shutdown(struct sys_device *dev)
{ {
return mce_disable(); return mce_disable_error_reporting();
} }
/* /*
@ -1695,8 +1695,8 @@ static int mce_shutdown(struct sys_device *dev)
*/ */
static int mce_resume(struct sys_device *dev) static int mce_resume(struct sys_device *dev)
{ {
mce_init(); __mcheck_cpu_init_generic();
mce_cpu_features(&current_cpu_data); __mcheck_cpu_init_vendor(&current_cpu_data);
return 0; return 0;
} }
@ -1706,8 +1706,8 @@ static void mce_cpu_restart(void *data)
del_timer_sync(&__get_cpu_var(mce_timer)); del_timer_sync(&__get_cpu_var(mce_timer));
if (!mce_available(&current_cpu_data)) if (!mce_available(&current_cpu_data))
return; return;
mce_init(); __mcheck_cpu_init_generic();
mce_init_timer(); __mcheck_cpu_init_timer();
} }
/* Reinit MCEs after user configuration changes */ /* Reinit MCEs after user configuration changes */
@ -1733,7 +1733,7 @@ static void mce_enable_ce(void *all)
cmci_reenable(); cmci_reenable();
cmci_recheck(); cmci_recheck();
if (all) if (all)
mce_init_timer(); __mcheck_cpu_init_timer();
} }
static struct sysdev_class mce_sysclass = { static struct sysdev_class mce_sysclass = {
@ -2042,7 +2042,7 @@ static __init void mce_init_banks(void)
} }
} }
static __init int mce_init_device(void) static __init int mcheck_init_device(void)
{ {
int err; int err;
int i = 0; int i = 0;
@ -2070,7 +2070,7 @@ static __init int mce_init_device(void)
return err; return err;
} }
device_initcall(mce_init_device); device_initcall(mcheck_init_device);
/* /*
* Old style boot options parsing. Only for compatibility. * Old style boot options parsing. Only for compatibility.
@ -2118,7 +2118,7 @@ static int fake_panic_set(void *data, u64 val)
DEFINE_SIMPLE_ATTRIBUTE(fake_panic_fops, fake_panic_get, DEFINE_SIMPLE_ATTRIBUTE(fake_panic_fops, fake_panic_get,
fake_panic_set, "%llu\n"); fake_panic_set, "%llu\n");
static int __init mce_debugfs_init(void) static int __init mcheck_debugfs_init(void)
{ {
struct dentry *dmce, *ffake_panic; struct dentry *dmce, *ffake_panic;
@ -2132,5 +2132,5 @@ static int __init mce_debugfs_init(void)
return 0; return 0;
} }
late_initcall(mce_debugfs_init); late_initcall(mcheck_debugfs_init);
#endif #endif