From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from galois.linutronix.de ([2001:470:1f0b:1c35:abcd:42:0:1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1RcvOk-0008AU-Un for linux-mtd@lists.infradead.org; Tue, 20 Dec 2011 08:50:13 +0000 Message-ID: <4EF04C33.7060805@linutronix.de> Date: Tue, 20 Dec 2011 09:49:55 +0100 From: Sebastian Andrzej Siewior MIME-Version: 1.0 To: Brian Norris Subject: Re: [PATCH v2] mtd: nand: write bad block marker even with BBT References: <1324332231-30884-1-git-send-email-computersforpeace@gmail.com> In-Reply-To: <1324332231-30884-1-git-send-email-computersforpeace@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Randy Dunlap , Baruch Siach , Dan Carpenter , Nicolas Ferre , Dominik Brodowski , Barry Song , Gabor Juhos , linux-mtd@lists.infradead.org, Jonas Gorski , Jamie Iles , Ivan Djelic , Robert Jarzmik , David Woodhouse , Maxim Levitsky , Dmitry Eremin-Solenikov , Kevin Cernekee , Kulikov Vasiliy , Jim Quinlan , Andres Salomon , Axel Lin , Anatolij Gustschin , Mike Frysinger , Arnd Bergmann , Lei Wen , Sascha Hauer , Sukumar Ghorai , Artem Bityutskiy , Florian Fainelli , Peter Wippich , Matthieu CASTET , Kyungmin Park , Shmulik Ladkani , Wolfram Sang , Chuanxiao Dong , Joe Perches , Guillaume LECERF , Roman Tereshonkov , Adrian Hunter List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On 12/19/2011 11:03 PM, Brian Norris wrote: > Currently, the flash-based BBT implementation writes bad block data only > to its flash-based table and not to the OOB marker area. Then, as new > bad blocks are marked over time, the OOB markers become out of date and > the flash-based table becomes the only source of current bad block > information. This can be a problem when: > > * bootloader cannot read the flash-based BBT format > * BBT is corrupted and the flash must be rescanned for bad > blocks; we want to remember bad blocks that were marked from Linux > > In an attempt to keep the bad block markers in sync with the flash-based > BBT, this patch changes the default so that we write bad block markers > to the proper OOB area on each block in addition to flash-based BBT. > > Theoretically, the bad block table and the OOB markers can still get out > of sync if the system experiences a power cut between writing the BBT to > flash and writing the OOB marker to a newly-marked bad block. However, > this is a relatively unlikely event, as new bad blocks shouldn't appear > frequently. > The marker and BBT may get out of sync. You should use either the one _or_ the other but not both. Why use both anyway? I use BBT because I have no room left in OOB or updating a single area in OOB is too complicated / hardly possible. In the former case, reading that area again and interpreting it as something as it was once is a bad thing. Why is the BBT corrupted? You have two tables. If one is broken you have still the other. If you lose one block which was about to be marked bad you find soon enough. Sebastian