From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3ACC1CAC582 for ; Fri, 12 Sep 2025 07:57:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Subject:References: In-Reply-To:Message-ID:Cc:To:From:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=y1Pdw2GYGnSyHjqUN+4+QcrkwJQGlg1xIZZnYy/srmA=; b=iV/48NYfCSDk33pjXU4c55x+Hl oC45mMUHddfsjv7EA/vNs8Is99nnMZG7WHEsajmXkofuPcy6j39BCkmqTt2cqiaUnP3hTRI6+fJI5 Mspn/C1SsOBald2HnHjPS6H8gfEbW2iA71gbmyuGrcAd1V+VMkEADzSgVbp4+5DY4BTWBGRJoJUP0 Kj5N5Vq8cn9cjtpBCG79XakuogZTVnxY48xu/Cw257RYThEK5KZxIa497yYdyoD8lHWI0berUTnL+ my1DNEPiD9zDNxerXO2qoZTxhhSAXWwKiqxwja6mgczJD2Of/GikkW8mOKfQ+xinvD7HE34vSNufi fJlIMkZA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uwyf8-00000007lqL-3tKg; Fri, 12 Sep 2025 07:57:42 +0000 Received: from mailout.nod.at ([116.203.167.152] helo=lithops.sigma-star.at) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uwyf6-00000007llc-0sc0 for linux-mtd@lists.infradead.org; Fri, 12 Sep 2025 07:57:42 +0000 Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 199A02C14AD; Fri, 12 Sep 2025 09:57:29 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id M83sCyoVSc9o; Fri, 12 Sep 2025 09:57:28 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id B59F92C14B1; Fri, 12 Sep 2025 09:57:28 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id mvoMTFhVDM1w; Fri, 12 Sep 2025 09:57:28 +0200 (CEST) Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) by lithops.sigma-star.at (Postfix) with ESMTP id 8E2C22C14AD; Fri, 12 Sep 2025 09:57:28 +0200 (CEST) Date: Fri, 12 Sep 2025 09:57:28 +0200 (CEST) From: Richard Weinberger To: Cheng Ming Lin Cc: chengzhihao1 , Miquel Raynal , Vignesh Raghavendra , linux-mtd , linux-kernel , Alvin Zhou , leoyu , Cheng Ming Lin Message-ID: <1899901955.27456.1757663848457.JavaMail.zimbra@nod.at> In-Reply-To: References: <20250812051949.983040-1-linchengming884@gmail.com> <152133202.103367.1754981828821.JavaMail.zimbra@nod.at> <608935583.115196.1755171013804.JavaMail.zimbra@nod.at> Subject: Re: [RFC] mtd: ubi: skip programming unused bits in ubi headers MIME-Version: 1.0 X-Originating-IP: [195.201.40.130] X-Mailer: Zimbra 8.8.12_GA_3807 (ZimbraWebClient - FF141 (Linux)/8.8.12_GA_3809) Thread-Topic: skip programming unused bits in ubi headers Thread-Index: FR1UTwWJsSzQA+5g+AzaxW1MoRcCZw== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250912_005740_390822_CA0FEA9A X-CRM114-Status: UNSURE ( 8.12 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org LS0tLS0gVXJzcHLDvG5nbGljaGUgTWFpbCAtLS0tLQo+IFZvbjogIkNoZW5nIE1pbmcgTGluIiA8 bGluY2hlbmdtaW5nODg0QGdtYWlsLmNvbT4KPj4gVGhhdCdzIHRoZSBjcnVjaWFsIHF1ZXN0aW9u LiBJcyB0aGlzIHRydWUgZm9yIGFsbCBOQU5EIGNoaXBzPwo+PiBEbyBhdm9pZCBsYXJnZXIgd3Jp dGVzIG9mIDB4RkYgcGF0dGVybnMgZmlsZSBzeXN0ZW1zIHN1Y2ggYXMgVUJJRlMKPj4gYWxzbyB1 c2UgY29tcHJlc3Npb24gYSBsb3QuCj4+IEF0IGxlYXN0IHRoYXQncyB3aGF0IEkgaGF2ZSBiZWVu IHRvbGQgd2hlbiBJIGFza2VkIDEwKyB5ZWFycyBhZ28KPj4gaG93IFVCSSB3b3Jrcy4KPiAKPiBZ b3UgYXJlIGNvcnJlY3QgdGhhdCB0aGVyZSBpcyBhbiBpc3N1ZSB3aGVuIGJsYW5rIGRhdGEgcGFn ZXMgYXJlIHJlcGVhdGVkbHkKPiBlcmFzZWQuIFRoaXMgY2FuIGxlYWQgdG8gY2VsbHMgZW50ZXJp bmcgYSB0b28gZGVlcCBWVCBzdGF0ZSwgd2hpY2ggbWF5Cj4gY2F1c2UgcHJvZ3JhbSBmYWlsdXJl cyBpbiBzdWJzZXF1ZW50IG9wZX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bGluZyB3aXRoIGEgaGlnaCBwZXJjZW50YWdlIG9mIOKAmDAnCj4gYml0cyBpbiB0 aGUgZGF0YSBwYXR0ZXJuIGNhbiBhY2NlbGVyYXRlIGJsb2NrIGVuZHVyYW5jZSBkZWdyYWRhdGlv bi4KPiBUaGlzIGZ1cnRoZXIgc3VwcG9ydHMgYXZvaWRpbmcgbGFyZ2UgMHgwMCBwYXR0ZXJucy4K ClRoYW5rcyBmb3IgdGhlIGRldGFpbGVkIGFuc3dlciEKU28sIHllcyBsZXQncyBhcHBseSB0aGlz IGNoYW5nZS4KClRoYW5rcywKLy9yaWNoYXJkCgpfX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KTGludXggTVREIGRpc2N1c3Npb24gbWFpbGluZyBs aXN0Cmh0dHA6Ly9saXN0cy5pbmZyYWRlYWQub3JnL21haWxtYW4vbGlzdGluZm8vbGludXgtbXRk Lwo= From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lithops.sigma-star.at (mailout.nod.at [116.203.167.152]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E513925A2CD for ; Fri, 12 Sep 2025 07:57:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=116.203.167.152 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757663859; cv=none; b=FqOvygy1XzgI6ViSNQVwSgOSBweyi/UUNFvBs6ufLoQqz4Dk1faXdHVDPWix7ApUWQcKJ1OvyV+8EyUh7YJ8zSbeM03zmkRwqsyg1FaOAAhI7AyjkNs8uLfCirvaj5f3iH/Jlsv29WjivIjNK++3X6t6KhQebrdCInfeT/N4UW4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757663859; c=relaxed/simple; bh=BbOB0ELHSrzS9qFp4mj021OSKJ3BuFGnG2nPTDvuAGI=; h=Date:From:To:Cc:Message-ID:In-Reply-To:References:Subject: MIME-Version:Content-Type; b=fPqayaqcURwE/F9gQDhPTgYPUFj6lXDKV1z1mu3u5/aZp2ehBY7w3lfzxrg0V0XQvce+Mhpgx3J4MiQDLx+4fF8e4Jz7C4qf6e91Qa9I3kJ2GfCrgEP15fdQ/yMaCCkjWqP4Txe3JErM8WvZftJyMlnMH5rhsrpTxlvnFsFAFKo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nod.at; spf=fail smtp.mailfrom=nod.at; arc=none smtp.client-ip=116.203.167.152 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nod.at Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nod.at Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 199A02C14AD; Fri, 12 Sep 2025 09:57:29 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id M83sCyoVSc9o; Fri, 12 Sep 2025 09:57:28 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id B59F92C14B1; Fri, 12 Sep 2025 09:57:28 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id mvoMTFhVDM1w; Fri, 12 Sep 2025 09:57:28 +0200 (CEST) Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) by lithops.sigma-star.at (Postfix) with ESMTP id 8E2C22C14AD; Fri, 12 Sep 2025 09:57:28 +0200 (CEST) Date: Fri, 12 Sep 2025 09:57:28 +0200 (CEST) From: Richard Weinberger To: Cheng Ming Lin Cc: chengzhihao1 , Miquel Raynal , Vignesh Raghavendra , linux-mtd , linux-kernel , Alvin Zhou , leoyu , Cheng Ming Lin Message-ID: <1899901955.27456.1757663848457.JavaMail.zimbra@nod.at> In-Reply-To: References: <20250812051949.983040-1-linchengming884@gmail.com> <152133202.103367.1754981828821.JavaMail.zimbra@nod.at> <608935583.115196.1755171013804.JavaMail.zimbra@nod.at> Subject: Re: [RFC] mtd: ubi: skip programming unused bits in ubi headers Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Mailer: Zimbra 8.8.12_GA_3807 (ZimbraWebClient - FF141 (Linux)/8.8.12_GA_3809) Thread-Topic: skip programming unused bits in ubi headers Thread-Index: FR1UTwWJsSzQA+5g+AzaxW1MoRcCZw== ----- Urspr=C3=BCngliche Mail ----- > Von: "Cheng Ming Lin" >> That's the crucial question. Is this true for all NAND chips? >> Do avoid larger writes of 0xFF patterns file systems such as UBIFS >> also use compression a lot. >> At least that's what I have been told when I asked 10+ years ago >> how UBI works. >=20 > You are correct that there is an issue when blank data pages are repeated= ly > erased. This can lead to cells entering a too deep VT state, which may > cause program failures in subsequent operations. >=20 > To address this, newer NAND generations typically perform a pre-program > step before executing the actual erase. This keeps the VT distribution fr= om > going too deep, thereby avoiding the blank-page degradation problem. > Such pre-PGM techniques have been widely adopted for roughly the past > 10=E2=80=9315 years. >=20 > Additionally, JESD22-A117E (page 6, section 4.1.2.1) specifies examples o= f > acceptable data patterns, including solid-programmed, checkerboard/invers= e- > checkerboard, and checkerboard-with-fill patterns. According to > qualification knowledge bases, using 0x00 can sometimes trigger special > failure modes, whereas writing 0xFF is more robust. >=20 > Additionally, the Kioxia TC58NVG1S3HTA00 datasheet (page 63) also notes > that continuous program/erase cycling with a high percentage of =E2=80=98= 0' > bits in the data pattern can accelerate block endurance degradation. > This further supports avoiding large 0x00 patterns. Thanks for the detailed answer! So, yes let's apply this change. Thanks, //richard