From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D8CD2C38142 for ; Tue, 24 Jan 2023 08:58:24 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A9CD08539D; Tue, 24 Jan 2023 09:58:22 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=bootlin.com header.i=@bootlin.com header.b="Rp4CuqMK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 845C2855B7; Tue, 24 Jan 2023 09:58:20 +0100 (CET) Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 615BD8539D for ; Tue, 24 Jan 2023 09:58:17 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=miquel.raynal@bootlin.com Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id D2E3C2000A; Tue, 24 Jan 2023 08:58:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1674550697; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jmnZsk65JXvZp7Rqk/PIKewJPv7ymgmrcWlk8yB8Rk0=; b=Rp4CuqMKc/DI3sotU7/qZPA/Mpe6vEVXRdwcgTngtFj2HTLtIfmXlhqtbNDPhWltXRcreH fDdbltlI501EfS804VtpUOvPUKpiDgok8G4XAOlVz1DYTM5m3RwAs9mVntSNpCToqKp9Pv X3lfLyyVCerl4HIlyNmHb17NPdoYqakvh5eImsfeVz9L2R9mXiwABpNCp2XuubdGDlNBkV 6hAxWjmLMZtOdfY1b//LMQl3qgntg2luimBxPJMNX34X5LoykVcwiYx0oSKMvHkyTjv5bE nWF1/B8aN6aEvtoeXOCk5d8Bcx7LvJkqkBDmh2arY9/xfgoFF54TnEnmIHl63g== Date: Tue, 24 Jan 2023 09:58:15 +0100 From: Miquel Raynal To: Francesco Dolcini Cc: Marek Vasut , Simon Glass , u-boot@lists.denx.de, Marcel Ziswiler , Francesco Dolcini , linux-mtd@lists.infradead.org Subject: Re: [PATCH v1 1/3] fdt: validate/fix cells count on mtdpart fixup Message-ID: <20230124095815.21d01af8@xps-13> In-Reply-To: References: <20230113184547.487322-1-francesco@dolcini.it> <20230113184547.487322-2-francesco@dolcini.it> <9ed3b4e4-7336-baf3-5a5a-8e77543e210d@denx.de> <06279fe3-a3b3-f3c4-276f-7cd0d4773875@denx.de> <0584cc0e-eacb-ce71-0317-27d10264d3bf@denx.de> <20230123105610.38034a11@xps-13> Organization: Bootlin X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Hi Francesco, francesco@dolcini.it wrote on Tue, 24 Jan 2023 09:41:41 +0100: > Hello Miquel, >=20 > On Mon, Jan 23, 2023 at 10:56:10AM +0100, Miquel Raynal wrote: > > marex@denx.de wrote on Tue, 17 Jan 2023 01:59:54 +0100: > > =20 > > > On 1/16/23 19:00, Francesco Dolcini wrote: =20 > > > > On Mon, Jan 16, 2023 at 06:54:44PM +0100, Marek Vasut wrote: =20 > > > >> On 1/16/23 15:20, Francesco Dolcini wrote: =20 > > > >>> On Sun, Jan 15, 2023 at 03:35:25PM +0100, Marek Vasut wrote: =20 > > > >>>> On 1/13/23 19:45, Francesco Dolcini wrote: =20 > > > >>>>> From: Francesco Dolcini > > > >>>>> > > > >>>>> Fixup #size-cells value when updating the MTD partitions, this = is > > > >>>>> required to prevent issues in case the MTD parent set #size-cel= ls to > > > >>>>> zero. > > > >>>>> This could happen for example in the legacy case in which the p= artitions > > > >>>>> are created as direct child of the mtd node and that specific n= ode has > > > >>>>> no children. Recent clean-up on Linux device tree files created= a boot > > > >>>>> regression on colibri-imx7. > > > >>>>> > > > >>>>> This fixup has the limitation to assume 32-bit (#size-cells=3D1) > > > >>>>> addressing, therefore it will not work with device bigger than = 4GiB. > > > >>>>> > > > >>>>> This change also enforce #address-cells to be the same as #size= -cells, > > > >>>>> this was already silently enforced by fdt_node_set_part_info(),= now this > > > >>>>> is checked explicitly and partition fixup will just fail in suc= h case. > > > >>>>> > > > >>>>> In general board should not generally need nor use this functio= nality > > > >>>>> and should be just deprecated, passing mtdparts=3D in the kerne= l command > > > >>>>> line is the preferred way according to Linux MTD subsystem main= tainer. =20 > >=20 > > Just to be clear, I'm perfectly fine with the partitions being either > > on the cmdline or in the DT without preference (well, the cmdline only > > works with the simple generic parser, but whatever). What I really > > meant is that tweaking the DT from U-Boot should be rare and in no case > > the "right thing to add partitions". =20 >=20 > Miquel, should I send a v2 to clarify the commit message or you do not > mind keeping it as it is? I think it is worth mentioning, also adding Tom's remark: - Describing the partitions on the cmdline or in the DT is the right thing to do. - Tweaking the DT to add static partitions should be forbidden. - In some rare legacy cases, dynamic changes to the partitions might be tolerated. Thanks, Miqu=C3=A8l