Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 319390
b: refs/heads/master
c: 38ced28
h: refs/heads/master
v: v3
  • Loading branch information
Mauro Carvalho Chehab committed Jun 27, 2012
1 parent ee7c4e9 commit 50c464e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 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: 69154d069869b612383cef9d594f39b34ffba6dd
refs/heads/master: 38ced28b21efff18fd5e5c98a92830e8f0031cee
15 changes: 13 additions & 2 deletions trunk/drivers/edac/edac_mc_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -812,18 +812,24 @@ static ssize_t edac_fake_inject_write(struct file *file,
struct device *dev = file->private_data;
struct mem_ctl_info *mci = to_mci(dev);
static enum hw_event_mc_err_type type;
u16 errcount = mci->fake_inject_count;

if (!errcount)
errcount = 1;

type = mci->fake_inject_ue ? HW_EVENT_ERR_UNCORRECTED
: HW_EVENT_ERR_CORRECTED;

printk(KERN_DEBUG
"Generating a %s fake error to %d.%d.%d to test core handling. NOTE: this won't test the driver-specific decoding logic.\n",
"Generating %d %s fake error%s to %d.%d.%d to test core handling. NOTE: this won't test the driver-specific decoding logic.\n",
errcount,
(type == HW_EVENT_ERR_UNCORRECTED) ? "UE" : "CE",
errcount > 1 ? "s" : "",
mci->fake_inject_layer[0],
mci->fake_inject_layer[1],
mci->fake_inject_layer[2]
);
edac_mc_handle_error(type, mci, 1, 0, 0, 0,
edac_mc_handle_error(type, mci, errcount, 0, 0, 0,
mci->fake_inject_layer[0],
mci->fake_inject_layer[1],
mci->fake_inject_layer[2],
Expand Down Expand Up @@ -944,6 +950,11 @@ int edac_create_debug_nodes(struct mem_ctl_info *mci)
if (!d)
goto nomem;

d = debugfs_create_u16("fake_inject_count", S_IRUGO | S_IWUSR, parent,
&mci->fake_inject_count);
if (!d)
goto nomem;

d = debugfs_create_file("fake_inject", S_IWUSR, parent,
&mci->dev,
&debug_fake_inject_fops);
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/edac.h
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,7 @@ struct mem_ctl_info {
struct dentry *debugfs;
u8 fake_inject_layer[EDAC_MAX_LAYERS];
u32 fake_inject_ue;
u16 fake_inject_count;
#endif
};

Expand Down

0 comments on commit 50c464e

Please sign in to comment.