Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5491158ybl; Tue, 14 Jan 2020 09:47:50 -0800 (PST) X-Google-Smtp-Source: APXvYqwqMLPyfFefa/m4H379LAMBY5UcBPl15fsLSivd+FQFtDlUH94BmGvasomaXnJQdrhK8lGx X-Received: by 2002:aca:c30d:: with SMTP id t13mr17741868oif.166.1579024069914; Tue, 14 Jan 2020 09:47:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579024069; cv=none; d=google.com; s=arc-20160816; b=Pgmx1hq1lJN5V9wrJ4Y13IAlRW1zCEhx8x2UfenaseQ2ihlOKSRXvH+QePVXLDNPHH 3fOqC7gspEaL3aFtMxgO9KuhuB9xx8Ah1bxXD/7dl0Hiil7mcOWZbrTlWpsNDYdE2x7a CgsPRY3geniO5srwkU2QEYXF509VQ2Vrdbcxl5AExkKR1njp8yDihCh5/xKS0C2CZWwr ZLgTCfuHvURdmLilZg9AWULtAP8LrO67kmm6XA+jVyUsdh7d7dmj6qs3XvVC5yJAEHse D5rpkKQ4uOtfx3bydCMlGxsZVeAcbAg2jmPqVItnilAGKKivDG+k2gYkM1B8dRyfWU8s Y6FA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=9gDxEIAlwl61tPqeG0yd9dejKuxu4k6YTYIjc2r0Rwk=; b=qKGiHjO8nRu2Eob7e53URIHwBUeKqxINK3Gqw7pGv0F+4PwqiW/h4CxbDJGdvf5R3q dey946lvRQ2bbKXQzEPggMU0e17+NXdpp30JgtQProh7yADmGmAyy9PX5fhq0rb4joQO +da81uMrN3uH6iFG08ahAqFqEk3YFwIV0xPUXmcee012GZFXoBVJxmJSBCWV4iXKpw4R 5kQldChjkjmnx1SdBZEHo/HUaV5FNVUjcIQlgrkcLOmM02DEkMx0gru3lYhlp2Pche2a pZYAcdzgcYz/kQUzl5lTiRaSNAWMgllYglkfYJ+38ny9pFh2iGvmPn9IdUZ1yq11uXwM a8LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jO2fxggs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z1si8944461otp.70.2020.01.14.09.47.38; Tue, 14 Jan 2020 09:47:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jO2fxggs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728699AbgANRqc (ORCPT + 99 others); Tue, 14 Jan 2020 12:46:32 -0500 Received: from mail.kernel.org ([198.145.29.99]:53904 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726450AbgANRqb (ORCPT ); Tue, 14 Jan 2020 12:46:31 -0500 Received: from mail-qv1-f52.google.com (mail-qv1-f52.google.com [209.85.219.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D123C24681; Tue, 14 Jan 2020 17:46:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579023991; bh=mXc8/w8tY8RXyg7swtRyAC0oYcXKe+2puA+wT86utiY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=jO2fxggsWM5N6fDuJsQiwOrF47A7M0Zj6PjohQnWobjCR2xHQjoywTjQap5QCKX8p iEHdg2y8Kch7ICsK2mTl/kaCOS2AZf0wjHLqfkXREssRjYVgcCkJO3lxmKlNWts9AG dRkXSvn9hiTVctu5Dd87ETssj41Oqiq2Rxjbt8u4= Received: by mail-qv1-f52.google.com with SMTP id dc14so6037980qvb.9; Tue, 14 Jan 2020 09:46:30 -0800 (PST) X-Gm-Message-State: APjAAAXkpB4KgiaGNEqeW/iP84Opo/o+5MG/ssKz862MTnAqtXW4W8eB aiReoBGJYseiQ3afaSaf84gLbjvUqHw+uSHZrw== X-Received: by 2002:a0c:f68f:: with SMTP id p15mr17346460qvn.79.1579023989888; Tue, 14 Jan 2020 09:46:29 -0800 (PST) MIME-Version: 1.0 References: <20191127105522.31445-1-miquel.raynal@bootlin.com> <20191127105522.31445-5-miquel.raynal@bootlin.com> <20191209113506.41341ed4@collabora.com> In-Reply-To: <20191209113506.41341ed4@collabora.com> From: Rob Herring Date: Tue, 14 Jan 2020 11:46:18 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v5 4/4] mtd: Add driver for concatenating devices To: Boris Brezillon Cc: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Tudor Ambarus , Mark Rutland , MTD Maling List , Thomas Petazzoni , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" , Mark Brown , Paul Kocialkowski , Bernhard Frauendienst Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 9, 2019 at 4:35 AM Boris Brezillon wrote: > > On Wed, 27 Nov 2019 11:55:22 +0100 > Miquel Raynal wrote: > > > Introduce a generic way to define concatenated MTD devices. This may > > be very useful in the case of ie. stacked SPI-NOR. Partitions to > > concatenate are described in an additional property of the partitions > > subnode: > > > > flash0 { > > partitions { > > compatible = "fixed-partitions"; > > part-concat = <&flash0_part1>, <&flash1_part0>; > > > > part0@0 { > > label = "part0_0"; > > reg = <0x0 0x800000>; > > }; > > > > flash0_part1: part1@800000 { > > label = "part0_1"; > > reg = <0x800000 0x800000>; > > So, flash0_part1 and flash0_part2 will be created even though the user > probably doesn't need them? I don't follow? > > > }; > > }; > > }; > > > > flash1 { > > partitions { > > compatible = "fixed-partitions"; > > > > flash0_part1: part1@0 { > > label = "part1_0"; > > reg = <0x0 0x800000>; > > }; > > > > part0@800000 { > > label = "part1_1"; > > reg = <0x800000 0x800000>; > > }; > > }; > > }; > > IMHO this representation is far from intuitive. At first glance it's not > obvious which partitions are linked together and what's the name of the > resulting concatenated part. I definitely prefer the solution where we > have a virtual device describing the concatenation. I also understand > that this goes against the #1 DT rule: "DT only decribes HW blocks, not > how they should be used/configured", but maybe we can find a compromise > here, like moving this description to the /chosen node? > > chosen { > flash-arrays { > /* > * my-flash-array is the MTD name if label is > * not present. > */ > my-flash-array { > /* > * We could have > * compatible = "flash-array"; > * but we can also do without it. > */ > label = "foo"; > flashes = <&flash1 &flash2 ...>; > partitions { > /* usual partition description. */ > ... > }; > }; > }; > }; > > Rob, what do you think? I don't think chosen is the right place to put all the partition information. It's not something the bootloader configures. This suffers from the same issue I have with the original proposal. It will not work for existing s/w. There's only 1 logical partition that concatenated. The rest of the partitions shouldn't need any special handling. So we really only need some way to say 'link these 2 partitions into 1 logical partition'. Though perhaps one could want to combine any number of physical partitions into logical partitions, but then none of the proposals could support that. Then again, maybe that's a userspace problem like with disks. To throw out another option, what if the first device contains the complete partitions for both devices with some property in one or both devices pointing to the other device? That would make the partitions in the 1st device still accessible to existing s/w (unless it bounds checks the partitions). Rob