Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751297AbbEGD1W (ORCPT ); Wed, 6 May 2015 23:27:22 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:35121 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750773AbbEGD1V (ORCPT ); Wed, 6 May 2015 23:27:21 -0400 Date: Wed, 6 May 2015 20:27:12 -0700 From: Brian Norris To: Jonas Gorski Cc: Ben Shelton , MTD Maling List , David Woodhouse , "linux-kernel@vger.kernel.org" , Jeff Westfahl Subject: Re: [PATCH] mtd: Introduce CONFIG_MTD_RESERVE_END Message-ID: <20150507032712.GA6055@norris-Latitude-E6410> References: <1430335682-6174-1-git-send-email-ben.shelton@ni.com> <20150429214648.GF32500@ld-irv-0074> <20150430173659.GA30177@bshelton-desktop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1989 Lines: 45 On Fri, May 01, 2015 at 01:57:13PM +0200, Jonas Gorski wrote: > On Thu, Apr 30, 2015 at 7:36 PM, Ben Shelton wrote: > > 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. > > Wouldn't it make more sense to make cmdlineparts to recognize if it is > run on a nand flash that has on-flash BBT enabled, and then reduce the > SIZE_REMAINING partition's size by the amount of nand_bbt_descr's > maxblocks * erase block size? That's a possibility, but that seems like a bit too much hidden policy to add on top of the cmdlineparts format, which is pretty precise. A better improvement, if you're dead set on using cmdlineparts rather than some other better parser, might be to support something like: mtdparts=name:-(main),bbt(1M) So the "remaining space" partition will allow for following partitions. IOW, you would need to handle this case, which is currently an error: /* test if more partitions are following */ if (*s == ',') { if (size == SIZE_REMAINING) { printk(KERN_ERR ERRP "no partitions allowed after a fill-up partition\n"); return ERR_PTR(-EINVAL); } ... } > Currently your proposed solution would break if boards have differing > erase block sizes, or if some have NOR flash, which makes it an option > for a rather narrow use case IMHO. Yeah, consider this a NAK for the current patch. Brian -- 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/