Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4759050pxb; Tue, 2 Nov 2021 15:30:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/QDerJ5fwLnK1K3qbKDKcCCFBgD1M2xG8tng5Y6r4TmDETwsQn1b1j1hBy8r5QR+jiBRV X-Received: by 2002:a17:907:d8e:: with SMTP id go14mr49870350ejc.442.1635892256134; Tue, 02 Nov 2021 15:30:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635892256; cv=none; d=google.com; s=arc-20160816; b=RR4cc5GgTmpwTZU0JjpKazTUT1P9irX18hMBz9zBjpeq8LcHhhsxizXcOSmfYMqTEM ZXUFWlRr7I6yEX7xiWpE2b7AVFIK16tV71FSSiEQPdndUrh0u9Ya6IAl8n1Ubme6KH5h 13IypAahwTe0bPjmFeez5ONHn0CT9Qu2oCRXB9GaB2lJjol7X/xRAU+QYBxsFBVpA6IH qC5jHkHqyTWUmFKSQOBiCIuA6QJHBOrFq27+eIJALt9dZFgL3cTIfY42T46HvEEjWz/u RJ+DrT4+/FOX48hMVBua1bKhIH+ae1IgbuqEn/UHuOWoXoNnL8uXcGwHpfpfZ956n1V6 1PpA== 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:ironport-sdr :dkim-signature; bh=zKmTGWEYJf7OSzBxTJtm3cHzd0h7FUwt8zfM4eit6DA=; b=aoE0BFihC29C7hFTYcnOjR0uP/KlfkHYmlOh9NUayQPVpNq5SgpWMNp1+AdwDo4jaq phRp9yfvhwwU2dJ6gTrLcCb5eWoEhpmvSlZCQ+cV4VTGWrIdAI5WI975jAQhjB8zounP V+ZoowzmRbi3K0L/6gJc3HZxroWWeCuPUxXZIeT9L/n4Qt2liJPsLFtzJbkbdkUuX8Ys cwKPnv30OwrKyAeceKaGhUC+BedzQ5c5TFQjaEI4QogwMcO/qv3d3tTIbNX474mzK1M9 Gb0I/2AHY/qb7yNSxuwD47nFDfcFns+XyZqg3HTizJ7aO5rZZ8YUV9/SNUWcxjyiqfU4 PuVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@microchip.com header.s=mchp header.b=VdmgN+Bb; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ce15si553277edb.612.2021.11.02.15.30.29; Tue, 02 Nov 2021 15:30:56 -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; dkim=fail header.i=@microchip.com header.s=mchp header.b=VdmgN+Bb; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230196AbhKBW3K (ORCPT + 99 others); Tue, 2 Nov 2021 18:29:10 -0400 Received: from esa.microchip.iphmx.com ([68.232.154.123]:53462 "EHLO esa.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229685AbhKBW3H (ORCPT ); Tue, 2 Nov 2021 18:29:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1635891992; x=1667427992; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=FpZTv+Z+2lWKcOts96nJlKZCg2JsGS0+rRKM65iulVM=; b=VdmgN+BbuSfgTTwHsoZ+HLsUqpt96NkCblJ64e+YfEv2ojdAz1slbLlE JQlakautbVqMilG6WHm1RIROnEAl/3ZBJ7iMmNDc1gUC3DUnMDK0LoHpU c7yN5Z/BORqqtMkl1QuiqxzECshz/OcokeljJlf/FJ7HjQ45fQUW5JFZG dZGthzLv+DggYGe2CFUeYmPh3EuZImlcGzm1iwqSL7fbnryLhpVJQ72V+ bIVo00cZm/IqpJQdnip5DGlCJV2avMkuQbvSZyrz2PblB7+XWlasZ4+LM LCVgi7V0nQqhpJ6wrHLbVCi2j/6nbFOUrRhTMioBT4myunkAdmYqU3Ow9 w==; IronPort-SDR: 90pESWtmXU12Vwip6F1YE6osK1PcbC1fP10AN/IT5owFxkAgaujgLtNzgmuMkNxnMnnZdUWiCj Zc0YJLqgahIQdO4pfOqo0Z0+eXCQPx3x50BYXVDBeSYKUXC70i/m53QRHszDzh/NuIhDk6e8m5 X05/rEclNiIPwqqqu7L1GIDxaEZhTuhW57nkP0Fnao+oMd1SkKda7xBuLAKxKC5hTi8RJQ3ghN hd5A9O/hrZf4nD8khqYUy0wYkb9tHTN7mgoITawZ+N8v78w+HOvGAEJPFHFhgBy9Qsz+H3OAYa eXMClHpPg164nyuAtbFRuoHp X-IronPort-AV: E=Sophos;i="5.87,203,1631602800"; d="scan'208";a="135257817" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 02 Nov 2021 15:26:30 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Tue, 2 Nov 2021 15:26:11 -0700 Received: from localhost (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Tue, 2 Nov 2021 15:26:11 -0700 Date: Tue, 2 Nov 2021 23:27:57 +0100 From: Horatiu Vultur To: Rob Herring CC: Peter Rosin , , , Subject: Re: [PATCH v3 1/2] dt-bindings: i2c-mux: Add property for settle time Message-ID: <20211102222757.ny4c7gdnyxm3gorw@soft-dev3-1.localhost> References: <20211101122545.3417624-1-horatiu.vultur@microchip.com> <20211101122545.3417624-2-horatiu.vultur@microchip.com> <20211101213201.wdjsuexuuinepu3m@soft-dev3-1.localhost> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The 11/02/2021 13:37, Rob Herring wrote: Hi Rob, > > On Mon, Nov 01, 2021 at 10:32:01PM +0100, Horatiu Vultur wrote: > > The 11/01/2021 15:32, Peter Rosin wrote: > > > > Hi Peter, > > > > > > > > On 2021-11-01 13:25, Horatiu Vultur wrote: > > > > Some HW requires some time for the signals to settle after the muxing is > > > > changed. Allow this time to be specified in device tree. > > > > > > > > Signed-off-by: Horatiu Vultur > > > > --- > > > > Documentation/devicetree/bindings/i2c/i2c-mux.yaml | 6 ++++++ > > > > 1 file changed, 6 insertions(+) > > > > > > > > diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux.yaml b/Documentation/devicetree/bindings/i2c/i2c-mux.yaml > > > > index 24cac36037f5..4628ff6340c1 100644 > > > > --- a/Documentation/devicetree/bindings/i2c/i2c-mux.yaml > > > > +++ b/Documentation/devicetree/bindings/i2c/i2c-mux.yaml > > > > @@ -29,6 +29,12 @@ properties: > > > > '#size-cells': > > > > const: 0 > > > > > > > > + settle-time-us: > > > > + default: 0 > > > > + description: > > > > + The time required for the signals to settle. Currently only the > > > > + i2c-mux-gpmux driver supports this optional binding. > > > > > > The information about how i2c-mux-gpmux is special is bound to go stale, > > > and I don't think we should mention such specific details in the binding. > > > What I meant was a generic warnings about optional bindings perhaps not > > > being supported by all drivers, along the lines of this from i2c.txt: > > > > > > "These properties may not be supported by all drivers. However, if a driver > > > wants to support one of the below features, it should adapt these bindings." > > > > > > However, I now notice that this sentence makes no sense. It looks like it > > > should be s/adapt/adopt/. > > > > > > And, in the i2c-mux.yaml case it can simply say "Optional properties" > > > instead of "These properites" (which refers to a subset of properties > > > immediately below the text) since with a yaml binding it is always > > > clear which properties are optional and which are required. Lastly, I > > > guess this warning belongs in the description. > > > > > > > + > > > > patternProperties: > > > > '^i2c@[0-9a-f]+$': > > > > $ref: /schemas/i2c/i2c-controller.yaml > > > > > > > > > > Since this is the first optional property, you now need to specify what > > > properties are required, which is everything but settle-time-us. If you > > > don't, all properties are required. Which is not what we want... > > > > > > Something like this should do it, I think: > > > > > > required: > > > - compatible > > > - '#address-cells' > > > - '#size-cells' > > > > Thanks for a detail explanation but I am still struggling with these > > bindings. Were you thinking to have something like this? > > > > --- > > diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux.yaml b/Documentation/devicetree/bindings/i2c/i2c-mux.yaml > > index 24cac36037f5..c9fde1bb0fea 100644 > > --- a/Documentation/devicetree/bindings/i2c/i2c-mux.yaml > > +++ b/Documentation/devicetree/bindings/i2c/i2c-mux.yaml > > @@ -19,6 +19,9 @@ description: |+ > > populating the i2c child busses. If an 'i2c-mux' subnode is present, only > > subnodes of this will be considered as i2c child busses. > > > > + Optional properties may not be supported by all drivers. However, if a driver > > + wants to support one of the below features, it should adopt these bindings. > > + > > properties: > > $nodename: > > pattern: '^(i2c-?)?mux' > > @@ -29,6 +32,11 @@ properties: > > '#size-cells': > > const: 0 > > > > + settle-time-us: > > + default: 0 > > + description: > > + The time required for the signals to settle. > > + > > patternProperties: > > '^i2c@[0-9a-f]+$': > > $ref: /schemas/i2c/i2c-controller.yaml > > @@ -41,6 +49,11 @@ patternProperties: > > > > additionalProperties: true > > > > +required: > > + - compatible > > compatible should not be required here. > > > + - '#address-cells' > > + - '#size-cells' > > + > > examples: > > - | > > /* > > --- > > > > If I have this then my problem is with the required properties because then I > > start to get new warnings once I run: > > > > make ARCH=arm CROSS_COMPILE=arm-linux- dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/i2c/i2c-mux.yaml > > > > For example, one of new the warnings is this: > > > > /home/hvultur/linux/arch/arm/boot/dts/am335x-icev2.dt.yaml: mux-mii-hog: 'compatible' is a required property > > From schema: /home/hvultur/linux/Documentation/devicetree/bindings/i2c/i2c-mux.yaml > > /home/hvultur/linux/arch/arm/boot/dts/am335x-icev2.dt.yaml: mux-mii-hog: '#address-cells' is a required property > > From schema: /home/hvultur/linux/Documentation/devicetree/bindings/i2c/i2c-mux.yaml > > /home/hvultur/linux/arch/arm/boot/dts/am335x-icev2.dt.yaml: mux-mii-hog: '#size-cells' is a required property > > From schema: /home/hvultur/linux/Documentation/devicetree/bindings/i2c/i2c-mux.yaml > > This is because of the $nodename pattern being pretty lax and matches > on mux-mii-hog by mistake. We have 2 options. Change the nodename > pattern to '^(i2c-?)?mux(@.*)?$' or add 'select: false'. The former > would still match on 'mux' or 'mux@.*' which might still have problems. > For the latter, we just need to make sure all the i2c-mux schemas have a > $ref to this schema. Also, with that change we'd stop checking 'i2c-mux' > nodes that don't yet have a specific schema. That said, I do lean toward > the latter option. From what I can see there are only two i2c-mux schemas and both of them have a $ref to this schema [1][2] [1] https://elixir.bootlin.com/linux/latest/source/Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.yaml#L33 [2] https://elixir.bootlin.com/linux/latest/source/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.yaml#L16 > > Rob -- /Horatiu