Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp406698rdf; Fri, 3 Nov 2023 04:34:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFBUTMZ/xUlRES3HqnvpWNsAVUZpIHaxyDs83o0MELxDfHkas19tX669ER3Qtb3/ZODWYpt X-Received: by 2002:a05:6a00:6513:b0:692:6417:728a with SMTP id hc19-20020a056a00651300b006926417728amr2712154pfb.14.1699011257136; Fri, 03 Nov 2023 04:34:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699011257; cv=none; d=google.com; s=arc-20160816; b=POCl9dr88zsDKX5Pi1S0iu7u/bjlzqIWD/k82hOZi6PJI23gjZPaejqxZeZWb2VkV7 LDWnlAyY9Kp5/8EjYnL1GH1FdrDbernLlLo3RoZ/q8hFaa+m3GUhdU/FvbXcAf9RRRpX wbIYComo69iHzkloWfyji0AK3LUYdKEN1GQkdaPUSIeAeASoovy4LMr+fO1kN6N4WrZh Ze+mAGCK4VlxKWEEMEazpPWYGaRAG7g7GbTEeOL52umUFTJZQFdTUWS1qNdYm9FRmbnz BM/aQ8JYL/SloF38sD+znOxvVRSdQVfuww6QQHSlhYiYet9Td1MYJRrCoEgpP8ZsnwZ5 xf+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=aWNDBFqjcQyMnSOTKVQrCZ9BqWk3QdDmEVV/ZuNeEuw=; fh=JKYYV5gKVYtyfUnBYWDIrZgcP9xP62SB2O/Fef95qFg=; b=L3w87mHXoC1Rmp4xW19gXAjYmkjSyDU4MEpjmT6AxCFmY0/UkyPHqzDXf9h537xQkr hi8PlbUQdYyvnbSqUIcXsaM+qVCkix5qvBJdpXzbSHAszov6M/73G6oF2FkclWPRR9ej mtf7EECj2BPVYoULaqY1fDuq9hjPNy34I7BQTjb4yXCiTpqK0PnivY+dN1JYjH2E3SZW m44X94IJW7zRU3T8u2Bw9oervMFxDkWPsFyS2HXORpEPf2kQdF4IdJaFNjgHswBanbIG fov/EpLGLspAxy6xKh0mUJ79pWWQcu+ZrZbaFwefXh/y/au0L88q56rkKzXDHpCCy8Gk AI6Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id cb8-20020a056a00430800b006b6cc63a79csi1391750pfb.330.2023.11.03.04.34.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 04:34:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id BE7A2829110B; Fri, 3 Nov 2023 04:34:14 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231461AbjKCLeH (ORCPT + 99 others); Fri, 3 Nov 2023 07:34:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229379AbjKCLeG (ORCPT ); Fri, 3 Nov 2023 07:34:06 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A19D134 for ; Fri, 3 Nov 2023 04:34:01 -0700 (PDT) Received: from kwepemm000013.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4SMJTV467CzrTYC; Fri, 3 Nov 2023 19:30:54 +0800 (CST) Received: from [10.174.178.46] (10.174.178.46) by kwepemm000013.china.huawei.com (7.193.23.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Fri, 3 Nov 2023 19:33:58 +0800 Subject: Re: [PATCH v4 1/5] ubi: Use the fault injection framework to enhance the fault injection capability To: ZhaoLong Wang , , , CC: , , , References: <20231103065536.3778940-1-wangzhaolong1@huawei.com> <20231103065536.3778940-2-wangzhaolong1@huawei.com> From: Zhihao Cheng Message-ID: <1662c6dd-699c-1fae-a10f-037f6ab26ce0@huawei.com> Date: Fri, 3 Nov 2023 19:33:46 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20231103065536.3778940-2-wangzhaolong1@huawei.com> Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.178.46] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm000013.china.huawei.com (7.193.23.81) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.7 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Fri, 03 Nov 2023 04:34:14 -0700 (PDT) ?? 2023/11/3 14:55, ZhaoLong Wang ะด??: > To make debug parameters configurable at run time, use the > fault injection framework to reconstruct the debugfs interface, > and retain the legacy fault injection interface. > > Now, the file emulate_failures and fault_attr files control whether > to enable fault emmulation. > > The file emulate_failures receives a mask that controls type and > process of fault injection. Generally, for ease of use, you can > directly enter a mask with all 1s. > > echo 0xffff > /sys/kernel/debug/ubi/ubi0/emulate_failures > > And you need to configure other fault-injection capabilities for > testing purpose: > > echo 100 > /sys/kernel/debug/ubi/fault_inject/emulate_power_cut/probability > echo 15 > /sys/kernel/debug/ubi/fault_inject/emulate_power_cut/space > echo 2 > /sys/kernel/debug/ubi/fault_inject/emulate_power_cut/verbose > echo -1 > /sys/kernel/debug/ubi/fault_inject/emulate_power_cut/times > > The CONFIG_MTD_UBI_FAULT_INJECTION to enable the Fault Injection is > added to kconfig. > > Signed-off-by: ZhaoLong Wang > --- > drivers/mtd/ubi/Kconfig | 9 +++ > drivers/mtd/ubi/debug.c | 68 +++++++++++++++++-- > drivers/mtd/ubi/debug.h | 142 +++++++++++++++++++++++++++++++++------- > drivers/mtd/ubi/io.c | 10 ++- > drivers/mtd/ubi/ubi.h | 15 ++--- > 5 files changed, 202 insertions(+), 42 deletions(-) > > Reviewed-by: Zhihao Cheng