Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp728049rwl; Fri, 7 Apr 2023 04:41:05 -0700 (PDT) X-Google-Smtp-Source: AKy350YCoe5Tu0IFtDJsxq1B5slfY0ihQQP+JIlPcruRmouJ2BpBB48NwfG1h0JBzI3P8D4oEcC7 X-Received: by 2002:a17:902:d4d1:b0:1a0:57dd:b340 with SMTP id o17-20020a170902d4d100b001a057ddb340mr2948378plg.64.1680867664920; Fri, 07 Apr 2023 04:41:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680867664; cv=none; d=google.com; s=arc-20160816; b=v0//OMTGobPlr4u293WyPbQN0rba/yz4yFKO6XmVSs+xu4YG0OV1Zz+yIb8vPUun06 NS00cXVX56BWgv2kwemnFT2LT6GQs/jx3YSOfssWHYQp3Yb8NwrB5NQ+qJrx1byAb3sn 3AQGQ5Pvk/9U0IahNf4VtFRfOn7QSgMB7vhUcLdrNEpzcCf7Eq7Lq54IzElBkqZLBn8m jg+EgOYjDWl5kjOyrTaYCr9svpJGSqN1IZpyuP+qGCzAZGNeNVAVz58lCtRt4yQa2JEZ HWWdaXiCQHtOBkKZVT6InihK99O+Mdf2AeGtxlCjaFHr3x4s19mf/T7V66ArKOfHvrHL z1fw== 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; bh=l50SDMurymn3jTF19YkGXiVwGkYXHMgGj76fyLK6Md4=; b=wb2hbPhvA8QPpbsCX8JRor6RG9RKe+w8+m7c+Ft6Tnu7bAG2+tvk1xBHwZDDTB/xtu ploTCi8qURTfReNLML8k4PNds503+xK95Nzkyx/ybTPPvly08k2ZeizzVdPTZo9w/wcE TcVcvALwSfS+e5byc3+58J5PyWKcFo7TaVp0m38QCwQofVp6PJigIw+p6pQACZA+Ao1y WvD8XzQJlzI7IstofvCnJ2DjQlg+pVnbUniTom2kfg9fxR9mReEr0CyKj7lGLb/WVGTk Akuq4krk1Q4R0OvZesWXQf2VS9eb/jGwA9JiNAeWMf+i+L/X7DfAffzkSoI41E/zL+wH gVfA== 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:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w189-20020a6382c6000000b00513fd21728csi3596328pgd.463.2023.04.07.04.40.53; Fri, 07 Apr 2023 04:41:04 -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; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232114AbjDGLkd convert rfc822-to-8bit (ORCPT + 99 others); Fri, 7 Apr 2023 07:40:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229437AbjDGLkc (ORCPT ); Fri, 7 Apr 2023 07:40:32 -0400 Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6840959EA; Fri, 7 Apr 2023 04:40:31 -0700 (PDT) Received: by mail-ej1-f47.google.com with SMTP id jw24so7813076ejc.3; Fri, 07 Apr 2023 04:40:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680867630; 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=owpG5rT95/qTePvvHQtyxBU+QgYYNRhwqWGHnVy5pPc=; b=17Q8T0LO/H5LNBLh2tliB5try5iJiVLC4rG/IxVj48Y7mNz+3fdL73lcvJJVb0r58B qhKNRyo6ji1QwI4Z+Cxt5p7/qNdAdvFdXGqViwtyi/M64GdLjONPtLjpk0dRUM9WqiCJ 0DBuWb3DvrDtCRVaWSa0fFM7US1Yx4emvMuwCics8ePaaiRLr8w2Tmjtr/uzUQ1oL6g/ EIYM0cdmrMxuE1+ntEbkqvJGei7qTFg8g/B+48C+7B9QX23s5LORaGhAOy8+wtmwcVSv 8xNOo1+NCQEjn4OYjnce/O6qmrRE3khOdrivMsgcPHCod6zOZC/2oFR6YZrUFQ1KxH0d Zy5g== X-Gm-Message-State: AAQBX9eNVUv6bLfHEm6v8TCu9t0k+732HBhRq5jZqU9/jyaHGf9iYl4d ttHn3DwwLFugeZNrfwzR88o0Dd2jAoHXwUnDKDs= X-Received: by 2002:a17:906:802:b0:8b1:3298:c587 with SMTP id e2-20020a170906080200b008b13298c587mr1005588ejd.2.1680867629669; Fri, 07 Apr 2023 04:40:29 -0700 (PDT) MIME-Version: 1.0 References: <20230316153841.3666-1-rui.zhang@intel.com> <20230316153841.3666-8-rui.zhang@intel.com> In-Reply-To: <20230316153841.3666-8-rui.zhang@intel.com> From: "Rafael J. Wysocki" Date: Fri, 7 Apr 2023 13:40:18 +0200 Message-ID: Subject: Re: [PATCH 07/15] powercap/intel_rapl: Change primitive order To: Zhang Rui Cc: linux-pm@vger.kernel.org, rafael.j.wysocki@intel.com, daniel.lezcano@linaro.org, linux-kernel@vger.kernel.org, srinivas.pandruvada@intel.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=0.5 required=5.0 tests=FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS 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 Thu, Mar 16, 2023 at 4:42 PM Zhang Rui wrote: > > Move POWER_LIMIT1/POWER_LIMIT2/POWER_LIMIT4 to the beginning of enum > rapl_primitives so that they can be reused to represent different Power > Limits. The meaning of the above is a bit unclear without reverse engineering the rest of the series. > No functional change. > > Signed-off-by: Zhang Rui > --- > drivers/powercap/intel_rapl_common.c | 4 ++-- > include/linux/intel_rapl.h | 5 +++-- > 2 files changed, 5 insertions(+), 4 deletions(-) > > diff --git a/drivers/powercap/intel_rapl_common.c b/drivers/powercap/intel_rapl_common.c > index 9e29e56f4900..3a8940d3bec8 100644 > --- a/drivers/powercap/intel_rapl_common.c > +++ b/drivers/powercap/intel_rapl_common.c > @@ -631,14 +631,14 @@ static u64 rapl_unit_xlate(struct rapl_domain *rd, enum unit_type type, > > static struct rapl_primitive_info rpis_default[NR_RAPL_PRIMITIVES] = { > /* name, mask, shift, msr index, unit divisor */ > - [ENERGY_COUNTER] = PRIMITIVE_INFO_INIT(ENERGY_COUNTER, ENERGY_STATUS_MASK, 0, > - RAPL_DOMAIN_REG_STATUS, ENERGY_UNIT, 0), > [POWER_LIMIT1] = PRIMITIVE_INFO_INIT(POWER_LIMIT1, POWER_LIMIT1_MASK, 0, > RAPL_DOMAIN_REG_LIMIT, POWER_UNIT, 0), > [POWER_LIMIT2] = PRIMITIVE_INFO_INIT(POWER_LIMIT2, POWER_LIMIT2_MASK, 32, > RAPL_DOMAIN_REG_LIMIT, POWER_UNIT, 0), > [POWER_LIMIT4] = PRIMITIVE_INFO_INIT(POWER_LIMIT4, POWER_LIMIT4_MASK, 0, > RAPL_DOMAIN_REG_PL4, POWER_UNIT, 0), > + [ENERGY_COUNTER] = PRIMITIVE_INFO_INIT(ENERGY_COUNTER, ENERGY_STATUS_MASK, 0, > + RAPL_DOMAIN_REG_STATUS, ENERGY_UNIT, 0), > [FW_LOCK] = PRIMITIVE_INFO_INIT(FW_LOCK, POWER_LOW_LOCK, 31, > RAPL_DOMAIN_REG_LIMIT, ARBITRARY_UNIT, 0), > [PL1_ENABLE] = PRIMITIVE_INFO_INIT(PL1_ENABLE, POWER_LIMIT1_ENABLE, 15, > diff --git a/include/linux/intel_rapl.h b/include/linux/intel_rapl.h > index 1648923f694d..856b739fd194 100644 > --- a/include/linux/intel_rapl.h > +++ b/include/linux/intel_rapl.h > @@ -37,10 +37,10 @@ enum rapl_domain_reg_id { > struct rapl_domain; > > enum rapl_primitives { > - ENERGY_COUNTER, > POWER_LIMIT1, > POWER_LIMIT2, > POWER_LIMIT4, > + ENERGY_COUNTER, > FW_LOCK, > > PL1_ENABLE, /* power limit 1, aka long term */ > @@ -75,7 +75,8 @@ struct rapl_domain_data { > unsigned long timestamp; > }; > > -#define NR_POWER_LIMITS (3) > +#define NR_POWER_LIMITS (POWER_LIMIT4 + 1) > + > struct rapl_power_limit { > struct powercap_zone_constraint *constraint; > int prim_id; /* primitive ID used to enable */ > -- > 2.25.1 >