Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp686256pxf; Wed, 7 Apr 2021 09:10:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYgf0P+a9TsSZ1aBCgjXf7IrRarUKGZiR7oOaRdW3NvZKGEBlb/2iroUPPPM0mjlu+7aSZ X-Received: by 2002:a17:906:c9d8:: with SMTP id hk24mr4609062ejb.480.1617811816644; Wed, 07 Apr 2021 09:10:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617811816; cv=none; d=google.com; s=arc-20160816; b=NThxyF/we1dKP4fv11BtEWMtOAHUrN86FJqp/XPcA0afMQFLKQPWqngRgp0kUNswub pjNbeYcq2cvqVk+875+VAckfqI+ONbfZOwvKP3uKdXB509H3Pr0vfSFmu0+SzfMdpn8u fRT50sglVtQwEUpYovm8OymLJgP73ZvCYq+EtcGejpre5syLN5IFzAXw1a8/RD0uyDtb MEu71j3Hy2ldgREGrxT7cCKhjff5M7dkBZMAaMKdlS2VHgYyA2r3YcihuS10k1c0IzkV j6uukKdGM4lUbQbCHweRWZ87YeRUpir9XYNirq/s30SlyjDBh40Pj/6rXQ9DYabI8jRG eR1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=lzeGNRdWUJv2a1laWpy/LzDxaThmJOfkKyLxodeO5FE=; b=FKh2jsH1QeaZhYIMG/kFbyT+onw3C2TogtFYI/2wmF0OTPyahgfhkzwxjzNrCHT+fR R3r/nmmBwphWa9vZ20sX1D2w4WC6/2o+qOwMDivlhKRM2NryGWJnXkeQMfnnXDI0nQt6 lY96mdk83NVyUDYikQRY77WEwBV0KDn4w0OuV+5N08/u5R13iaipcrOBJoMzWTdAPgSH nZhbMJbkoB+G4Y5/+DTz9R6ByHbEuK+GIwDfVkmjmJVNFyyBoDO5wnqO1j1CMGWjXNvb 1TIEh5R9UUiY656yjSd9a8T/iblVduhij4gLO6AFjgzGmE062vgWMYLLJ6emj+fS6h5E uYRA== 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cq5si8819157edb.80.2021.04.07.09.09.51; Wed, 07 Apr 2021 09:10:16 -0700 (PDT) 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347550AbhDGAeU (ORCPT + 99 others); Tue, 6 Apr 2021 20:34:20 -0400 Received: from mail-ot1-f51.google.com ([209.85.210.51]:42773 "EHLO mail-ot1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242066AbhDGAeT (ORCPT ); Tue, 6 Apr 2021 20:34:19 -0400 Received: by mail-ot1-f51.google.com with SMTP id c24-20020a9d6c980000b02902662e210895so15937928otr.9; Tue, 06 Apr 2021 17:34:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=lzeGNRdWUJv2a1laWpy/LzDxaThmJOfkKyLxodeO5FE=; b=MG0IWwjhltZ5F6Rn6A4uxZ4GgcsX1y6RTL0W9g1ztOpIfsIAD9l+JF+0MsOJ7B6sd8 mP/apYVAYaeo2oIY1nDVpW71rcD+OjK0s/R5FusxWIWl3HlcZA3nnoLkbdFAChz0tmjZ FtdhUQ0b9OJk1rBcWX6cBWsgvGqm1QAF/8tNWqwyLeM5ZLMtLzwfPvlqkl8brr3B/wqs MTGgwWf+FJBausJpnOQ1uvTxKF8LYyj8hkpZHkGjzfoX6rfajguCFxudUmmN9WgHLiu6 SW/1ttm5lcdkT6g6XRG2FsHmoj6rm2xp7TXXz+Op2YrRVe07F3SBGvOfGJhUy0yf7evN vknQ== X-Gm-Message-State: AOAM5334xNFJZHeXSulY0if8JZylH6WmVuMWZM23XEiurPTLgL/H1mDa 3y3hjY6s3jITfbHkdrsOSA== X-Received: by 2002:a05:6830:2472:: with SMTP id x50mr629053otr.69.1617755651052; Tue, 06 Apr 2021 17:34:11 -0700 (PDT) Received: from robh.at.kernel.org (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.gmail.com with ESMTPSA id i17sm4947303ota.53.2021.04.06.17.34.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Apr 2021 17:34:09 -0700 (PDT) Received: (nullmailer pid 2558224 invoked by uid 1000); Wed, 07 Apr 2021 00:34:08 -0000 Date: Tue, 6 Apr 2021 19:34:08 -0500 From: Rob Herring To: Saravana Kannan Cc: Ilya Lipnitskiy , Frank Rowand , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , LKML , stable Subject: Re: [PATCH v2] of: property: fw_devlink: do not link ".*,nr-gpios" Message-ID: <20210407003408.GA2551507@robh.at.kernel.org> References: <20210405031436.2465475-1-ilya.lipnitskiy@gmail.com> <20210405222540.18145-1-ilya.lipnitskiy@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 06, 2021 at 04:09:10PM -0700, Saravana Kannan wrote: > On Mon, Apr 5, 2021 at 3:26 PM Ilya Lipnitskiy > wrote: > > > > [,]nr-gpios property is used by some GPIO drivers[0] to indicate > > the number of GPIOs present on a system, not define a GPIO. nr-gpios is > > not configured by #gpio-cells and can't be parsed along with other > > "*-gpios" properties. > > > > nr-gpios without the "," prefix is not allowed by the DT > > spec[1], so only add exception for the ",nr-gpios" suffix and let the > > error message continue being printed for non-compliant implementations. > > > > [0]: nr-gpios is referenced in Documentation/devicetree/bindings/gpio: > > - gpio-adnp.txt > > - gpio-xgene-sb.txt > > - gpio-xlp.txt > > - snps,dw-apb-gpio.yaml > > > > [1]: > > Link: https://github.com/devicetree-org/dt-schema/blob/cb53a16a1eb3e2169ce170c071e47940845ec26e/schemas/gpio/gpio-consumer.yaml#L20 > > > > Fixes errors such as: > > OF: /palmbus@300000/gpio@600: could not find phandle > > > > Fixes: 7f00be96f125 ("of: property: Add device link support for interrupt-parent, dmas and -gpio(s)") > > Signed-off-by: Ilya Lipnitskiy > > Cc: Saravana Kannan > > Cc: # 5.5.x > > --- > > drivers/of/property.c | 11 ++++++++++- > > 1 file changed, 10 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/of/property.c b/drivers/of/property.c > > index 2046ae311322..1793303e84ac 100644 > > --- a/drivers/of/property.c > > +++ b/drivers/of/property.c > > @@ -1281,7 +1281,16 @@ DEFINE_SIMPLE_PROP(pinctrl7, "pinctrl-7", NULL) > > DEFINE_SIMPLE_PROP(pinctrl8, "pinctrl-8", NULL) > > DEFINE_SUFFIX_PROP(regulators, "-supply", NULL) > > DEFINE_SUFFIX_PROP(gpio, "-gpio", "#gpio-cells") > > -DEFINE_SUFFIX_PROP(gpios, "-gpios", "#gpio-cells") > > + > > +static struct device_node *parse_gpios(struct device_node *np, > > + const char *prop_name, int index) > > +{ > > + if (!strcmp_suffix(prop_name, ",nr-gpios")) > > + return NULL; > > Ah I somehow missed this patch. This gives a blanked exception for > vendor,nr-gpios. I'd prefer explicit exceptions for all the instances > of ",nr-gpios" we are grandfathering in. Any future additions should > be rejected. Can we do that please? > > Rob, you okay with making this list more explicit? Not the kernel's job IMO. A schema is the right way to handle that. Rob