From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F79EC67839 for ; Tue, 11 Dec 2018 18:35:55 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 76A3520855 for ; Tue, 11 Dec 2018 18:35:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="FqvYfG87"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="OWQ81JFK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 76A3520855 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=H8niH2OP8QOyxNA29HfpFlTbPEgNbUNUziMW/0oPiXg=; b=FqvYfG87rGzC7a s4HPedSw86o8273RYOGt4/SR7geMg3dtrX9LigiwHNHECPyq10gr2cJc3dNMOetPR1RjS6zIz6zVl 1+DuTNVOjTnsY/jDXqQ0u87VIqo/7rKXCetlSmc/RF7c6s7jkSttWp3EHLPScNCF8cQSKn5JdeJj5 DdeDIMXyqi1G1euJL+lj30w1+yjh0FZjCaswxDdFTh6JFMXKvXxNN5F8z36QIkEuVxFiZLpk49Kks Oy+sysayOmr0/cv1KXxR0J2Iu3R0STh6x+MazobzXmkzZ59rhWTFrYaEslSg9377+UCMuOS+zEziD wU0c6eEMx+rvc0r894Lg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWmsr-00037f-5c; Tue, 11 Dec 2018 18:35:53 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWmso-00036d-Gh for linux-arm-kernel@lists.infradead.org; Tue, 11 Dec 2018 18:35:52 +0000 Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) (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 9E4492145D for ; Tue, 11 Dec 2018 18:35:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544553339; bh=p8EYJ/W+tstdk9YOyWSoVKU0GF7Ar/LYqGAocqTKjN4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=OWQ81JFKXZTiHWodKIjRr+PHBOP1poJulI2bqPwB6Dw9OgiKT9r5Bt9tJT9LED/ON qY6kCVSeQIrh7w35A/PMsdTz5nYfAaEsvglLfTQITTa4rdrM6DcR6z41Uvm9yEnPjh AwQ8ZkQpf4FXa0veSWmAmxFqskHCGIa1/xUXNrmE= Received: by mail-qt1-f175.google.com with SMTP id y20so17529850qtm.13 for ; Tue, 11 Dec 2018 10:35:39 -0800 (PST) X-Gm-Message-State: AA+aEWbPH6xHeD4nFBFFYTSq15NTMCEKNhEAaM/nO1FX3oOQMV6LublG Z65cXrpm242fpuDW+8+TdChVZ5FjtX/BBMsvwg== X-Google-Smtp-Source: AFSGD/XseHpa+vQVxHR9GEAcS6cxLcCfOLfE/L6WOZfoUsMgmKGeQvPeV58OCxEJnc4x9BXpjTkrK4b0fW9kWb7Db+w= X-Received: by 2002:ac8:1712:: with SMTP id w18mr16930766qtj.76.1544553338724; Tue, 11 Dec 2018 10:35:38 -0800 (PST) MIME-Version: 1.0 References: <20181210203225.11179-1-robh@kernel.org> In-Reply-To: From: Rob Herring Date: Tue, 11 Dec 2018 12:35:26 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3] kbuild: Add support for DT binding schema checks To: Masahiro Yamada X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181211_103550_593869_062A3F67 X-CRM114-Status: GOOD ( 26.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Kumar Gala , ARM-SoC Maintainers , Sean Hudson , Jonathan Corbet , Frank Rowand , Linux Doc Mailing List , "linux-kernel@vger.kernel.org" , Linux Kbuild mailing list , Michal Marek , Grant Likely , linuxppc-dev , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Dec 11, 2018 at 10:03 AM Masahiro Yamada wrote: > > On Wed, Dec 12, 2018 at 12:13 AM Rob Herring wrote: > > > > > > > +$(obj)/%.example.dts: $(src)/%.yaml FORCE > > > > + $(call if_changed,chk_binding) > > > > + > > > > +DT_TMP_SCHEMA := .schema.yaml.tmp > > > > > > > > > BTW, why does this file start with a period? > > > What is the meaning of '.tmp' extension? > > > > Nothing really. Just named it something so it gets cleaned and ignored by git. > > > It is cleaned whatever file name you use. > > > See scripts/Makefile.clean > > __clean-files := $(extra-y) $(extra-m) $(extra-) \ > $(always) $(targets) $(clean-files) \ > $(hostprogs-y) $(hostprogs-m) $(hostprogs-) \ > $(hostlibs-y) $(hostlibs-m) $(hostlibs-) \ > $(hostcxxlibs-y) $(hostcxxlibs-m) > > > $(extra-y) is cleaned. True. > > > You are adding *.example.dts to .gitignore > > Why not "schema.yaml" ? Okay. I'll do "processed-schema.yaml" to give a bit better name of what it contains. > > > > > +extra-y += $(DT_TMP_SCHEMA) > > > > + > > > > +quiet_cmd_mk_schema = SCHEMA $@ > > > > + cmd_mk_schema = mkdir -p $(obj); \ > > > > + rm -f $@; \ > > > > + $(DT_MK_SCHEMA) $(DT_MK_SCHEMA_FLAGS) -o $@ $(filter-out FORCE, $^) > > > > > > > > > "mkdir -p $(obj)" is redundant. > > > > > > > > > Why is 'rm -f $@' necessary ? > > > Can't dt-mk-schema overwrite the output file? > > > > It is for error case when the output file is not generated. I can > > handle this within dt-mk-schema instead. > > > > +DT_DOCS = $(shell cd $(srctree)/$(src) && find * -name '*.yaml') > > > > +DT_SCHEMA_FILES ?= $(addprefix $(src)/,$(DT_DOCS)) > > > > + > > > > +extra-y += $(patsubst $(src)/%.yaml,%.example.dts, $(DT_SCHEMA_FILES)) > > > > +extra-y += $(patsubst $(src)/%.yaml,%.example.dtb, $(DT_SCHEMA_FILES)) > > > > > > > > > > > > I assume you intentionally did not do like this: > > > > > > extra-y += $(patsubst %.yaml,%.example.dtb, $(DT_DOCS)) > > > > > > From the commit description, DT_SCHEMA_FILES might be overridden by a user. > > > So, I think this is OK. > > > > > > > > > > > > > > > > +$(obj)/$(DT_TMP_SCHEMA): | $(addprefix $(obj)/,$(patsubst $(src)/%.yaml,%.example.dtb, $(DT_SCHEMA_FILES))) > > > > > > I do not understand this line. > > > Why is it necessary? > > > > > > *.example.dtb files are generated anyway > > > since they are listed in extra-y. > > > > It is enforcing the ordering. Without it, the binding checks and > > building .schema.yaml.tmp happen in parallel because both only have > > the source files as dependencies. The '|' keeps the dependencies out > > of the dependency list($^). > > > What kind problem would you see if > the binding checks and building .schema.yaml.tmp > happen in parallel? In case of no errors in the binding docs, it doesn't matter. If there are errors, I don't want the dtbs validation to run if any schema doesn't validate. However, I played around with this a bit more and it seems like having the examples' dts/dtb in extra-y prevents that from happening. Does that match your expections? If so, then I think we can remove the dependency. Here's an example. SCHEMA Documentation/devicetree/bindings/.schema.yaml.tmp CHKDT Documentation/devicetree/bindings/arm/vt8500.yaml CHKDT Documentation/devicetree/bindings/arm/zte.yaml CHKDT Documentation/devicetree/bindings/arm/altera/socfpga-clk-manager.yaml CHKDT Documentation/devicetree/bindings/arm/ti/ti,davinci.yaml CHKDT Documentation/devicetree/bindings/arm/ti/nspire.yaml CHKDT Documentation/devicetree/bindings/arm/spear.yaml CHKDT Documentation/devicetree/bindings/arm/altera.yaml warning: no schema found in file: ../Documentation/devicetree/bindings/arm/xilinx.yaml /home/rob/proj/git/linux-2.6/Documentation/devicetree/bindings/arm/xilinx.yaml: ignoring, error in schema 'onOf' CHKDT Documentation/devicetree/bindings/arm/sti.yaml CHKDT Documentation/devicetree/bindings/arm/qcom.yaml CHKDT Documentation/devicetree/bindings/arm/primecell.yaml CHKDT Documentation/devicetree/bindings/arm/cpus.yaml CHKDT Documentation/devicetree/bindings/arm/sirf.yaml CHKDT Documentation/devicetree/bindings/arm/calxeda.yaml CHKDT Documentation/devicetree/bindings/arm/xilinx.yaml CHKDT Documentation/devicetree/bindings/example-schema.yaml /home/rob/proj/git/linux-2.6/Documentation/devicetree/bindings/arm/xilinx.yaml: properties:compatible:onOf: 'onOf' is not one of ['$ref', 'additionalItems', 'allOf', 'const', 'contains', 'default', 'dependencies', 'description', 'enum', 'items', 'minItems', 'minimum', 'maxItems', 'maximum', 'not', 'oneOf', 'pattern', 'patternProperties', 'properties', 'required', 'type', 'typeSize'] make[2]: *** [../Documentation/devicetree/bindings/Makefile:12: Documentation/devicetree/bindings/arm/xilinx.example.dts] Error 1 Rob _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel