aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/cpu.c
diff options
context:
space:
mode:
authorVincent Donnefort <vincent.donnefort@arm.com>2021-02-16 10:35:04 +0000
committerIngo Molnar <mingo@kernel.org>2021-03-06 12:40:22 +0100
commit3ae70c251f344976428d1f6ee61ea7b4e170fec3 (patch)
tree12eb53005c7010cd4ebb09966bda979eb15ec68a /kernel/cpu.c
parentsched/pelt: Fix task util_est update filtering (diff)
downloadlinux-dev-3ae70c251f344976428d1f6ee61ea7b4e170fec3.tar.xz
linux-dev-3ae70c251f344976428d1f6ee61ea7b4e170fec3.zip
cpu/hotplug: Allowing to reset fail injection
Currently, the only way of resetting the fail injection is to trigger a hotplug, hotunplug or both. This is rather annoying for testing and, as the default value for this file is -1, it seems pretty natural to let a user write it. Signed-off-by: Vincent Donnefort <vincent.donnefort@arm.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lkml.kernel.org/r/20210216103506.416286-2-vincent.donnefort@arm.com
Diffstat (limited to 'kernel/cpu.c')
-rw-r--r--kernel/cpu.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 1b6302ecbabe..9121edf5759a 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -2207,6 +2207,11 @@ static ssize_t write_cpuhp_fail(struct device *dev,
if (ret)
return ret;
+ if (fail == CPUHP_INVALID) {
+ st->fail = fail;
+ return count;
+ }
+
if (fail < CPUHP_OFFLINE || fail > CPUHP_ONLINE)
return -EINVAL;