Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp2318532ybp; Thu, 10 Oct 2019 05:48:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqxp9f1bWjl4lJZ0zA5EQq2soVtg39DxIopLJvF0ZoNiJHQ/f1Txv6MHw70GWgv05hraG7Xm X-Received: by 2002:a17:906:218a:: with SMTP id 10mr8034154eju.38.1570711701367; Thu, 10 Oct 2019 05:48:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570711701; cv=none; d=google.com; s=arc-20160816; b=EPpm9/Mdb+9eqDg86kxxs1zNP2GnEk7eHYH+uVh1YXhvKV0NX+mVrimlKPpK1d4qUU 4YQQH57ZA2qf/Z2cawRmsvxfsZGwdpbjRwoAEbAEm3vUU67M4/eSpuDOvjfVDS+f6uqp HMwS68gJdR0pbj7HXqGfXGrm2xvbY6WkW18xpHhAryGOJCNM6O71qlq+Yg8WPy2iFnPf dxsn1hGWjeWnhSNoyhnDK1I5WfTjH+etlZdvhnS4BgNV4NFETfnH2b29pgbeMqqHqxHp cxQAcAP6HLkpRWZ/64G1Vr7ZpJXgN7nPK7OA4Saf0nKmwnK1vINGbCK3zgLMeGjxh3xy yuBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=MtHQF/NkloyhHMO8vwDrVgMOzoDdhhyBBi9UGiMTKhU=; b=I9Lovg+GDR0pFPa4k8TDoqTCs2OwdrKv4np381fb44+7cyRUirBrmWvPlXeQPX42Hn QcCWs7oj2HCX/FN8HxoD6TaoD4JO21MK5KQrNEVsC+FiT2khPFAQVllmdwyVYzLq2i/L dDQfmo21I+WDb1r7Ggqiz1rcz6ddjqb4AwE4Etd9qnPS7kLymKjSJurjkz1vImk15uUH V+P8w2WwjgPyt9vJ1MJvM+BizqxOO2PmdCvGP4iYswqI7nMi+NqXzgemfa6ssFkOkE2O OXC8PuhgXNSvquSUF/KyVAzvJmhr97VZFuv3hE3WRf/kujrD4ttcf0VLqo6xnLYVOQD6 kuvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LriOz2qF; 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 w14si2994038ejv.112.2019.10.10.05.47.57; Thu, 10 Oct 2019 05:48:21 -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=@kernel.org header.s=default header.b=LriOz2qF; 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 S2387954AbfJJMo4 (ORCPT + 99 others); Thu, 10 Oct 2019 08:44:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:49162 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733191AbfJJMo4 (ORCPT ); Thu, 10 Oct 2019 08:44:56 -0400 Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com [209.85.160.178]) (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 90E2220B7C; Thu, 10 Oct 2019 12:44:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570711495; bh=YMmXtb2JLA8hWzDQQfOgQycNtJFOok7eUnehOSyP+pA=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=LriOz2qFhwWE9p03RxfAw5yzayh07CQZffd0SfcdLfaXfS1Hb+hO+G+Ur4d8nIH2U YUi80UntVX2mzkp6yJoMMQACXHvwShAcvMC9S+12N4YJh/0pHQreeOohE4Q6wtkfZl DVaHHWkcbwGe2dd3mvLAoEPm1Dt2tS+Te6oBNxKI= Received: by mail-qt1-f178.google.com with SMTP id c21so8416191qtj.12; Thu, 10 Oct 2019 05:44:55 -0700 (PDT) X-Gm-Message-State: APjAAAWlJkM4VLHaTcCORsHsZm3X8OWfzZb/ex5imGi+ufwn7x2xELFT bAIfhqmGxtako1nHMXQ7cVVDu042JoIiNGnNdg== X-Received: by 2002:a0c:e606:: with SMTP id z6mr9343421qvm.135.1570711494582; Thu, 10 Oct 2019 05:44:54 -0700 (PDT) MIME-Version: 1.0 References: <20191009234648.2271-1-robh@kernel.org> In-Reply-To: From: Rob Herring Date: Thu, 10 Oct 2019 07:44:43 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] dt-bindings: riscv: Fix CPU schema errors To: Paul Walmsley Cc: Palmer Dabbelt , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" , Albert Ou , linux-riscv@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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. Rob