Received: by 10.192.165.156 with SMTP id m28csp148658imm; Tue, 17 Apr 2018 07:56:52 -0700 (PDT) X-Google-Smtp-Source: AIpwx49xlPl0nnahNBemAPJfYyCqkm9dhcw+PjE2dP1R9oDJo07Vx1QZgqh36/q+5g53GxWtite5 X-Received: by 10.167.129.10 with SMTP id b10mr2289314pfi.186.1523977012667; Tue, 17 Apr 2018 07:56:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523977012; cv=none; d=google.com; s=arc-20160816; b=qxjkERMDEX/eclDAuN5/I2GfmK3gTxNAQ1yBKItAQyxQCH787JB8DzW67KktVFgrjM efesM8CdAVYvhNl8AV1QBwnk24eUtNNgH4iGlOOapGErwaSA/N183J7nszwyqZ/oBqVo 38V8BWiXFrLfJ4i6zycpOfGhWtjP+9kS0TB4DtE5asTtlh8im/HPgwwgkLK044Z8V7oJ SF9B5fsnqkP+4w9dWsIt4jSTDjJ5LuT3hkn+Q4jgEoF0XxcTUCqMTODkDcIm6JN2fByN 72qytfdtkgm/6QbLd1JPQayfeG4zGFk5rRcsnHPm3ZLN+dqx+8AclYmtI2lWp2it3WV4 BE4Q== 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=jTmK0v/IbQ9AQrwT0td8AWbFnPo/3zf7of9soZ7sPlE=; b=lxDr24QghXYT9Qmxw4tLfMRMYRnzZoTvDUK30NR5rmHWVSjm5KbJSf057C21Wt7BDb IydbwIzMkivujlgh/a3Cm06Em1rzH5g00cN3Y55kVaMzNayaU/BqhR2B0CSbLbOeE9H7 zs3nlWr3V5N1GEA6c8t74xmhJCKUeCd8CPWo+PZTJN2sqaS6abcbnDZ9yvmd+VUa7jYs oosvi1POwQlV55pzAr5YC4NK/o/P6rQtMpoamGB7RQNypTUJab+Lv4V6UCH/NljBZrNK 7XV88gm97vJnCbUyfv3uVtCW2eS7lEkPC+GRrLhh/dpcIIDeIISVlGVZLpwcEKAdCmlv mEIQ== 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 r17si12536947pfh.15.2018.04.17.07.56.37; Tue, 17 Apr 2018 07:56:52 -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 S1752703AbeDQOyw (ORCPT + 99 others); Tue, 17 Apr 2018 10:54:52 -0400 Received: from smtp1-g21.free.fr ([212.27.42.1]:22542 "EHLO smtp1-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751836AbeDQOyv (ORCPT ); Tue, 17 Apr 2018 10:54:51 -0400 Received: from avionic-0020 (unknown [80.151.56.191]) (Authenticated sender: albeu@free.fr) by smtp1-g21.free.fr (Postfix) with ESMTPSA id 301E8B0055E; Tue, 17 Apr 2018 16:54:23 +0200 (CEST) Date: Tue, 17 Apr 2018 16:54:20 +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: <20180417165420.423a691b@avionic-0020> In-Reply-To: <344e0087-7410-aebb-8a66-c6976064df10@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> 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_/00OHJ=59GszSgSCM9WZWFKb"; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Sig_/00OHJ=59GszSgSCM9WZWFKb Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Tue, 17 Apr 2018 13:54:07 +0100 Srinivas Kandagatla wrote: > On 24/03/18 23:24, Alban Bedel wrote: > > Having the cells as subnodes of the provider device without any > > compatible property might clash with other bindings. To avoid this > > problem update the binding to have all the cells in a 'nvmem-cells' > > subnode with a 'nvmem-cells' compatible string. This new binding > > guarantee that we can turn any kind of device in a nvmem provider. > >=20 > > While discouraged for new uses the old scheme is still supported for > > backward compatibility. =20 >=20 > Am not sure if this a really good idea to change nvmem bindings based on= =20 > provider requirements. This can be a beginning of other problems!! I think you misunderstood something here, this proposed new binding would be for all new nvmem bindings, not just mtd backed nvmem. > Did you know that we can pass nvmem cells info via nvmem config ? >=20 > Why can't mtd-nvmem provider populate the nvmem_config->cells from > its dt "nvmem-cells" subnode before it registers the provider? The DT based lookup of nvmem-cells doesn't use nvmem_config->cells, so that's not an option. In fact here the problem come from the MTD side because it also had a similar binding using subnodes without compatible string. Just to make things clear, here is an example of the clash using the current nvmem binding on an unpartitioned MTD device: flash@0 { #address-cells =3D <1>; #size-cells =3D <1>; compatible =3D "s25sl064a"; reg =3D <0>; calibration: calib@404 { reg =3D <0x404 0x10>; }; }; This will not only allow reading the calibration data from nvmem, but will also create a partition on the MTD device, which is not acceptable. 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>; }; }; }; Which would work fine as the MTD code will ignore the nvmem-cells subnode thanks to its compatible string. IMHO subnodes without any compatible properties should never be used in such generic bindings, as it is very likely that it will at some point clash with another generic binding or with a device specific binding. Alban --Sig_/00OHJ=59GszSgSCM9WZWFKb Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJa1gqdAAoJEHSUmkuduC28wiQQAN81pxiNZy1GBNnelz+TqmWz QoQqmaiwcBDs0/H0Dnx01Kwo5mUFTQW++GP0Ae2ybdNF5ONFBesTYzhA7FB1Ew7e z9IdDJVhco5zgINFlc8gdvtfHAMkif407hGDt3c0rZoE7Se+93H6oEEZXBERIg36 96xlzzctk0FRSx5vFRYXcKdf+2EQn3KBm5ni/Q1WnMgqHY6A7hjNEFzWjpbySSIO iAdX7D3zU/+wd8rr+PBTVbt3zdOgO/W92tUFWPwtw37AjEr74NavZ2hidK/XUJfp qPubryYr+Iuye6uhIbn/Fu4BE/zGHO2BqBRsLxd3BKSkys4ver7BJiu73WEwZpNt 9swIG7yNQtC/ZJytCspEn8K+BM3NgPTDSR8bjbg9NdHmuWONRhQTD1rxqz79pSWl +xj5ZqTco8uZh6/V3XNvlbswYX7HRGWS0pUmAm5eOw40mfTDyo9dRZcAsnM96nSy 37W4JtQ6sC442MtR9FXPG3tYjhoG2rTl6w13j7hNf5MfEvzcLKmDH75mmxu6YE8P lKhZdSabrDPuGc1n3X7jbUQ3dQ7vEaqC3A3XYZ2xemVNbYp3Hb30R4hldmuIgABb bPPB+7aHF7uh27aJusfkrBAAV/bcR8IIYTGbi2Yd/d27Wo2xYAHZLhG3K044Pih1 2Or0U4M0QyWAgiA4TFN4 =DCd6 -----END PGP SIGNATURE----- --Sig_/00OHJ=59GszSgSCM9WZWFKb--