Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751969AbbD3Rhe (ORCPT ); Thu, 30 Apr 2015 13:37:34 -0400 Received: from skprod2.natinst.com ([130.164.80.23]:42787 "EHLO ni.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750878AbbD3Rhc (ORCPT ); Thu, 30 Apr 2015 13:37:32 -0400 Date: Thu, 30 Apr 2015 12:36:59 -0500 From: Ben Shelton To: Brian Norris Cc: dwmw2@infradead.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Jeff Westfahl Subject: Re: [PATCH] mtd: Introduce CONFIG_MTD_RESERVE_END Message-ID: <20150430173659.GA30177@bshelton-desktop> References: <1430335682-6174-1-git-send-email-ben.shelton@ni.com> <20150429214648.GF32500@ld-irv-0074> MIME-Version: 1.0 In-Reply-To: <20150429214648.GF32500@ld-irv-0074> User-Agent: Mutt/1.5.21 (2010-09-15) X-MIMETrack: Itemize by SMTP Server on US-AUS-MGWOut2/AUS/H/NIC(Release 8.5.3FP6|November 21, 2013) at 04/30/2015 12:37:08 PM, Serialize by Router on US-AUS-MGWOut2/AUS/H/NIC(Release 8.5.3FP6|November 21, 2013) at 04/30/2015 12:37:08 PM, Serialize complete at 04/30/2015 12:37:08 PM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2015-04-30_05:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2323 Lines: 50 Hi Brian, On 04/29, Brian Norris wrote: > > + This can be useful if, for example, the BBT is stored at the end > > + of the flash, and you don't want those blocks counted as part of > > + the last MTD partition. > > And why is that a problem? We don't add Kconfig options just because you > "don't want" something. It's not a "problem" per se, but it does cause the calculated/displayed number of bad PEBs to be greater than it actually is. In older kernel versions, this used to cause a warning on mount that it could not reserve enough PEBs, but this no longer occurs. Without the patch and config setting: UBI: attached mtd3 (name "root", size 942 MiB) to ubi1 UBI: PEB size: 131072 bytes (128 KiB), LEB size: 129024 bytes UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 512 UBI: VID header offset: 512 (aligned 512), data offset: 2048 UBI: good PEBs: 7539, bad PEBs: 4, corrupted PEBs: 0 UBI: user volume: 1, internal volumes: 1, max. volumes count: 128 UBI: max/mean erase counter: 549/79, WL threshold: 4096, image sequence number: 0 UBI: available PEBs: 4, total reserved PEBs: 7535, PEBs reserved for bad PEB handling: 156 With the patch and config setting: UBI: attached mtd3 (name "root", size 942 MiB) to ubi1 UBI: PEB size: 131072 bytes (128 KiB), LEB size: 129024 bytes UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 512 UBI: VID header offset: 512 (aligned 512), data offset: 2048 UBI: good PEBs: 7539, bad PEBs: 0, corrupted PEBs: 0 UBI: user volume: 1, internal volumes: 1, max. volumes count: 128 UBI: max/mean erase counter: 549/79, WL threshold: 4096, image sequence number: 0 UBI: available PEBs: 0, total reserved PEBs: 7539, PEBs reserved for bad PEB handling: 160 The reason for doing this as a Kconfig option rather than with an additional partition is that we use the same .itb boot image (and kernel arguments) for a series of embedded controllers that have different NAND flash sizes, and we use the '-' command line parameter to give the root partition all the available space after the other partitions. Thanks, Ben -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/