summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/debug.c
diff options
context:
space:
mode:
authorZhaoLong Wang <wangzhaolong1@huawei.com>2023-12-26 02:01:10 +0100
committerRichard Weinberger <richard@nod.at>2024-01-06 23:39:29 +0100
commite30948f7c0730d9fb2271ff3eadd43eda4e44740 (patch)
tree13f97eec2dcc10674324dd4ed7ee6e1a8df1154d /drivers/mtd/ubi/debug.c
parentubi: Use the fault injection framework to enhance the fault injection capability (diff)
downloadlinux-e30948f7c0730d9fb2271ff3eadd43eda4e44740.tar.xz
linux-e30948f7c0730d9fb2271ff3eadd43eda4e44740.zip
ubi: Split io_failures into write_failure and erase_failure
The emulate_io_failures debugfs entry controls both write failure and erase failure. This patch split io_failures to write_failure and erase_failure. Signed-off-by: ZhaoLong Wang <wangzhaolong1@huawei.com> Reviewed-by: Zhihao Cheng <chengzhihao1@huawei.com> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'drivers/mtd/ubi/debug.c')
-rw-r--r--drivers/mtd/ubi/debug.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/mtd/ubi/debug.c b/drivers/mtd/ubi/debug.c
index fd101ad6f12f..186306228b4d 100644
--- a/drivers/mtd/ubi/debug.c
+++ b/drivers/mtd/ubi/debug.c
@@ -14,7 +14,8 @@
#ifdef CONFIG_MTD_UBI_FAULT_INJECTION
static DECLARE_FAULT_ATTR(fault_bitflips_attr);
-static DECLARE_FAULT_ATTR(fault_io_failures_attr);
+static DECLARE_FAULT_ATTR(fault_write_failure_attr);
+static DECLARE_FAULT_ATTR(fault_erase_failure_attr);
static DECLARE_FAULT_ATTR(fault_power_cut_attr);
#define FAIL_ACTION(name, fault_attr) \
@@ -24,7 +25,8 @@ bool should_fail_##name(void) \
}
FAIL_ACTION(bitflips, fault_bitflips_attr)
-FAIL_ACTION(io_failures, fault_io_failures_attr)
+FAIL_ACTION(write_failure, fault_write_failure_attr)
+FAIL_ACTION(erase_failure, fault_erase_failure_attr)
FAIL_ACTION(power_cut, fault_power_cut_attr)
#endif
@@ -245,8 +247,11 @@ static void dfs_create_fault_entry(struct dentry *parent)
fault_create_debugfs_attr("emulate_bitflips", dir,
&fault_bitflips_attr);
- fault_create_debugfs_attr("emulate_io_failures", dir,
- &fault_io_failures_attr);
+ fault_create_debugfs_attr("emulate_write_failure", dir,
+ &fault_write_failure_attr);
+
+ fault_create_debugfs_attr("emulate_erase_failure", dir,
+ &fault_erase_failure_attr);
fault_create_debugfs_attr("emulate_power_cut", dir,
&fault_power_cut_attr);