Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp4990669rwb; Tue, 8 Aug 2023 18:16:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHGg4xlY0qcKtKiK7pth144y0+5+JoL9OXbcIcSwxh+n8fnwAAbKLW2/5vWmvvkNyS44zoX X-Received: by 2002:a05:6a00:138b:b0:668:81c5:2f8d with SMTP id t11-20020a056a00138b00b0066881c52f8dmr1406055pfg.3.1691543777499; Tue, 08 Aug 2023 18:16:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691543777; cv=none; d=google.com; s=arc-20160816; b=N38mINrZilrI0POzEHhCSm2p6ADll+UKqZA5JR5gsfAhHyoVBa5lTYmydVYa0hyz0c YPsLGzdRQ0OKL1pcv7q6La/jptRfgZN53TTk3kRJ3mUGD0TME4lwSKUgkf2iQRP4EIO8 uBEBCf9NjLvjXZ2C5CVcJkpUmsskwAmsmSANSFQNZIoLEIIpeSljj1PArcE+3ajL/ERY HG4r4ZlYm9l4ksQVehQHTfhe/DOYGPkVOKsSI8jBCyAOa5YxUamFQrHa09wRrTZwg9XL hU4xviXVe1/0vQUolu7sGF+0Sd/olMjFStVukpRCrwwZ1+/cv1MgoOlITDE1UcAOVfU2 Ghdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=ybrZnDbgYV2MwIPZtu+U0IzC9LJv7CzD1PxMpELINSU=; fh=5R/JAogt2XPUn2V4pg4HJFyD1ijFa+cDG4ITjTpWsQM=; b=bdSkV7A+5iUG3p99x2MPRW+NoBoQ8cwC+ujjYXq1g5YRhNWGp8fO2pFkdCxvqB9fBu +/B9ash6VgVhey4wD0xOkdwwP4BhZLJTQBqEUSeK9REll+lDkjG41r3x2QdpFUyeQmh0 ZlJsiMqoJvcI4qZXDkhflOFkXJxV3mPteeimdnYwqe+OMvFGkwbQuRdnwweCGYynzA1q 6gRaqZtBbxy5hlqm8MZm6qAgJEbYALJ5Z6CzXdNOVq0hcFtjIYubIBFSb3ZKjP12RTJs MM7dD0bjCz2XPK5b8fhiuzY50TgUmpfhp6KxFTdLo/ls3YCFU4l7pFjb54qGIfB7o6y2 HBcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=aMwJXFbr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j186-20020a638bc3000000b00563e6387a54si3022581pge.258.2023.08.08.18.16.03; Tue, 08 Aug 2023 18:16:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=aMwJXFbr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230423AbjHHXcL (ORCPT + 99 others); Tue, 8 Aug 2023 19:32:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230337AbjHHXcJ (ORCPT ); Tue, 8 Aug 2023 19:32:09 -0400 Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C86D2106 for ; Tue, 8 Aug 2023 16:31:56 -0700 (PDT) Received: by mail-qt1-x836.google.com with SMTP id d75a77b69052e-40a47e8e38dso65231cf.1 for ; Tue, 08 Aug 2023 16:31:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1691537515; x=1692142315; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ybrZnDbgYV2MwIPZtu+U0IzC9LJv7CzD1PxMpELINSU=; b=aMwJXFbrvKiYplgT0ZoUattM4tCbFAQNM7l8wXmr5y/wPARKhQyMWR4mSHh6e/eFZJ qY9HGaUw1Lix/yNrm/HZozusP33qwdsvaPQvUJviG6hJW/CAwF5GsVBHkLd8VwKeDn0e a3zKyx4ajzDUSk4TQbTMev2hmQn8KPbs+AepcU6BXdMPImJG7naUoGFgkyrQYf6+8qSY g2jPHEhWGXB0g1TMj39NMngTxNgj41jWymb48XnIgnTA8gLOvXbqW4cRKn/6N6BhjReG OmGqHeXL6IoJJFfAJDXluOr8jGNcuIsQH8M4wVl6S2muVNRyQ7mBesn5MM7K6KtK/1in JDHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691537515; x=1692142315; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ybrZnDbgYV2MwIPZtu+U0IzC9LJv7CzD1PxMpELINSU=; b=joOOATan87a10Ru93jDGSm9v5XRtUGojn9w3V2PFGxp/JhZsdH3zl273A2oPQ4V/ye fboKi+Ea99S4EbDoMXve/vQdRtZukBq42KcJ8IJ1835E31vHFHrVZeSoFlysPe4im/zT jEpmRYC/EcDJe1aCFPLcG17HgdMhRNmvIsT3G3Ot1MGCL/jH6PnbHmbdMQYYIIg9b4rq aiXv0YQnmj7Wg/E10BL8dHAREhRZYclUQoTnQ3MuFJGwlbXkm7RGAuOR4lwIQuNxpxmR f11KGJ8pyicNnGqztFWSou8GNdOiwHzes+kYp5/++kJNYUsG69kgA0feqjfrUU8MeOfy fzAg== X-Gm-Message-State: AOJu0Yx/NX6ju//TQnD0fBIdHeeRsXrXOdEUnAm8YRbfjsDUDi+0QFKT J4w5iBpbcvqpfpkUeUPalh9DwNxBu40Kkm4J43CHkw== X-Received: by 2002:ac8:5c09:0:b0:3f8:5b2:aef0 with SMTP id i9-20020ac85c09000000b003f805b2aef0mr116002qti.24.1691537515078; Tue, 08 Aug 2023 16:31:55 -0700 (PDT) MIME-Version: 1.0 References: <20230731174613.4133167-1-davidai@google.com> <20230731174613.4133167-2-davidai@google.com> In-Reply-To: From: Saravana Kannan Date: Tue, 8 Aug 2023 16:31:19 -0700 Message-ID: Subject: Re: [PATCH v3 1/2] dt-bindings: cpufreq: add bindings for virtual cpufreq To: Krzysztof Kozlowski Cc: David Dai , "Rafael J. Wysocki" , Viresh Kumar , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sudeep Holla , Quentin Perret , Masami Hiramatsu , Will Deacon , Peter Zijlstra , Vincent Guittot , Marc Zyngier , Oliver Upton , Dietmar Eggemann , Pavan Kondeti , Gupta Pankaj , Mel Gorman , kernel-team@android.com, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Aug 5, 2023 at 12:38=E2=80=AFPM Krzysztof Kozlowski wrote: > > On 31/07/2023 19:46, David Dai wrote: > > Adding bindings to represent a virtual cpufreq device. > > > > Virtual machines may expose MMIO regions for a virtual cpufreq device f= or > > guests to read frequency information or to request frequency selection.= The > > virtual cpufreq device has an individual controller for each CPU. > > A nit, subject: drop second/last, redundant "bindings for". The > "dt-bindings" prefix is already stating that these are bindings. > > > > > Co-developed-by: Saravana Kannan > > Signed-off-by: Saravana Kannan > > Signed-off-by: David Dai > > --- > > .../bindings/cpufreq/cpufreq-virtual.yaml | 89 +++++++++++++++++++ > > 1 file changed, 89 insertions(+) > > create mode 100644 Documentation/devicetree/bindings/cpufreq/cpufreq-v= irtual.yaml > > > > diff --git a/Documentation/devicetree/bindings/cpufreq/cpufreq-virtual.= yaml b/Documentation/devicetree/bindings/cpufreq/cpufreq-virtual.yaml > > new file mode 100644 > > index 000000000000..f377cfc972ca > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/cpufreq/cpufreq-virtual.yaml > > @@ -0,0 +1,89 @@ > > +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/cpufreq/cpufreq-virtual.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yamll# > > + > > +title: Virtual CPUFreq > > + > > +maintainers: > > + - David Dai > > + - Saravana Kannan > > + > > +description: > > + Virtual CPUFreq is a virtualized driver in guest kernels that sends = frequency > > + selection of its vCPUs as a hint to the host through MMIO regions. T= he host > > + uses the hint to schedule vCPU threads and select physical CPU frequ= ency. It > > + enables accurate Per-Entity Load Tracking for tasks running in the g= uest by > > + querying host CPU frequency unless a virtualized FIE (ex. AMU) exist= s. > > Why do you need DT for this? You control hypervisor, thus control the > interface to the guest. I think Rob made it pretty clear that > discoverable usecases (which is yours) are not for DT. > > Incomplete style-review follows: > > > + > > +properties: > > + compatible: > > + const: virtual,cpufreq > > Missing blank line. > > > + reg: > > + maxItems: 1 > > + > > +required: > > + - compatible > > + - reg > > + > > +additionalProperties: false > > + > > +examples: > > + - | > > + cpus { > > + #address-cells =3D <1>; > > + #size-cells =3D <0>; > > + > > + cpu@0 { > > + compatible =3D "arm,arm-v8"; > > + device_type =3D "cpu"; > > + reg =3D <0x0>; > > + operating-points-v2 =3D <&opp_table0>; > > + }; > > + > > + cpu@1 { > > + compatible =3D "arm,arm-v8"; > > + device_type =3D "cpu"; > > + reg =3D <0x0>; > > + operating-points-v2 =3D <&opp_table1>; > > + }; > > + }; > > + > > + opp_table0: opp-table-0 { > > + compatible =3D "operating-points-v2"; > > + > > + opp1098000000 { > > + opp-hz =3D /bits/ 64 <1098000000>; > > + opp-level =3D <1>; > > + }; > > + > > + opp1197000000 { > > + opp-hz =3D /bits/ 64 <1197000000>; > > + opp-level =3D <2>; > > + }; > > + }; > > + > > + opp_table1: opp-table-1 { > > + compatible =3D "operating-points-v2"; > > + > > + opp1106000000 { > > + opp-hz =3D /bits/ 64 <1106000000>; > > + opp-level =3D <1>; > > + }; > > + > > + opp1277000000 { > > + opp-hz =3D /bits/ 64 <1277000000>; > > + opp-level =3D <2>; > > + }; > > + }; > > + > > + soc { > > + #address-cells =3D <1>; > > + #size-cells =3D <1>; > > + > > + cpufreq { > > Missing unit address > > > + reg =3D <0x1040000 0x10>; > > + compatible =3D "virtual,cpufreq"; > > compatible is always the first property. > > Also, you did not test it... Why do you say this? This patch series was obviously tested very well with all the data we collected. -Saravana