Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp2724455ybp; Thu, 10 Oct 2019 11:35:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqxTVaFiXU/ZzY/G+koNKRpc4I44tUW6C5DzQzrNhigRgqxlED8m8G7Z9GlrLwokktcr55vJ X-Received: by 2002:a17:906:b318:: with SMTP id n24mr9297121ejz.248.1570732559782; Thu, 10 Oct 2019 11:35:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570732559; cv=none; d=google.com; s=arc-20160816; b=yaZs2JW3/AVAYPfzOdrDiyjtEwMS2C6lA5ahgitg1ZpgWWzNl5YvaHHXs08gBT26jv g2FjlN1uqCPad5zk1RjxNYr90iobxOi4fPinZddd1eNf4NT8yctPZ/VMuWDgoDoG5NXu n8PTy+7ilcEKXNq0MhCvGfIuKwvpWC0bvYPFCoKCKK9YjLynUoZDTMst1wt7p1BZ+fJ5 TSWiOdd4WaEM3r3lLgKRRdaaDgveop7hdkx4DcAAPugKkPGZBArAz2ZyZCgTpCnHl1on /G0VI8dFPcyOZfwWFX4ya1ed0QDyJkLRWTTiEftMfvI0gurMjhO4Ynkh3G0vhJ53wN9Y I2BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=r4XAjDc0xfpf5vzfo/i7Ws66r6JtB7Z+yeiV1OLT15o=; b=xqnSHBUZ4ButqDN2to1hMc9c6mk/Rj3K5+/ur41saBYTru2bGqipF1qt6u3xNolPVD PzcRpRKprEjNG6r3iyNogPZnkb2OgsKaCzXyWxn5FwGhU5QxqyH1wiz+MYsK5e1ydCJ+ y7vg6Dak9krUrD7gSTeN4qYDqtjesBY+zNQYPZ15jot8tJzv42wPuFuzHej5mX3Cx71t rdgthb+Yp73wANl64qjrTBarIkexvE1Id1Zt9V1vJI9Vse6OKaLAtIP0srz4C5MvlCat 1+O0LcatNPmP4M2oXxJ+0Vey620oHOnwqZqkQnhbso04Hgy+RikPF0+o80/1FtrQVlTx MPNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=Mv4MgHak; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e4si3583063edy.295.2019.10.10.11.35.35; Thu, 10 Oct 2019 11:35:59 -0700 (PDT) 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=@sifive.com header.s=google header.b=Mv4MgHak; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726634AbfJJSfA (ORCPT + 99 others); Thu, 10 Oct 2019 14:35:00 -0400 Received: from mail-ot1-f68.google.com ([209.85.210.68]:33724 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725901AbfJJSe7 (ORCPT ); Thu, 10 Oct 2019 14:34:59 -0400 Received: by mail-ot1-f68.google.com with SMTP id 60so5779175otu.0 for ; Thu, 10 Oct 2019 11:34:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=r4XAjDc0xfpf5vzfo/i7Ws66r6JtB7Z+yeiV1OLT15o=; b=Mv4MgHakwlbkZi54pRbq6rETPbooTcIqnnEmLH++AM/dbjJdkhLvcNrXOW6IsB/pgz d3BRPjAYgQBUlrZUnlPimOcZM56EUiNxYWXroi33EWcAq5Fahw8qTgF6f72D6D5a6YWU 7q+yiS2BlxAegJ+W9jG3+epyOA7gnmnpBJPqvF325FE5RJDugDklSWrk6RcuPRm8gboS NTLPeYmYJHcKWhneSddbCJX/CvCvSPdD+dJPI1kA6LYqbcEzzn6/LZmG47mjRo0eR6jX EBgk0m7BwCElwY/08rYUe0cf8VTuxLShCP1sxj18C0SXkFF458ooK8/QtW7p1Ueg0kBu IevA== 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:in-reply-to:message-id :references:user-agent:mime-version; bh=r4XAjDc0xfpf5vzfo/i7Ws66r6JtB7Z+yeiV1OLT15o=; b=gD1SYeBJqNJORYAJzED49/uuS7kywxugUJvLISxcJky/otp21z/ayMBrSLKXjGnYXP U3veDSgtM6vNTyE8Bae/hMxgxPMVQLA2dxouClOSnY+J3Aou2TWSbqSWI5ZmMcsEwfP3 vK1d0yqq5cyTe2Ev4zjupW8skxaoexnnUaS6i7aNDX54Jh9iEMCIf+EUcvZQU8ByIeME xIAesj9FZzzhilH14ydpC99atO/x7roTxF5pVhkH4Bd42DJL6MCkG5DHASbv7ynIxO3i I0OSkL8kp7RU+Lzz20BT0mCnVRIFuGENmDoNdwImUw6gw9eOZbowuTGr2osCwL7t+Ht5 Vcng== X-Gm-Message-State: APjAAAXEw0nomry0SkeMhPDaZdLU0jNZaiiXgUg+Fru0ndGNf6KxKiw0 pewrBQ0LwcjDc5YDB2Y0medfsQ== X-Received: by 2002:a9d:3675:: with SMTP id w108mr6677517otb.81.1570732498705; Thu, 10 Oct 2019 11:34:58 -0700 (PDT) Received: from localhost ([2600:100e:b04d:43d4:f34c:fed9:3a80:e86d]) by smtp.gmail.com with ESMTPSA id w25sm1914021oth.39.2019.10.10.11.34.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 11:34:58 -0700 (PDT) Date: Thu, 10 Oct 2019 11:34:55 -0700 (PDT) From: Paul Walmsley X-X-Sender: paulw@viisi.sifive.com To: Rob Herring cc: Palmer Dabbelt , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" , Albert Ou , linux-riscv@lists.infradead.org Subject: Re: [PATCH v2] dt-bindings: riscv: Fix CPU schema errors In-Reply-To: Message-ID: References: <20191009234648.2271-1-robh@kernel.org> User-Agent: Alpine 2.21.9999 (DEB 301 2018-08-15) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 10 Oct 2019, Rob Herring wrote: > On Wed, Oct 9, 2019 at 7:08 PM Paul Walmsley wrote: > > > > On Wed, 9 Oct 2019, Rob Herring wrote: > > > > > Fix the errors in the RiscV CPU DT schema: > > > > > > Documentation/devicetree/bindings/riscv/cpus.example.dt.yaml: cpu@0: 'timebase-frequency' is a required property > > > Documentation/devicetree/bindings/riscv/cpus.example.dt.yaml: cpu@1: 'timebase-frequency' is a required property > > > Documentation/devicetree/bindings/riscv/cpus.example.dt.yaml: cpu@0: compatible:0: 'riscv' is not one of ['sifive,rocket0', 'sifive,e5', 'sifive,e51', 'sifive,u54-mc', 'sifive,u54', 'sifive,u5'] > > > Documentation/devicetree/bindings/riscv/cpus.example.dt.yaml: cpu@0: compatible: ['riscv'] is too short > > > Documentation/devicetree/bindings/riscv/cpus.example.dt.yaml: cpu@0: 'timebase-frequency' is a required property > > > > > > The DT spec allows for 'timebase-frequency' to be in 'cpu' or 'cpus' node > > > and RiscV is doing nothing special with it, so just drop the definition > > > here and don't make it required. > > > > The RISC-V kernel code does in fact parse it and use it, and we currently > > rely on it being under /cpus: > > > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/riscv/kernel/time.c#n19 > > > > The RISC-V user ISA specification also constrains the timebase-frequency > > to be the same across all CPUs, in section 10.1: > > > > https://github.com/riscv/riscv-isa-manual/releases/download/draft-20190608-f467e5d/riscv-spec.pdf > > > > So the right thing is to require 'timebase-frequency' at /cpus, and forbid > > it in the individual CPU nodes. > > Yes, but this schema only deals with 'cpu' nodes and we can't check > /cpus here. We'd need to write another schema matching on a child cpu > node having a RiscV compatible. > > I can change this to 'timebase-frequency: false' to ban it here. Sounds good to me. (Might catch the occasional mistake.) With that change, the resulting patch would be Acked-by: Paul Walmsley # for arch/riscv and thanks indeed for cleaning this up. > That doesn't add too much as any undefined name is still allowed such as > 'timbase-frequency'. There's a way to address this in json-schema draft8 > with 'unevaluatedProperties', but that's not ready yet. OK - Paul