diff options
author | Richard Weinberger <richard@nod.at> | 2014-09-22 11:44:50 +0200 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2015-03-26 22:46:03 +0100 |
commit | 5fa7fa5dad0cf8f2b47bb8dca91c605c48d282f6 (patch) | |
tree | 1781c7666647ede6e57e8c631b6f1af3ed8361e3 /drivers/mtd/ubi/debug.c | |
parent | UBI: Fastmap: Rework fastmap error paths (diff) | |
download | linux-5fa7fa5dad0cf8f2b47bb8dca91c605c48d282f6.tar.xz linux-5fa7fa5dad0cf8f2b47bb8dca91c605c48d282f6.zip |
UBI: Add initial support for fastmap self checks
Using this debugfs knob fastmap self checks can be controlled.
Signed-off-by: Richard Weinberger <richard@nod.at>
Reviewed-by: Tanya Brokhman <tlinder@codeaurora.org>
Diffstat (limited to 'drivers/mtd/ubi/debug.c')
-rw-r--r-- | drivers/mtd/ubi/debug.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/mtd/ubi/debug.c b/drivers/mtd/ubi/debug.c index 7335c9ff9d99..224fed085102 100644 --- a/drivers/mtd/ubi/debug.c +++ b/drivers/mtd/ubi/debug.c @@ -275,6 +275,8 @@ static ssize_t dfs_file_read(struct file *file, char __user *user_buf, val = d->chk_gen; else if (dent == d->dfs_chk_io) val = d->chk_io; + else if (dent == d->dfs_chk_fastmap) + val = d->chk_fastmap; else if (dent == d->dfs_disable_bgt) val = d->disable_bgt; else if (dent == d->dfs_emulate_bitflips) @@ -336,6 +338,8 @@ static ssize_t dfs_file_write(struct file *file, const char __user *user_buf, d->chk_gen = val; else if (dent == d->dfs_chk_io) d->chk_io = val; + else if (dent == d->dfs_chk_fastmap) + d->chk_fastmap = val; else if (dent == d->dfs_disable_bgt) d->disable_bgt = val; else if (dent == d->dfs_emulate_bitflips) @@ -406,6 +410,13 @@ int ubi_debugfs_init_dev(struct ubi_device *ubi) goto out_remove; d->dfs_chk_io = dent; + fname = "chk_fastmap"; + dent = debugfs_create_file(fname, S_IWUSR, d->dfs_dir, (void *)ubi_num, + &dfs_fops); + if (IS_ERR_OR_NULL(dent)) + goto out_remove; + d->dfs_chk_fastmap = dent; + fname = "tst_disable_bgt"; dent = debugfs_create_file(fname, S_IWUSR, d->dfs_dir, (void *)ubi_num, &dfs_fops); |