lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAyq3SaEqYiKhbjYwLH0p6F2G=UR-MwZF28AG1xVMoKhznS3Og@mail.gmail.com>
Date: Thu, 14 Aug 2025 18:11:07 +0800
From: Cheng Ming Lin <linchengming884@...il.com>
To: Richard Weinberger <richard@....at>
Cc: chengzhihao1 <chengzhihao1@...wei.com>, Miquel Raynal <miquel.raynal@...tlin.com>, 
	Vignesh Raghavendra <vigneshr@...com>, linux-mtd <linux-mtd@...ts.infradead.org>, 
	linux-kernel <linux-kernel@...r.kernel.org>, Alvin Zhou <alvinzhou@...c.com.tw>, leoyu@...c.com.tw, 
	Cheng Ming Lin <chengminglin@...c.com.tw>
Subject: Re: [RFC] mtd: ubi: skip programming unused bits in ubi headers

Hi Richard,

Richard Weinberger <richard@....at> 於 2025年8月12日 週二 下午2:57寫道:
>
> ----- Ursprüngliche Mail -----
> > Von: "Cheng Ming Lin" <linchengming884@...il.com>
> > An: "richard" <richard@....at>, "chengzhihao1" <chengzhihao1@...wei.com>, "Miquel Raynal" <miquel.raynal@...tlin.com>,
> > "Vignesh Raghavendra" <vigneshr@...com>, "linux-mtd" <linux-mtd@...ts.infradead.org>, "linux-kernel"
> > <linux-kernel@...r.kernel.org>
> > CC: "Alvin Zhou" <alvinzhou@...c.com.tw>, leoyu@...c.com.tw, "Cheng Ming Lin" <chengminglin@...c.com.tw>
> > Gesendet: Dienstag, 12. August 2025 07:19:49
> > Betreff: [RFC] mtd: ubi: skip programming unused bits in ubi headers
>
> > From: Cheng Ming Lin <chengminglin@...c.com.tw>
> >
> > This patch prevents unnecessary programming of bits in ec_hdr and
> > vid_hdr that are not used or read during normal UBI operation. These
> > unused bits are typically already set to 1 in erased flash and do not
> > need to be explicitly programmed to 0 if they are not used.
> >
> > Programming such unused areas offers no functional benefit and may
> > result in unnecessary flash wear, reducing the overall lifetime of the
> > device. By skipping these writes, we preserve the flash state as much
> > as possible and minimize wear caused by redundant operations.
>
> We talk about programming a single (sub)page, right?

Since the UBI header is mainly written into a single page, the "unused
areas" here refer to the space within a single (sub)page that is outside
the header content.

>
> > This change ensures that only necessary fields are written when
> > preparing UBI headers, improving flash efficiency without affecting
> > functionality.
>
> I have been told that writing 0xFF bytes to NAND should be avoided.
> This is also why UBI initializes them to 0x00.

Normally, after a NAND flash block is erased, all bits are in the 0xFF
state. Programming 0xFF in this case will not actually change the NAND
cells, as the device can inhibit programming—either by raising the
bitline voltage or using a self-boosted program inhibit mechanism.
Therefore, programming 0xFF is a normal and harmless operation for NAND
flash.

>
> Do you have data which proves the opposite?

I am currently collecting relevant data, and will present it once it is
ready. Thank you.

>
> Thanks,
> //richard

Thanks,
Cheng Ming Lin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ