Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2423098pxb; Mon, 11 Jan 2021 09:14:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJyKK3EKYsl8IBrF886bZYrjYr2t9GQXKsPjSe62mjyLsC1THB8cfGCTfrXdTtN4tLBu9gXn X-Received: by 2002:a17:906:e093:: with SMTP id gh19mr336237ejb.510.1610385260965; Mon, 11 Jan 2021 09:14:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610385260; cv=none; d=google.com; s=arc-20160816; b=PdPi4Gfjkl5PE+x5VunKCg8RKCKY/i6WGMWhTEXCipqO6qsNFhrhexH83uqsQ6rDcy zO/ZYelZFNcq864nKgNeYTZmxF/82w5MfXiMbDc367TvMyddyf0aU7RAuFj6xsLLmYUP sx4pa0Yaw8K2anTI9se6Qz3ji0exk9GZNlWp+0S7tXElTvQ2oLU4HhrG42+70zAGlwSZ W/M7d4YEvQSTUWoqsfc78KZHzogip7QepLMzDeYxNoz1vgMKOeppT3YiiitcplR1nVE9 Zix2BwXsXLLU5kEQnPH3y2Sju87M58Y1XczItCdeAFZcCj+dpmTxsLjsQw28vZQRtglg uhXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=1iKigEbg5ZzmyMLWTkwyWE68nlJIo8zyWfov4u6s8Zk=; b=GCvitSoP25Nr2j7PueezaBQzl9h4pCmMW+xOq1k5hxTU+r2bV+EHF1ZrpzoOkQGRgX fDj7LhvmBa7JPooR4szRQbbDQRfUb1J6urrG8w2NJfN8tQDZnv6okm3mCmt4uyqI1eFH 7XsamEyKAtNgBF6QCvmT6xkhw9sbDpxfVn4Hfsz0jcKwWnPNI4R/YrKQAFxuk4EplTzZ hlRdjEM83b9d57XP8SV82/yJCrZXQVeS2wUY4MwwlKeNGyCGFWuYBJeva04pDnlUvhKy Di7Uhn+eiau0egabM0+m2D5XT51doGHtd4dUhctmpng79IQT6zNXgd6QmgpmqMCZYzNG fNsw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b24si18050eja.598.2021.01.11.09.13.56; Mon, 11 Jan 2021 09:14:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389245AbhAKRMU (ORCPT + 99 others); Mon, 11 Jan 2021 12:12:20 -0500 Received: from foss.arm.com ([217.140.110.172]:33204 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730342AbhAKRMT (ORCPT ); Mon, 11 Jan 2021 12:12:19 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 12D8F11B3; Mon, 11 Jan 2021 09:11:34 -0800 (PST) Received: from e120877-lin.cambridge.arm.com (e120877-lin.cambridge.arm.com [10.1.194.43]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 3DC3E3F70D; Mon, 11 Jan 2021 09:11:33 -0800 (PST) From: vincent.donnefort@arm.com To: peterz@infradead.org, tglx@linutronix.de, linux-kernel@vger.kernel.org Cc: valentin.schneider@arm.com, Vincent Donnefort Subject: [PATCH 1/4] cpu/hotplug: Allowing to reset fail injection Date: Mon, 11 Jan 2021 17:10:44 +0000 Message-Id: <1610385047-92151-2-git-send-email-vincent.donnefort@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1610385047-92151-1-git-send-email-vincent.donnefort@arm.com> References: <1610385047-92151-1-git-send-email-vincent.donnefort@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vincent Donnefort Currently, the only way of resetting this file is to actually try to run a hotplug, hotunplug or both. This is quite annoying for testing and, as the default value for this file is -1, it seems quite natural to let a user write it. Signed-off-by: Vincent Donnefort --- kernel/cpu.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel/cpu.c b/kernel/cpu.c index 1b6302e..9121edf 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; -- 2.7.4