Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758471AbbDWXcc (ORCPT ); Thu, 23 Apr 2015 19:32:32 -0400 Received: from a.ns.miles-group.at ([95.130.255.143]:65275 "EHLO radon.swed.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754504AbbDWXcb (ORCPT ); Thu, 23 Apr 2015 19:32:31 -0400 Message-ID: <55398109.5080601@nod.at> Date: Fri, 24 Apr 2015 01:32:25 +0200 From: Richard Weinberger User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Iwo Mergler , Josh Cartwright CC: Ben Shelton , "dwmw2@infradead.org" , "computersforpeace@gmail.com" , "dedekind1@gmail.com" , "adrian.hunter@intel.com" , "linux-mtd@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "punnaiah.choudary.kalluri@xilinx.com" , "xander.huff@ni.com" Subject: Re: Adding subpage support to NAND driver -- backwards compatibility concerns References: <20150422172944.GA4134@bshelton-desktop> <20150423183957.GR27115@jcartwri.amer.corp.natinst.com>,<5539486F.60407@nod.at> In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2089 Lines: 50 Am 24.04.2015 um 01:13 schrieb Iwo Mergler: > On Fri, 24 Apr 2015 05:30:55 +1000 > Richard Weinberger wrote: > >> Am 23.04.2015 um 20:39 schrieb Josh Cartwright: > >>> Is there no metadata in the UBI data structures in flash that >>> indicate the min IO boundary? Assuming no, is another option to, >>> at the time of attach, try both the min IO access size, and, if >>> that doesn't work, try the page size? >> >> Correct. UBI has no information about that. >> If you add subpage support to the driver I'd make it opt-in such that >> existing setups won't break. > > I'm wondering, given that EC headers contain vid header offset > and data offset fields, shouldn't UBI be able to deduce at attach > time what the relevant parameters are on a partition? UBI double checks that offset. If the vid header offset does not match the run-time computed offset UBI will detect that in validate_ec_hdr(). So, yes it could automatically deduce it at attach time but it does not for safety reasons. UBI computes the values from the data provided by the MTD, if the image does not match it stops. If it would blindly trust the image it could happen that you operate on your MTD with a wrong page size. > Something along the lines of using the parameters of the first > PEB with valid EC header, then balking if another EC header is > encountered with different info. As long as MTD allows the > so deduced minimum access size, it seems safe. > > This could help enormously in situations like this, where > MTD drivers experience sudden bursts of improvement. Agreed. UBI could be more intelligent. If UBI can be sure that the parameters deduced from the on-flash image are safe with respect to the parameters provided by MTD it could continue. Maybe Artem can give us more details on that as he designed it. Thanks, //richard -- 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/