Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp2603124ybf; Mon, 2 Mar 2020 12:00:25 -0800 (PST) X-Google-Smtp-Source: ADFU+vvm/Z2wRWT86BXRZ0TRunR/uLK87hbR9Nyxne+FrmBFUhdPkqhn2rWcPwAMgs6pKuNpgigI X-Received: by 2002:a9d:6b12:: with SMTP id g18mr618648otp.211.1583179225547; Mon, 02 Mar 2020 12:00:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583179225; cv=none; d=google.com; s=arc-20160816; b=UXqoohOKZlpJuzpID2ufMW7uk2aNhn+LuhDkIK+rZXR0j8iNhWtEIu8iF81WLWXAkH WA9Uayw88wZZ3DEmmGn42oBQxu1fPV+tRtDTts0WfR9SOFJ1nuu8dFvXhnXVd5c8erz7 e7xtAsNWcuhJK1mC2I1pQ5qo5g9zU69iBKTvdZEZI2tOX642MRmG08Xmc8osffmqYqo6 ZeSBclHNz2bTOPEbNB39+d9ifGvC/8ZRrOOcNWDfnC+j9Er5ypqzupNxAeGP9Omf3yXk ojHJruxoMsyE6XYeRRIRmdjng5MITryulHJwXwwim7ahrjRxHYnjkVZ7Kbpj68vxNJQA sLhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Q0BjexawreN5lkdOs7xa8BHRbQ+YhG7bV33WgP7l/JU=; b=Qoi9/uarTRtVyHsqneqDJDAe+stpDkE05by5nC1+gkwuprwRML8/Ceu12wO1KqJGaP 4IaXXE1fUUfrXIP1J3QhQ+UyUtlIEesnHshHFm28iX2i6Agnkoe+UrDYlBtLns4jlwFc LZ0Rtg+ZLfG3bzOSnJoxQ9EFclmzAiXemRMws2jWanyWrCglfZy/N6Hck8TbHdXtL2tb FNaf/Dori3vHMRqUpAcxCjCrC7NtxIpIzuAw3/fYGOB5T1wtqNNZOem8SNHIIjcsVx2O qTXu3Y+xi8XIaUAftzQZolLZsxHdO+1kSshON2v2yQKjk2P4sbpzgVp0ti0ch7tsbylh 0ulw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zxqV84tO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n9si6509975ota.103.2020.03.02.12.00.13; Mon, 02 Mar 2020 12:00:25 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=zxqV84tO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726700AbgCBUAG (ORCPT + 99 others); Mon, 2 Mar 2020 15:00:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:34392 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725446AbgCBUAG (ORCPT ); Mon, 2 Mar 2020 15:00:06 -0500 Received: from mail-qv1-f54.google.com (mail-qv1-f54.google.com [209.85.219.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 26A7820866; Mon, 2 Mar 2020 20:00:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583179205; bh=8I9b3PWxOxjKsgSmIz7gwtVQierxjUwDS1qzOwAIkg4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=zxqV84tOGhGMpUEFvUTFo+QhqFqRegWfkZXtLi5Qpa3Stop9mFoYD5UtUtYAFUCxM IeQSDhVTRaZYUmFfD1VHIDj2kWxqJacaz8tGzb0vkqPRyLfydzqVmHLwf5+qU9W7fK +TFDgZH111r2TAxBYGVqLIvCNIhpRVRokQUFd2nY= Received: by mail-qv1-f54.google.com with SMTP id o18so529566qvf.1; Mon, 02 Mar 2020 12:00:05 -0800 (PST) X-Gm-Message-State: ANhLgQ095VLZfMfHCyrrJfVaF/2V+5dORkJHSqeuNGu+xXFwc3EBcdRh ZXsFxG/4tNVbBk3odVOMdGk5xMirWGoosIc9tQ== X-Received: by 2002:a0c:f68f:: with SMTP id p15mr962095qvn.79.1583179204250; Mon, 02 Mar 2020 12:00:04 -0800 (PST) MIME-Version: 1.0 References: <20200301174636.63446-1-paul@crapouillou.net> <20200301174636.63446-2-paul@crapouillou.net> <1583173481.3.0@crapouillou.net> <1583177720.3.6@crapouillou.net> In-Reply-To: <1583177720.3.6@crapouillou.net> From: Rob Herring Date: Mon, 2 Mar 2020 13:59:52 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/1] dt-bindings: timer: Convert ingenic,tcu.txt to YAML To: Paul Cercueil Cc: Daniel Lezcano , Thomas Gleixner , Mark Rutland , =?UTF-8?B?5ZGo55Cw5p2w?= , od@zcrc.me, "linux-kernel@vger.kernel.org" , devicetree@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 2, 2020 at 1:35 PM Paul Cercueil wrote: > > > > Le lun., mars 2, 2020 at 13:07, Rob Herring a > =C3=A9crit : > > On Mon, Mar 2, 2020 at 12:25 PM Paul Cercueil > > wrote: > >> > >> Hi Rob, > >> > >> > >> Le lun., mars 2, 2020 at 11:06, Rob Herring a > >> =C3=A9crit : > >> > On Sun, Mar 1, 2020 at 11:47 AM Paul Cercueil > >> > >> > wrote: > >> >> > >> > > >> > Well, this flew into linux-next quickly and breaks 'make > >> > dt_binding_check'... Please drop, revert or fix quickly. > >> > >> For my defense I said to merge "provided Rob acks it" ;) > >> > >> >> Convert the ingenic,tcu.txt file to YAML. > >> >> > >> >> Signed-off-by: Paul Cercueil > >> >> --- > >> >> .../devicetree/bindings/timer/ingenic,tcu.txt | 138 ---------- > >> >> .../bindings/timer/ingenic,tcu.yaml | 235 > >> >> ++++++++++++++++++ > >> >> 2 files changed, 235 insertions(+), 138 deletions(-) > >> >> delete mode 100644 > >> >> Documentation/devicetree/bindings/timer/ingenic,tcu.txt > >> >> create mode 100644 > >> >> Documentation/devicetree/bindings/timer/ingenic,tcu.yaml > >> > > >> > > >> >> diff --git > >> >> a/Documentation/devicetree/bindings/timer/ingenic,tcu.yaml > >> >> b/Documentation/devicetree/bindings/timer/ingenic,tcu.yaml > >> >> new file mode 100644 > >> >> index 000000000000..1ded3b4762bb > >> >> --- /dev/null > >> >> +++ b/Documentation/devicetree/bindings/timer/ingenic,tcu.yaml > >> >> @@ -0,0 +1,235 @@ > >> >> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > >> >> +%YAML 1.2 > >> >> +--- > >> >> +$id: http://devicetree.org/schemas/timer/ingenic,tcu.yaml# > >> >> +$schema: http://devicetree.org/meta-schemas/core.yaml# > >> >> + > >> >> +title: Ingenic SoCs Timer/Counter Unit (TCU) devicetree > >> bindings > >> >> + > >> >> +description: | > >> >> + For a description of the TCU hardware and drivers, have a > >> look at > >> >> + Documentation/mips/ingenic-tcu.rst. > >> >> + > >> >> +maintainers: > >> >> + - Paul Cercueil > >> >> + > >> >> +properties: > >> >> + $nodename: > >> >> + pattern: "^timer@.*" > >> > > >> > '.*' is redundant. > >> > > >> >> + > >> >> + "#address-cells": > >> >> + const: 1 > >> >> + > >> >> + "#size-cells": > >> >> + const: 1 > >> >> + > >> >> + "#clock-cells": > >> >> + const: 1 > >> >> + > >> >> + "#interrupt-cells": > >> >> + const: 1 > >> >> + > >> >> + interrupt-controller: true > >> >> + > >> >> + ranges: true > >> >> + > >> >> + compatible: > >> >> + items: > >> >> + - enum: > >> >> + - ingenic,jz4740-tcu > >> >> + - ingenic,jz4725b-tcu > >> >> + - ingenic,jz4770-tcu > >> >> + - ingenic,x1000-tcu > >> >> + - const: simple-mfd > >> > > >> > This breaks several examples in dt_binding_check because this > >> schema > >> > will be applied to every 'simple-mfd' node. You need a custom > >> select > >> > entry that excludes 'simple-mfd'. There should be several > >> examples in > >> > tree to copy. > >> > >> Why would it be applied to all 'single-mfd' nodes? > > > > single-mfd? > > simple-mfd* of course, sorry. > > > The way the tool decides to apply a schema or not is my matching on > > any of the compatible strings (or node name if no compatible > > specified). You can override this with 'select'. > > > >> Doesn't what I wrote > >> specify that it needs one of ingenic,*-tcu _and_ simple-mfd? > > > > Yes, but matching is on any of them. You need to add: > > Alright, will do. Is there a reason why it's done that way? It sounds a > bit counter-intuitive. I'm not sure how we could do it differently. We need some way to express 'apply this schema to a node if ...'. If we just matched on 'compatible' schema as is, then we'd get silence if there's any error in 'compatible'. That can still happen, but it's reduced in the cases where there's more than one compatible string as only 1 has to be right. It's also very common that valid combinations of compatible strings are not documented clearly or followed correctly, so we can catch these errors. I wasn't a fan of having to list out compatible strings twice, so the tool does it for you in the common case. Rob