Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3237071pxb; Mon, 16 Nov 2020 09:09:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJxMnJdJ9aJh1glOfjTIW9PjdOlhQbl2HtwVenwHgut/uqjWiAg2kiP5jl75NT46jYFqBhWU X-Received: by 2002:a05:6402:308b:: with SMTP id de11mr16735164edb.5.1605546591873; Mon, 16 Nov 2020 09:09:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605546591; cv=none; d=google.com; s=arc-20160816; b=NiAX8fZwBj4HbjUpvSlSaxxdUA9yFHTIEeH0tw6HMNkFqJUhX6ZdSHKV6ufYM2NEBc gcuXhC3mO1E6ls/M6UdIwgCAXoWrJoGy7glFVhADensZ6tGykrRiB1TXImmKb4+kS6i3 BPQTgfsU9ge1eLtXyKQqHwKSPeaQgpDOOmSP7YnRFQZRwDpbEyHXMvEc5DxImYZUnS/O EgOsU/H/ZoVQYAZ3MIgrz2JkRVqdW/KgQjAyibo3Wh+sePq/eOto10dxMdKkxvb0sDAk R+UNOuYffs90mSARNBw6lrwgBnBj+cRBlq0uVy/MrqMIWCS4rE2R+B5m3CEUcFK1czx/ Mi6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:references:cc :to:from:subject; bh=/GfGz8jujWEbZOaw+sNjjiPCVu/zWMIHU1h8IK2dIjA=; b=shV4LbIWbXFVjoHOGguVvuIvJZ72yPvto4/CSaXAGCYahvqAPKsuJMpLxN6yqFbLdn 1N8yFDNyA9kdyQn5UMchSpDyn/Z/s5AGMg2WmhAUht2lkg+EeDgqWAKflRaGqCWCtqVP a/gKOrioOUaEb0OPBVGWD/qGQ0e72PJRdn+iHyctYyPRkJ/fJtnB5zfdAFsJqgBPhQ3D RC42POMbvVCnxM9YLJ5eXhWNnUjv3DKwiQiPqUk7nZa25fy6z5FXzo6vIrH1z+GPpB5n uxtR+pLYwklmahmF9KgtzmNL5IAcznv3yR3/pHisy8IGt9NrjfVlV/ps2AL+eXMjbN5r Jn0A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z96si7909555ede.180.2020.11.16.09.09.26; Mon, 16 Nov 2020 09:09:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731668AbgKPREb (ORCPT + 99 others); Mon, 16 Nov 2020 12:04:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726236AbgKPREa (ORCPT ); Mon, 16 Nov 2020 12:04:30 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63C8CC0613CF for ; Mon, 16 Nov 2020 09:04:30 -0800 (PST) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=[IPv6:::1]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1kehvX-0000mC-Qt; Mon, 16 Nov 2020 18:04:27 +0100 Subject: Re: [PATCH v3 0/2] nvmem: skip nodes with compatibles other than "nvmem-cell" From: Ahmad Fatoum To: Rob Herring , Srinivas Kandagatla Cc: devicetree@vger.kernel.org, ceggers@arri.de, linux-kernel@vger.kernel.org, kernel@pengutronix.de References: <20200428111829.2215-1-a.fatoum@pengutronix.de> <20200512141834.GA3023@bogus> <3f050e96-8bd3-a77e-b1cf-1739a1be0c2d@pengutronix.de> Message-ID: Date: Mon, 16 Nov 2020 18:04:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 MIME-Version: 1.0 In-Reply-To: <3f050e96-8bd3-a77e-b1cf-1739a1be0c2d@pengutronix.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: a.fatoum@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Rob, Hello Srini, On 02.11.20 16:23, Ahmad Fatoum wrote: >>> I think instead, nvmem cells should be contained within a partition. >>> The partition should then have a compatible to indicate it contains >>> nvmem cells. >> >> I thought I had understood what needs to be done, but now that I finally have time >> to do it, I see that this only solves the second issue "extending the NVMEM binding >> to nodes that already have other child nodes, e.g., MTD and its partitions". >> >> The first issue: "future extension of e.g. eeprom nodes by any child nodes other than >> nvmem cells" isn't solved by having a containing partition. >> >> >> My issue is that the bootloader fixes up a partitions { compatible = "fixed-partitions"; } >> child node into the kernel device tree. The NVMEM core driver tries to parse all eeprom child >> nodes as cells and will make the driver probe of the EEPROM fail, because it can't parse that >> fixed-partitions node as a nvmem cell. >> >> To allow for co-existence of NVMEM cells and other subnodes, would following patch be >> acceptable to you and Srini? > > Gentle ping. Would the patch below be acceptable? Did you have time to look at this? > >> >> ---------------------------------------- 8< -------------------------------------- >> --- a/Documentation/devicetree/bindings/nvmem/nvmem.yaml >> +++ b/Documentation/devicetree/bindings/nvmem/nvmem.yaml >> @@ -45,7 +45,15 @@ properties: >> patternProperties: >> "^.*@[0-9a-f]+$": >> type: object >> - >> + if: >> + not: >> + properties: >> + compatible: >> + then: >> + $ref: "#/definitions/nvmem-cell" >> + >> +definitions: >> + nvmem-cell: >> properties: >> reg: >> maxItems: 1 > > Cheers, > Ahmad > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |