Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp427299pxf; Thu, 18 Mar 2021 04:04:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlVDWBCoOhe4Py4INmDr7/MOogfc/OCZz9ApjtGbtNHRtfPIgyUMAssSsyExcRoDDbz5Wp X-Received: by 2002:a17:906:1494:: with SMTP id x20mr40244812ejc.101.1616065468906; Thu, 18 Mar 2021 04:04:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616065468; cv=none; d=google.com; s=arc-20160816; b=snrTnxyTn5cYmfkGBS9boljoW2Xg9IzwNN6LBkBo4QV+Sr2spwJAo76FgIRdU2sqry +dhlHohiKnfbIN0DJR6zrNPxeKAw2tosCBOcZMLTEOIrIP5DSwoM0TpVkubpWtrNjncb YBYIdvgO/YEwx2SoqjNmOWpn/q4eZeXeigCQo2hEm25LAQD3LHP0Td4/LsVh+To7b44h 24gxWV5MKVR4r3DyOb4MKu2v5uafz4FbhlT0ppK0xCLaCfCJbtDMJ/FFxCUsZeqtDcqI 8rL9/eRVZCjgrc20XvtQWA6RdAnfsFtcuustQZnJZ0F2JWaRP60bLElZmuOwRHuu/wjQ /Muw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=RaGPtlv7SLOWssA/2OUjy96UMHcyvtNafHHhHgBI9nE=; b=Q7htFkj6odNRn5EQIibStWS5WvbFHkpcMNCpcFuMQiyYCKA7tlaZ2LadieT5mBsta0 EC28mP4Bxcqzpepu/y2an8SCLVULUoPsxCZHYEe/U/zyxVC4nxxEy9KzZcmRPauPShDe VwC4T7806khLMyArnnnZ3wHelX1/WTNe/r8diKJWP1N9aAKjjsJ/nG0V2uKtzBrr6ucO +znFmPohdbLzJNJDuFr5nP/a0er39Hm4rIfO67taDRUNxIYAnvV2a7S2dPh3UXBm5zKa UTsh15vX8ZOxbJ3pw+gr2EsYozSuMSK1DnYmIoaws61UFQADqoEsh3nqY2Ii/j6FJXdf yJjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=neqRkEFX; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hr30si1310721ejc.545.2021.03.18.04.04.05; Thu, 18 Mar 2021 04:04:28 -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=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=neqRkEFX; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230243AbhCRLCi (ORCPT + 99 others); Thu, 18 Mar 2021 07:02:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230369AbhCRLCb (ORCPT ); Thu, 18 Mar 2021 07:02:31 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 651A9C061760 for ; Thu, 18 Mar 2021 04:02:31 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id z2so5019239wrl.5 for ; Thu, 18 Mar 2021 04:02:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=RaGPtlv7SLOWssA/2OUjy96UMHcyvtNafHHhHgBI9nE=; b=neqRkEFXfZtkXLH4oNWGmf98m9VyR+4pLz7ASX4JlNjSA6r6ofaHXscCkatdoeYd5k aRfr5v8VAE6CtRo7HZlZ65DmqICPLY8kkVkihKsluSQcGn3SgGUB/o7MUze+ng08Hmv9 TL7LKIkxU0b33vA6ReNJYCye9qZjTPlI3wONrsLDAiiZddT4kebuRD9d+rRXJYQp2e3B PCIM9nQI6rC18zQbFtlhYEKgzxH0gE5q6MWOdX4RtQjHIGKgbWAZnz/v6PX23SyMKBvU /hAsigmRLuPntdq+nMH6jHjHw1/VWop6UFemTQ9ap7osnLB+t5QNs8ctn8ORhViD8nUg d+uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RaGPtlv7SLOWssA/2OUjy96UMHcyvtNafHHhHgBI9nE=; b=HWc1wzsVXzwsYMeFA1jX8j6DToZyGRoSrvAoOcOI9A3uJ1tJgH/85zCAIlAv2XFKm1 XvMQIXxTeVbJkZPU21qVMVpT8nxJ62VsZof1FKZOmPSz+eDF41ONbX44B037dTQJkeQW 5O86+chs1rXU90e5LKGHYIOoh1HCE6eySd7tsIrwX0P0VfTM9iVzmc1Gk3JkVctBBgYe b5kARjxk0SBgqO1tsivUt6fsPdmW8G+AopvBZoaaX7UaNa76uRcYYBhrKsbS2UmVyt5w rRVc5cUIP2+4XIiYChuzUxt1byf/tHYhcplaXmXcNxQti1Q6F0fQc9D757Uj9to9cbV5 fQDg== X-Gm-Message-State: AOAM5335opGJ8DjuwFGGwoyjcW6C0pflekcHB3YNnRZLgHV4I21dEc8o Zc1BRX0CPUZwt/+UBJaHNyfs1paxFbOg78xfhQAxnQ== X-Received: by 2002:a05:6000:250:: with SMTP id m16mr9289960wrz.325.1616065349871; Thu, 18 Mar 2021 04:02:29 -0700 (PDT) MIME-Version: 1.0 References: <20210221093758.210981-1-anup.patel@wdc.com> <20210221093758.210981-8-anup.patel@wdc.com> <20210305232245.GA820565@robh.at.kernel.org> In-Reply-To: From: Anup Patel Date: Thu, 18 Mar 2021 16:32:18 +0530 Message-ID: Subject: Re: [RFC PATCH 7/8] dt-bindings: Add bindings documentation for RISC-V idle states To: Rob Herring Cc: Anup Patel , Palmer Dabbelt , Palmer Dabbelt , Paul Walmsley , Albert Ou , Daniel Lezcano , Ulf Hansson , "Rafael J . Wysocki" , Pavel Machek , Sandeep Tripathy , Atish Patra , Alistair Francis , Liush , devicetree@vger.kernel.org, linux-riscv , "linux-kernel@vger.kernel.org List" , "open list:THERMAL" , linux-arm-kernel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 16, 2021 at 9:24 PM Rob Herring wrote: > > On Sun, Mar 7, 2021 at 8:18 PM Anup Patel wrote: > > > > On Sat, Mar 6, 2021 at 4:52 AM Rob Herring wrote: > > > > > > On Sun, Feb 21, 2021 at 03:07:57PM +0530, Anup Patel wrote: > > > > The RISC-V CPU idle states will be described in DT under the > > > > /cpus/riscv-idle-states DT node. This patch adds the bindings > > > > documentation for riscv-idle-states DT nodes and idle state DT > > > > nodes under it. > > > > > > > > Signed-off-by: Anup Patel > > > > --- > > > > .../bindings/riscv/idle-states.yaml | 250 ++++++++++++++++++ > > > > 1 file changed, 250 insertions(+) > > > > create mode 100644 Documentation/devicetree/bindings/riscv/idle-states.yaml > > > > > > > > diff --git a/Documentation/devicetree/bindings/riscv/idle-states.yaml b/Documentation/devicetree/bindings/riscv/idle-states.yaml > > > > new file mode 100644 > > > > index 000000000000..3eff763fed23 > > > > --- /dev/null > > > > +++ b/Documentation/devicetree/bindings/riscv/idle-states.yaml > > > > @@ -0,0 +1,250 @@ > > > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > > > > +%YAML 1.2 > > > > +--- > > > > +$id: http://devicetree.org/schemas/riscv/idle-states.yaml# > > > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > > > + > > > > +title: RISC-V idle states binding description > > > > + > > > > +maintainers: > > > > + - Anup Patel > > > > + > > > > +description: |+ > > > > + RISC-V systems can manage power consumption dynamically, where HARTs > > > > + (or CPUs) [1] can be put in different platform specific suspend (or > > > > + idle) states (ranging from simple WFI, power gating, etc). The RISC-V > > > > + SBI [2] hart state management extension provides a standard mechanism > > > > + for OSes to request HART state transitions. > > > > + > > > > + The platform specific suspend (or idle) states of a hart can be either > > > > + retentive or non-rententive in nature. A retentive suspend state will > > > > + preserve hart register and CSR values for all privilege modes whereas > > > > + a non-retentive suspend state will not preserve hart register and CSR > > > > + values. The suspend (or idle) state entered by executing the WFI > > > > + instruction is considered standard on all RISC-V systems and therefore > > > > + must not be listed in device tree. > > > > + > > > > + The device tree binding definition for RISC-V idle states described > > > > + in this document is quite similar to the ARM idle states [3]. > > > > + > > > > + References > > > > + > > > > + [1] RISC-V Linux Kernel documentation - CPUs bindings > > > > + Documentation/devicetree/bindings/riscv/cpus.yaml > > > > + > > > > + [2] RISC-V Supervisor Binary Interface (SBI) > > > > + http://github.com/riscv/riscv-sbi-doc/riscv-sbi.adoc > > > > + > > > > + [3] ARM idle states binding description - Idle states bindings > > > > + Documentation/devicetree/bindings/arm/idle-states.yaml > > > > > > I'd assume there's common parts we can share. > > > > Yes, except few properties most are the same. > > > > We can have a shared DT bindings for both ARM and RISC-V but > > both architectures will always have some architecture specific details > > (or properties) which need to be documented under arch specific > > DT documentation. Is it okay if this is done as a separate series ? > > No... Okay, I will create a common DT bindings for both ARM and RISC-V in the next revision. > > > > > + > > > > +properties: > > > > + $nodename: > > > > + const: riscv-idle-states > > > > > > Just 'idle-states' like Arm. > > > > I had tried "idle-states" node name but DT bindings check complaints > > conflict with ARM idle state bindings. > > ...and this being one reason why. > > Actually, I think this can all be in 1 doc if you want. It's fine with > me if a common doc has RiscV and Arm specific properties. Sure, will add common DT bindings. > > > > > + > > > > +patternProperties: > > > > + "^(cpu|cluster)-": > > > > + type: object > > > > + description: | > > > > + Each state node represents an idle state description and must be > > > > + defined as follows. > > > > + > > > > > > additionalProperties: false > > > > okay, will update. > > > > > > > > > + properties: > > > > + compatible: > > > > + const: riscv,idle-state > > > > + > > > > + local-timer-stop: > > > > + description: > > > > + If present the CPU local timer control logic is lost on state > > > > + entry, otherwise it is retained. > > > > + type: boolean > > > > + > > > > + entry-latency-us: > > > > + description: > > > > + Worst case latency in microseconds required to enter the idle state. > > > > + > > > > + exit-latency-us: > > > > + description: > > > > + Worst case latency in microseconds required to exit the idle state. > > > > + The exit-latency-us duration may be guaranteed only after > > > > + entry-latency-us has passed. > > > > + > > > > + min-residency-us: > > > > + description: > > > > + Minimum residency duration in microseconds, inclusive of preparation > > > > + and entry, for this idle state to be considered worthwhile energy > > > > + wise (refer to section 2 of this document for a complete description). > > > > + > > > > + wakeup-latency-us: > > > > + description: | > > > > + Maximum delay between the signaling of a wake-up event and the CPU > > > > + being able to execute normal code again. If omitted, this is assumed > > > > + to be equal to: > > > > + > > > > + entry-latency-us + exit-latency-us > > > > + > > > > + It is important to supply this value on systems where the duration > > > > + of PREP phase (see diagram 1, section 2) is non-neglibigle. In such > > > > + systems entry-latency-us + exit-latency-us will exceed > > > > + wakeup-latency-us by this duration. > > > > + > > > > + idle-state-name: > > > > + $ref: /schemas/types.yaml#/definitions/string > > > > + description: > > > > + A string used as a descriptive name for the idle state. > > > > + > > > > + required: > > > > + - compatible > > > > + - entry-latency-us > > > > + - exit-latency-us > > > > + - min-residency-us > > > > + > > > > +additionalProperties: false > > > > I will move this up. > > TBC, you need this at 2 levels. Both the idle-states node and child nodes. Sure, I will add at both levels. Regards, Anup