Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 109107
b: refs/heads/master
c: 8735728
h: refs/heads/master
i:
  109105: 6c7db8c
  109103: f1564fc
v: v3
  • Loading branch information
Rafael J. Wysocki authored and Ingo Molnar committed Aug 23, 2008
1 parent ba042bb commit f7e3f00
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 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: 91ede005d72df60d6b3f252be177a4743a6aa46a
refs/heads/master: 8735728ef8dc935c4fb351f913758fdbb62c308d
5 changes: 5 additions & 0 deletions trunk/arch/x86/kernel/cpu/mcheck/mce_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,7 @@ static struct sysdev_class mce_sysclass = {
};

DEFINE_PER_CPU(struct sys_device, device_mce);
void (*threshold_cpu_callback)(unsigned long action, unsigned int cpu) __cpuinitdata;

/* Why are there no generic functions for this? */
#define ACCESSOR(name, var, start) \
Expand Down Expand Up @@ -883,9 +884,13 @@ static int __cpuinit mce_cpu_callback(struct notifier_block *nfb,
case CPU_ONLINE:
case CPU_ONLINE_FROZEN:
mce_create_device(cpu);
if (threshold_cpu_callback)
threshold_cpu_callback(action, cpu);
break;
case CPU_DEAD:
case CPU_DEAD_FROZEN:
if (threshold_cpu_callback)
threshold_cpu_callback(action, cpu);
mce_remove_device(cpu);
break;
}
Expand Down
18 changes: 5 additions & 13 deletions trunk/arch/x86/kernel/cpu/mcheck/mce_amd_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,7 @@ static void threshold_remove_bank(unsigned int cpu, int bank)
deallocate_threshold_block(cpu, bank);

free_out:
kobject_del(b->kobj);
kobject_put(b->kobj);
kfree(b);
per_cpu(threshold_banks, cpu)[bank] = NULL;
Expand All @@ -645,14 +646,11 @@ static void threshold_remove_device(unsigned int cpu)
}

/* get notified when a cpu comes on/off */
static int __cpuinit threshold_cpu_callback(struct notifier_block *nfb,
unsigned long action, void *hcpu)
static void __cpuinit amd_64_threshold_cpu_callback(unsigned long action,
unsigned int cpu)
{
/* cpu was unsigned int to begin with */
unsigned int cpu = (unsigned long)hcpu;

if (cpu >= NR_CPUS)
goto out;
return;

switch (action) {
case CPU_ONLINE:
Expand All @@ -666,14 +664,8 @@ static int __cpuinit threshold_cpu_callback(struct notifier_block *nfb,
default:
break;
}
out:
return NOTIFY_OK;
}

static struct notifier_block threshold_cpu_notifier __cpuinitdata = {
.notifier_call = threshold_cpu_callback,
};

static __init int threshold_init_device(void)
{
unsigned lcpu = 0;
Expand All @@ -684,7 +676,7 @@ static __init int threshold_init_device(void)
if (err)
return err;
}
register_hotcpu_notifier(&threshold_cpu_notifier);
threshold_cpu_callback = amd_64_threshold_cpu_callback;
return 0;
}

Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-x86/mce.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ extern int mce_disabled;

void mce_log(struct mce *m);
DECLARE_PER_CPU(struct sys_device, device_mce);
extern void (*threshold_cpu_callback)(unsigned long action, unsigned int cpu);

#ifdef CONFIG_X86_MCE_INTEL
void mce_intel_feature_init(struct cpuinfo_x86 *c);
Expand Down

0 comments on commit f7e3f00

Please sign in to comment.