From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.newsguy.com ([74.209.136.69]) by casper.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Sp04q-0002uC-Kq for linux-mtd@lists.infradead.org; Wed, 11 Jul 2012 16:47:49 +0000 Message-ID: <4FFDADFC.5020503@newsguy.com> Date: Wed, 11 Jul 2012 09:46:52 -0700 From: Mike Dunn MIME-Version: 1.0 To: Brian Norris Subject: Re: MLC NAND: all 0xff after erase? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Artem Bityutskiy , Richard Weinberger , Kevin Cernekee , Jim Quinlan , linux-mtd@lists.infradead.org, Al Viro , Joel Reardon , ivan.djelic@parrot.com, David Woodhouse , Shmulik Ladkani List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , > * My NAND controller's HW ECC flags these erased-page bitflips as > uncorrectable errors, as there was no ECC written to the page and the > read data does not match the 0xff special "erased" case. I assume most Ditto for the newer diskonchips... > other ECC mechanisms would treat this similarly [2]. In such cases, I > suspect that the best the driver can do is to return the raw data > (0xff with flips) and an ECC error message. > > * UBI and other FS layers need to distinguish between: (a) 0xff > cleanly-erased, (b) 0xff with bitflips, and (c) true ECC errors. In > the end, we may treat (a) and (b) the same (as erased pages), but the > problem is distinguishing between (b) and (c). To distinguish between (b) and (c), the docg4 driver dedicates an unused oob byte as a "page written" flag. This byte is cleared whenever the page is written. When uncorrectible bitflip errors occur, if more than half of the bits in this flag are set, the page is assumed to be blank, but with bitflips. In this case the driver quietly ignores the ecc error, but returns the blank page data with the bitflips. Not a complete solution, and also specific to one particular driver, but food for thought. This scheme was actually suggested by Ivan Djelic. Mike