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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3258C001DB for ; Sat, 5 Aug 2023 19:38:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230303AbjHETil (ORCPT ); Sat, 5 Aug 2023 15:38:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbjHETik (ORCPT ); Sat, 5 Aug 2023 15:38:40 -0400 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF5A81BE4 for ; Sat, 5 Aug 2023 12:38:38 -0700 (PDT) Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-3fbc63c2e84so32646355e9.3 for ; Sat, 05 Aug 2023 12:38:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1691264317; x=1691869117; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=udk/H8ZgKjfvJwnE+xho4EfEOftvGT0VCYsBYpwRNHo=; b=yD2hT0N3zrlPlop4QxmCW16DXc/kWC/8YNFcGOeKehecVojM3ba0Zd39mtHn989C3X R7oqj1lpmK9PjbFsklJF8XvKM9o8RwvldDEqrpxtJrh3IquXPVxUqYEGuiDzMB7BhQHr up6Glj+7T9fB3Pt3eOshXohaxyb02FtrVfrHOLLU5gIXEGoEjg4cC53wOPQaez0p8EDf 2L/1awLEnbUYyc2mft6VCHoN7EkruHhgoiWAUX9d0eVHEKjE77AIX/0pbvPjiK1JFvEj 365QLUclpMw2AZrOh5OHpPnyul9NRliEfYwFpGcgw/OK9XH7zq9pzgZrGfIEg0bsiRG1 Wjqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691264317; x=1691869117; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=udk/H8ZgKjfvJwnE+xho4EfEOftvGT0VCYsBYpwRNHo=; b=ZFKbu78h4eg94PB4KC9B84brTPMqCsEihaVfhJEJk7ju6KFKgnBtxMb9YNuB7g62zJ DAqRnipc6teWatZyifygDCmhu3mH9wxSsJatPl1m778qAohgFa2esTkqZaJ/5X+73Ra4 AOZHOpgPR80RH331dmjKQIL7anNKMHWUvq3ozX0XtojtDfD1IkSasoBJ0ptWuw1vMFgK qY7d54f1iqenEbJ8pW0yuOVCDQ+ms/puCqWJoKPMrOacRKpEgMqe64zx/j8CfGG9Jr4m vv3M6oyP1qTJ6bDiuKQ4cX3S/0yL3wFhDBOXp07+Lyec7EgbqH+69EpsEQqpKcUZilxb QM0w== X-Gm-Message-State: AOJu0YyxulL3X/MxJGzQZ9HzYQAIg7RgdkPWqaI8dSaieF5WXiSr2SK4 2uO8aN2cfipTcO8Avn7hGfBLIA== X-Google-Smtp-Source: AGHT+IGvrlUd0YfuF3G0qhIxdGb5wiPGOR1jc4ZfaV/DTwfKyUOEYr8f52aMWDJdfJaCv83Yo1cWYQ== X-Received: by 2002:a1c:4b0e:0:b0:3fb:b530:a4e4 with SMTP id y14-20020a1c4b0e000000b003fbb530a4e4mr4361705wma.8.1691264317315; Sat, 05 Aug 2023 12:38:37 -0700 (PDT) Received: from [192.168.1.20] ([178.197.222.245]) by smtp.gmail.com with ESMTPSA id z12-20020a05600c220c00b003fe1ca92151sm5752252wml.26.2023.08.05.12.38.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 05 Aug 2023 12:38:36 -0700 (PDT) Message-ID: Date: Sat, 5 Aug 2023 21:38:34 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: Re: [PATCH v3 1/2] dt-bindings: cpufreq: add bindings for virtual cpufreq Content-Language: en-US To: David Dai , "Rafael J. Wysocki" , Viresh Kumar , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sudeep Holla , Saravana Kannan Cc: 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 References: <20230731174613.4133167-1-davidai@google.com> <20230731174613.4133167-2-davidai@google.com> From: Krzysztof Kozlowski In-Reply-To: <20230731174613.4133167-2-davidai@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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 for > 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-virtual.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. The host > + uses the hint to schedule vCPU threads and select physical CPU frequency. It > + enables accurate Per-Entity Load Tracking for tasks running in the guest by > + querying host CPU frequency unless a virtualized FIE (ex. AMU) exists. 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 = <1>; > + #size-cells = <0>; > + > + cpu@0 { > + compatible = "arm,arm-v8"; > + device_type = "cpu"; > + reg = <0x0>; > + operating-points-v2 = <&opp_table0>; > + }; > + > + cpu@1 { > + compatible = "arm,arm-v8"; > + device_type = "cpu"; > + reg = <0x0>; > + operating-points-v2 = <&opp_table1>; > + }; > + }; > + > + opp_table0: opp-table-0 { > + compatible = "operating-points-v2"; > + > + opp1098000000 { > + opp-hz = /bits/ 64 <1098000000>; > + opp-level = <1>; > + }; > + > + opp1197000000 { > + opp-hz = /bits/ 64 <1197000000>; > + opp-level = <2>; > + }; > + }; > + > + opp_table1: opp-table-1 { > + compatible = "operating-points-v2"; > + > + opp1106000000 { > + opp-hz = /bits/ 64 <1106000000>; > + opp-level = <1>; > + }; > + > + opp1277000000 { > + opp-hz = /bits/ 64 <1277000000>; > + opp-level = <2>; > + }; > + }; > + > + soc { > + #address-cells = <1>; > + #size-cells = <1>; > + > + cpufreq { Missing unit address > + reg = <0x1040000 0x10>; > + compatible = "virtual,cpufreq"; compatible is always the first property. Also, you did not test it... Best regards, Krzysztof