Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2239913pxb; Wed, 30 Mar 2022 20:23:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz91SlnNomeprZ/yHQ3QJT96wjwvRotDZBoDaN3dfHOz8ghnlTcwJ/oYOi/wGrfCxp9IHry X-Received: by 2002:a63:e041:0:b0:381:1bac:ac85 with SMTP id n1-20020a63e041000000b003811bacac85mr8966214pgj.380.1648696989404; Wed, 30 Mar 2022 20:23:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648696989; cv=none; d=google.com; s=arc-20160816; b=hfI81fHRXqpcv73REG7hj8CG4p3ELx3w9BVC+ABW17NT4JTPQVV1bCv18l7/9tm8j1 fxZJXrA31LtKlWMZrKrCiZFEBVqBmwIL8EVtylQliR4QK+M1zOCq4NtyEBC3V4Cz1qQE QselrEOzAe6an8iQhVnb+Ulujd0N2yR9Emr0CZwisnUXA9KR6bQmrjv3/pKmtcWKUhht sYQIOu5lIll6aMojr1yFz1loaJM0MnvY8iQjzJ+/t9Tbg9yUPI4Kh1wLT6hjBhhUkAXG hg3SgXYyPpbf+oVcgJlO2gNlofXEqUJWCpxNEaK5fBQbmjwn7vyvlgH39r97eyuQykZP xpzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=zquPOjyBPMGwHZHXFVz7r3s/ckD+y8qrWhoHpZCXsNs=; b=0wQ21Wbnp2B0tl6ANzBte4T4sc5Up4DVkQWy37oVPKU0UQOI7439JocvG7yy80ezpc a30tfWqmSKoW95Y2gV8oPfLBonG2URMyNMhrXEric0w907qUlfSod3jXNsoD6vdsCI41 nayWs1VkqP9z/jUshGWMPvfl3f3M6yFF2LWZKWAEXTkf2nJyJIo4TkUHHms8hdEQL9Sd RIkgeDV3PJ65qwN3BQnZM6F2WoxFkzD0Dd6alkekCAdf7JaOMzcHN4Rk6dz4zOGylXMi 1uYn5n9odxikULVAXK0DJIws7Eh/qFI1k9rwkd/2bFINDdDzwusgdgxqm9d5Ympg3e8A 2kkQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id b6-20020a170902e94600b00153b2d16401si24237567pll.9.2022.03.30.20.23.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Mar 2022 20:23:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 580FF114FC3; Wed, 30 Mar 2022 19:53:10 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345140AbiC3Qs0 (ORCPT + 99 others); Wed, 30 Mar 2022 12:48:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349089AbiC3QsI (ORCPT ); Wed, 30 Mar 2022 12:48:08 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E2CDA27971B for ; Wed, 30 Mar 2022 09:46:22 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id AC5341576; Wed, 30 Mar 2022 09:46:22 -0700 (PDT) Received: from [10.57.8.120] (unknown [10.57.8.120]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 07EAF3F66F; Wed, 30 Mar 2022 09:46:20 -0700 (PDT) Message-ID: <31fe187d-3997-73b7-3dfe-ded740e70567@arm.com> Date: Wed, 30 Mar 2022 17:46:19 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH 21/22] firmware: arm_scmi: Add SCMI v3.1 Perf power-cost in microwatts Content-Language: en-US To: Cristian Marussi Cc: sudeep.holla@arm.com, james.quinlan@broadcom.com, Jonathan.Cameron@Huawei.com, f.fainelli@gmail.com, etienne.carriere@linaro.org, vincent.guittot@linaro.org, souvik.chakravarty@arm.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20220330150551.2573938-1-cristian.marussi@arm.com> <20220330150551.2573938-22-cristian.marussi@arm.com> From: Lukasz Luba In-Reply-To: <20220330150551.2573938-22-cristian.marussi@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 3/30/22 16:05, Cristian Marussi wrote: > Add SCMIv3.1 internal support for parsing message attributes reporting > the capability of a performance domain to report power-cost in microwatts. > > Cc: Lukasz Luba > Signed-off-by: Cristian Marussi > --- > drivers/firmware/arm_scmi/perf.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c > index e1aa0ed67971..65ffda5495d6 100644 > --- a/drivers/firmware/arm_scmi/perf.c > +++ b/drivers/firmware/arm_scmi/perf.c > @@ -45,6 +45,7 @@ struct scmi_msg_resp_perf_attributes { > __le16 num_domains; > __le16 flags; > #define POWER_SCALE_IN_MILLIWATT(x) ((x) & BIT(0)) > +#define POWER_SCALE_IN_MICROWATT(x) ((x) & BIT(1)) > __le32 stats_addr_low; > __le32 stats_addr_high; > __le32 stats_size; > @@ -170,6 +171,7 @@ struct scmi_perf_info { > u32 version; > int num_domains; > bool power_scale_mw; > + bool power_scale_uw; > u64 stats_addr; > u32 stats_size; > struct perf_dom_info *dom_info; > @@ -200,6 +202,8 @@ static int scmi_perf_attributes_get(const struct scmi_protocol_handle *ph, > > pi->num_domains = le16_to_cpu(attr->num_domains); > pi->power_scale_mw = POWER_SCALE_IN_MILLIWATT(flags); > + if (PROTOCOL_REV_MAJOR(pi->version) >= 0x3) > + pi->power_scale_uw = POWER_SCALE_IN_MICROWATT(flags); > pi->stats_addr = le32_to_cpu(attr->stats_addr_low) | > (u64)le32_to_cpu(attr->stats_addr_high) << 32; > pi->stats_size = le32_to_cpu(attr->stats_size); LGTM, Reviewed-by: Lukasz Luba I'll send a follow-up patch which is using this information when this patch gets into linux-next.