Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 174459
b: refs/heads/master
c: ba578cb
h: refs/heads/master
i:
  174457: ad98ee9
  174455: b39f8f2
v: v3
  • Loading branch information
Rusty Russell authored and Borislav Petkov committed Dec 7, 2009
1 parent 63a44af commit b4c9791
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 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: e97f8bb8ce5611a855c5a0dba949706ec37d4155
refs/heads/master: ba578cb34a71fb08fff14ac0796b934a8c9991e1
24 changes: 15 additions & 9 deletions trunk/drivers/edac/amd64_edac.c
Original file line number Diff line number Diff line change
Expand Up @@ -2631,7 +2631,7 @@ static int amd64_init_csrows(struct mem_ctl_info *mci)
static void amd64_enable_ecc_error_reporting(struct mem_ctl_info *mci)
{
struct amd64_pvt *pvt = mci->pvt_info;
const cpumask_t *cpumask = cpumask_of_node(pvt->mc_node_id);
const struct cpumask *cpumask = cpumask_of_node(pvt->mc_node_id);
int cpu, idx = 0, err = 0;
struct msr msrs[cpumask_weight(cpumask)];
u32 value;
Expand Down Expand Up @@ -2707,7 +2707,7 @@ static void amd64_enable_ecc_error_reporting(struct mem_ctl_info *mci)

static void amd64_restore_ecc_error_reporting(struct amd64_pvt *pvt)
{
const cpumask_t *cpumask = cpumask_of_node(pvt->mc_node_id);
const struct cpumask *cpumask = cpumask_of_node(pvt->mc_node_id);
int cpu, idx = 0, err = 0;
struct msr msrs[cpumask_weight(cpumask)];
u32 value;
Expand Down Expand Up @@ -2740,7 +2740,7 @@ static void amd64_restore_ecc_error_reporting(struct amd64_pvt *pvt)
}

/* get all cores on this DCT */
static void get_cpus_on_this_dct_cpumask(cpumask_t *mask, int nid)
static void get_cpus_on_this_dct_cpumask(struct cpumask *mask, int nid)
{
int cpu;

Expand All @@ -2752,25 +2752,30 @@ static void get_cpus_on_this_dct_cpumask(cpumask_t *mask, int nid)
/* check MCG_CTL on all the cpus on this node */
static bool amd64_nb_mce_bank_enabled_on_node(int nid)
{
cpumask_t mask;
cpumask_var_t mask;
struct msr *msrs;
int cpu, nbe, idx = 0;
bool ret = false;

cpumask_clear(&mask);
if (!zalloc_cpumask_var(&mask, GFP_KERNEL)) {
amd64_printk(KERN_WARNING, "%s: error allocating mask\n",
__func__);
return false;
}

get_cpus_on_this_dct_cpumask(&mask, nid);
get_cpus_on_this_dct_cpumask(mask, nid);

msrs = kzalloc(sizeof(struct msr) * cpumask_weight(&mask), GFP_KERNEL);
msrs = kzalloc(sizeof(struct msr) * cpumask_weight(mask), GFP_KERNEL);
if (!msrs) {
amd64_printk(KERN_WARNING, "%s: error allocating msrs\n",
__func__);
free_cpumask_var(mask);
return false;
}

rdmsr_on_cpus(&mask, MSR_IA32_MCG_CTL, msrs);
rdmsr_on_cpus(mask, MSR_IA32_MCG_CTL, msrs);

for_each_cpu(cpu, &mask) {
for_each_cpu(cpu, mask) {
nbe = msrs[idx].l & K8_MSR_MCGCTL_NBE;

debugf0("core: %u, MCG_CTL: 0x%llx, NB MSR is %s\n",
Expand All @@ -2786,6 +2791,7 @@ static bool amd64_nb_mce_bank_enabled_on_node(int nid)

out:
kfree(msrs);
free_cpumask_var(mask);
return ret;
}

Expand Down

0 comments on commit b4c9791

Please sign in to comment.