Skip to content

Commit

Permalink
EDAC, MCE, AMD: Simplify NB MCE decoder interface
Browse files Browse the repository at this point in the history
Drop third nbcfg argument which is old remains and not required anymore.

No functionality change.

Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
  • Loading branch information
Borislav Petkov committed Oct 6, 2011
1 parent 295d8cd commit b0b07a2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 17 deletions.
6 changes: 2 additions & 4 deletions drivers/edac/amd64_edac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1953,11 +1953,9 @@ static inline void __amd64_decode_bus_error(struct mem_ctl_info *mci,
amd64_handle_ue(mci, m);
}

void amd64_decode_bus_error(int node_id, struct mce *m, u32 nbcfg)
void amd64_decode_bus_error(int node_id, struct mce *m)
{
struct mem_ctl_info *mci = mcis[node_id];

__amd64_decode_bus_error(mci, m);
__amd64_decode_bus_error(mcis[node_id], m);
}

/*
Expand Down
20 changes: 10 additions & 10 deletions drivers/edac/mce_amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ static u8 xec_mask = 0xf;
static u8 nb_err_cpumask = 0xf;

static bool report_gart_errors;
static void (*nb_bus_decoder)(int node_id, struct mce *m, u32 nbcfg);
static void (*nb_bus_decoder)(int node_id, struct mce *m);

void amd_report_gart_errors(bool v)
{
report_gart_errors = v;
}
EXPORT_SYMBOL_GPL(amd_report_gart_errors);

void amd_register_ecc_decoder(void (*f)(int, struct mce *, u32))
void amd_register_ecc_decoder(void (*f)(int, struct mce *))
{
nb_bus_decoder = f;
}
EXPORT_SYMBOL_GPL(amd_register_ecc_decoder);

void amd_unregister_ecc_decoder(void (*f)(int, struct mce *, u32))
void amd_unregister_ecc_decoder(void (*f)(int, struct mce *))
{
if (nb_bus_decoder) {
WARN_ON(nb_bus_decoder != f);
Expand Down Expand Up @@ -592,11 +592,12 @@ static bool nb_noop_mce(u16 ec, u8 xec)
return false;
}

void amd_decode_nb_mce(int node_id, struct mce *m, u32 nbcfg)
void amd_decode_nb_mce(struct mce *m)
{
struct cpuinfo_x86 *c = &boot_cpu_data;
u16 ec = EC(m->status);
u8 xec = XEC(m->status, 0x1f);
int node_id = amd_get_nb_id(m->extcpu);
u16 ec = EC(m->status);
u8 xec = XEC(m->status, 0x1f);

pr_emerg(HW_ERR "Northbridge Error (node %d): ", node_id);

Expand Down Expand Up @@ -630,7 +631,7 @@ void amd_decode_nb_mce(int node_id, struct mce *m, u32 nbcfg)

if (c->x86 == 0xf || c->x86 == 0x10 || c->x86 == 0x15)
if ((xec == 0x8 || xec == 0x0) && nb_bus_decoder)
nb_bus_decoder(node_id, m, nbcfg);
nb_bus_decoder(node_id, m);

return;

Expand Down Expand Up @@ -746,7 +747,7 @@ int amd_decode_mce(struct notifier_block *nb, unsigned long val, void *data)
{
struct mce *m = (struct mce *)data;
struct cpuinfo_x86 *c = &boot_cpu_data;
int node, ecc;
int ecc;

if (amd_filter_mce(m))
return NOTIFY_STOP;
Expand Down Expand Up @@ -795,8 +796,7 @@ int amd_decode_mce(struct notifier_block *nb, unsigned long val, void *data)
break;

case 4:
node = amd_get_nb_id(m->extcpu);
amd_decode_nb_mce(node, m, 0);
amd_decode_nb_mce(m);
break;

case 5:
Expand Down
6 changes: 3 additions & 3 deletions drivers/edac/mce_amd.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ struct amd_decoder_ops {
};

void amd_report_gart_errors(bool);
void amd_register_ecc_decoder(void (*f)(int, struct mce *, u32));
void amd_unregister_ecc_decoder(void (*f)(int, struct mce *, u32));
void amd_decode_nb_mce(int, struct mce *, u32);
void amd_register_ecc_decoder(void (*f)(int, struct mce *));
void amd_unregister_ecc_decoder(void (*f)(int, struct mce *));
void amd_decode_nb_mce(struct mce *);
int amd_decode_mce(struct notifier_block *nb, unsigned long val, void *data);

#endif /* _EDAC_MCE_AMD_H */

0 comments on commit b0b07a2

Please sign in to comment.