Received: by 10.192.165.156 with SMTP id m28csp1176732imm; Wed, 18 Apr 2018 05:34:38 -0700 (PDT) X-Google-Smtp-Source: AIpwx48c+jcFBSNK7O7gVZ8zwMhsns604O7y0OM3Lw94F91HjDRSek4QglYnqiulK0c5nPeGsxgw X-Received: by 10.99.114.80 with SMTP id c16mr1584067pgn.385.1524054878249; Wed, 18 Apr 2018 05:34:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524054878; cv=none; d=google.com; s=arc-20160816; b=AtC8LkeDm7jRDCgTZ8B2HO1OtDTMx0uUkAjSCAFP+V7/Ah0EjXa8NOXK4sjBHNru7Q l2NcT4sxh/c8KQGdmNEdVQyyohCuJWp1HS69PQrUZH7SHDWUEErMwjt7oP7owko4Y1tO NdsnjYUHEbyIg2MBE0PGUbUFHidyb4H2Cl3ITuAHUiAvV1DJAXJ3Umz8UlEWVjc9jBkS +k0ZObyfPS69YVib3Wt7SDcdkEjGTx/6wOHeaGL+xqpT5IUQ+B8763F5K2eF41B3obOG yZcQC1J7S7UR5XJtxTVXzjeyaB8du5gOcMNF+mc3BBvOfH02tnPjISjVnF2AaNq/kwQO glUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:arc-authentication-results; bh=aWUtp90vr4hMbTZ5fjcGXnK8cbMEuLM1qDHSS8wKRws=; b=zEIGV9rsunFUcusHuguaNIRrZs7GMOCIR65SUMPE6hTaHLoWNHILiPwDgD4bNALtxm sa3QNEAHT6yK1CYBOHav7gppuxC4G8raFYojfjhUQ2XTt6U15YjqALRkCEsLroZvj2I3 bZbwJM19lxIoG7cWmkV/xLvtIYNVO1crzMemkiajby0K7M98SA3CnPEWLuPhVvTeRHOX Wc06PZnjeNDatDI6lF30pHLHHUew69RtA82Ni+KEkwlN/9b/kOLXWxUg/Y9V8xE66HrS I2bpYJHAxrfGZ+CAc/TCShkj/vExqPzn+YcewSLUXwUDj244VlebcXM0frroMATSKMhn HVVQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j11si970182pgv.640.2018.04.18.05.34.23; Wed, 18 Apr 2018 05:34:38 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753819AbeDRMdP (ORCPT + 99 others); Wed, 18 Apr 2018 08:33:15 -0400 Received: from smtp1-g21.free.fr ([212.27.42.1]:47968 "EHLO smtp1-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752027AbeDRMdO (ORCPT ); Wed, 18 Apr 2018 08:33:14 -0400 Received: from avionic-0020 (unknown [80.151.56.191]) (Authenticated sender: albeu@free.fr) by smtp1-g21.free.fr (Postfix) with ESMTPSA id E1D87B004EC; Wed, 18 Apr 2018 14:32:45 +0200 (CEST) Date: Wed, 18 Apr 2018 14:32:43 +0200 From: Alban To: Srinivas Kandagatla Cc: Alban , linux-kernel@vger.kernel.org, Rob Herring , Mark Rutland , David Woodhouse , Brian Norris , Boris Brezillon , Marek Vasut , Richard Weinberger , Cyrille Pitchen , devicetree@vger.kernel.org, linux-mtd@lists.infradead.org Subject: Re: [PATCH v3 1/3] nvmem: Update the OF binding to use a subnode for the cells list Message-ID: <20180418143243.3c23493c@avionic-0020> In-Reply-To: <9f7d2987-b33e-79b5-ae58-2985fd7334e4@linaro.org> References: <1521933899-362-1-git-send-email-albeu@free.fr> <1521933899-362-2-git-send-email-albeu@free.fr> <344e0087-7410-aebb-8a66-c6976064df10@linaro.org> <20180417165420.423a691b@avionic-0020> <8c4b48ad-e99e-030a-a4ee-b6df0fa59c79@linaro.org> <20180417180040.04f53495@avionic-0020> <20180418134119.2e587621@avionic-0020> <9f7d2987-b33e-79b5-ae58-2985fd7334e4@linaro.org> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/qRNXTY2_RtgSGW0qHQjEJ5b"; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Sig_/qRNXTY2_RtgSGW0qHQjEJ5b Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Wed, 18 Apr 2018 13:12:48 +0100 Srinivas Kandagatla wrote: > On 18/04/18 12:41, Alban wrote: > > On Tue, 17 Apr 2018 18:00:40 +0200 > > Alban wrote: > > =20 > >> On Tue, 17 Apr 2018 16:44:01 +0100 > >> Srinivas Kandagatla wrote: > >> =20 > >>> Thanks for explaining, > >>> > >>> On 17/04/18 15:54, Alban wrote: =20 > >>>> This will not only allow reading the calibration data from nvmem, but > >>>> will also create a partition on the MTD device, which is not accepta= ble. > >>>> With my proposed binding this would become: > >>>> > >>>> flash@0 { > >>>> #address-cells =3D <1>; > >>>> #size-cells =3D <1>; > >>>> compatible =3D "s25sl064a"; > >>>> reg =3D <0>; > >>>> > >>>> nvmem-cells { > >>>> compatible =3D "nvmem-cells"; > >>>> #address-cells =3D <1>; > >>>> #address-cells =3D <1>; > >>>> > >>>> calibration: calib@404 { > >>>> reg =3D <0x404 0x10>; > >>>> }; > >>>> }; =20 > >>> > >>> Why can't we make nvmem-cells node a nvmem provider in this case? > >>> Which should work! =20 > >> > >> TBH I just copied what have been done to fix the same problem with the > >> MTD partitions. But yes we could also just extend the current binding > >> to require a compatible string on each nvmem-cell, which would not > >> require any code change to support. =20 > >=20 > > However this scheme will not work if the device node binding already > > have subnodes with addresses. The addressing, as specified by > > #address-cells and #size-cells, might be incompatible or might overlap. > > Using the nvmem-cells subnode solve this problem. > > =20 >=20 > I was also suggesting you to use nvmem-cell subnode, but make it a=20 > proper nvmem provider device, rather than reusing its parent device. >=20 > You would end up some thing like this in dt. >=20 > flash@0 { > #address-cells =3D <1>; > #size-cells =3D <1>; > compatible =3D "s25sl064a"; > reg =3D <0>; >=20 > nvmem-cells { > compatible =3D "mtd-nvmem"; > #address-cells =3D <1>; > #size-cells =3D <1>; >=20 > calibration: calib@404 { > reg =3D <0x404 0x10>; > }; > }; > }; But the root cause is in the nvmem binding, this conflict could exists with any device type, not just MTD. I don't understand why we would want such workarounds instead of just fixing the problem once and for all. Alban --Sig_/qRNXTY2_RtgSGW0qHQjEJ5b Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJa1zrsAAoJEHSUmkuduC28Q0cQAKQdYP/RHd/RrlAkHhAMFwBM 1lGLrNYd2ob3AzA5Xa/JvpRrYHCj3YNYktT9T2nrEaoXeCDPKqCnZQOBUm6h4UH3 R4YvfcPxbk8ZcDJ3hcymaVuF7ol544u53a1PPwOMJWcmHJ0D/u8FP4fkilFlvKYA SsJZtKb9Gi7ja7p9ZKB3xmfuQQImLem4WxVuopGvKwKm4J83J3wge8Xic/nYV1kP zMG+ZMzOvfcGToZSn/0l+2y/Y8Weg5vf/quDAgc6qk6zKSird7+f+EEZZ1OOfS3M BuoHizAsurZvU/QiwvMnE2VJUdTTcuZfDVv++VoyFPIDkGiuzphx2COBHLCQFqEq ywiN9QWjLPa5uh6I4OfDsnnfZCgVG1IbgmKcxNpc12my0hS/0U6tqs7ucJMX+7Iw WfKs6ttf4Y+pOxJK/e4RZ9tiyUeK6aDLWRVuVavgNrAh0dTHtb/XTao1P/JfMqP4 shsqkWRkx06C17ghBI11HnsSzpVM3DfYcpDuRpkk0MRtm1qF698TjH/HGZ/3iOCj gZqQVrKr690AMpT0etdTR46W1Nz5kAXP+IzL5oSfUkYM8jPK8Ub6X29aZglbNcdM RiSiMiF4JD3mrcIJ7qy4nFsmKXfiy7hqTcREvZOCzH+BZEKxJDLOcW+UY0nEs29a AlzkOVuaZsa2Spxh8iDa =uFJx -----END PGP SIGNATURE----- --Sig_/qRNXTY2_RtgSGW0qHQjEJ5b--