Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3046585pxb; Fri, 12 Feb 2021 07:58:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJzNj0G/Z9K00UaUtJesKCSY1/XC5XA3CXehaoFr3Mnc3BOh5cuFpkuWQBzH9lWYlT1+dt66 X-Received: by 2002:aa7:de8f:: with SMTP id j15mr4128556edv.268.1613145482440; Fri, 12 Feb 2021 07:58:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613145482; cv=none; d=google.com; s=arc-20160816; b=TZZY+9lIp7zoSyBlldLKOMGqfaq0ciHB1V2NjYrHRzqZOuZhL0ilYbhbjrtpyP8e1w jJ5WWhkF7oAMg1HyDX0WxXC2L+A9n1vp+J07xz2/TkpFOvO4cqubCUus2iDyWRsHAgJt AZotg75lkv5rHRS0fwXX0lRB51bzSLgMTAmgBTBh8oJeNqvEdrLJemYhu/bzVmYsbMU9 5clLFmg6tQlNNJtEBRZFsjhi0Xx6MlWp5/rmO11V34lGJIusS75e75Mq8Rbj5YYNCM1d kJx8Zz/JJYcuJ10xH/RYPNOvz89VPu0GC5Mb1JFsC00QHv8Rw6DD5Hcfe+argbtKmsF0 dGxg== 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; bh=5hkgvMeCL8KgFHrlSi+ZPMQoYcV+scrqJ+oH5o6Hh20=; b=iNomD4Ryy3KcsD7cOgXZNrwLfoids/EhIowe3pp04wkl4r9z54wknMbQRIS39dF7f/ UpzNdLPZ6MyU/H2MCA6Jtfua/o8TUw/oftZVdsv7IHSs9zyVct2fKapunvfhRVPJqOu4 zkJj4dOjBzJpcQw4CHcUiP+5ljx7+Ar/f1bDysuiEm7HaIyoJ4e45YA9YyKTdgYjhefa 11BxNktm1/J17ZBWaEMTovFVpquMtn4DJsVYHfzkF8e9AxiGeMXMOw3Gdn/e24yoiyWT ilsS2jgjmrAs9XNkV4ATDuGUYVuG7SO1lYytjUSAka+Bb7Y8io4XmF55WUOXkNxqP5nf XCbw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ay19si6443674ejb.621.2021.02.12.07.57.36; Fri, 12 Feb 2021 07:58:02 -0800 (PST) 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; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231536AbhBLPz7 (ORCPT + 99 others); Fri, 12 Feb 2021 10:55:59 -0500 Received: from mail-ot1-f54.google.com ([209.85.210.54]:32942 "EHLO mail-ot1-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231611AbhBLPzl (ORCPT ); Fri, 12 Feb 2021 10:55:41 -0500 Received: by mail-ot1-f54.google.com with SMTP id c16so8804875otp.0; Fri, 12 Feb 2021 07:55:25 -0800 (PST) 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=5hkgvMeCL8KgFHrlSi+ZPMQoYcV+scrqJ+oH5o6Hh20=; b=XfsF+DfMdpAJvUJs/e2hyE46JPHbVXelp/iAK9yStBEQUKz8fVJcNn2+QuiqsxrdNn +KngmygnlgePT+XibX0IfQaXpCAkgnAW05fLt5b7xzL74gnpkYBavIU1qO9OIZNBWkHJ m+kE8hd3XUcb1/pd2S6LnBtfyhYP73ntj5j4WmH+mXZmckPHm2r18ShflqxKCtMUt0J8 JUTvgJb4f35l4h7CWIE3N+lGW2cAESGyGdPtltRm7nplRVVQlmKaFMYcSJcpwJwYSoXU 31hbSyjvbixvnFU+QRNlO1wP7Z5XoLY2t+3oGleYECRk3hVIza7jmMLl7LrDBvu9Ha6K QFNw== X-Gm-Message-State: AOAM5312WWmsK4a+oSzq1zIycpkD8fKgOQSB3g7d2TUepzoWygbLq9Oc QHfbiVL+lsgCIXRJfs3oHUD8pVjXZHn3Kv8MRsc= X-Received: by 2002:a05:6830:2106:: with SMTP id i6mr2391390otc.260.1613145298025; Fri, 12 Feb 2021 07:54:58 -0800 (PST) MIME-Version: 1.0 References: <20210123100608.2349629-1-yeyunfeng@huawei.com> In-Reply-To: <20210123100608.2349629-1-yeyunfeng@huawei.com> From: "Rafael J. Wysocki" Date: Fri, 12 Feb 2021 16:54:47 +0100 Message-ID: Subject: Re: [PATCH 1/2] powercap/intel_rapl: Use topology interface in rapl_add_package() To: Yunfeng Ye Cc: "Rafael J. Wysocki" , Linux PM , Linux Kernel Mailing List , hushiyuan@huawei.com, hewenliang4@huawei.com, caihongda@huawei.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jan 23, 2021 at 11:07 AM Yunfeng Ye wrote: > > It's not a good way to access phys_proc_id and cpu_die_id directly. > So using topology_physical_package_id(cpu) and topology_die_id(cpu) > instead. > > Signed-off-by: Yunfeng Ye > --- > drivers/powercap/intel_rapl_common.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/powercap/intel_rapl_common.c b/drivers/powercap/intel_rapl_common.c > index c9e57237d778..5f3d39b8212a 100644 > --- a/drivers/powercap/intel_rapl_common.c > +++ b/drivers/powercap/intel_rapl_common.c > @@ -1309,7 +1309,6 @@ struct rapl_package *rapl_add_package(int cpu, struct rapl_if_priv *priv) > { > int id = topology_logical_die_id(cpu); > struct rapl_package *rp; > - struct cpuinfo_x86 *c = &cpu_data(cpu); > int ret; > > if (!rapl_defaults) > @@ -1326,10 +1325,11 @@ struct rapl_package *rapl_add_package(int cpu, struct rapl_if_priv *priv) > > if (topology_max_die_per_package() > 1) > snprintf(rp->name, PACKAGE_DOMAIN_NAME_LENGTH, > - "package-%d-die-%d", c->phys_proc_id, c->cpu_die_id); > + "package-%d-die-%d", > + topology_physical_package_id(cpu), topology_die_id(cpu)); > else > snprintf(rp->name, PACKAGE_DOMAIN_NAME_LENGTH, "package-%d", > - c->phys_proc_id); > + topology_physical_package_id(cpu)); > > /* check if the package contains valid domains */ > if (rapl_detect_domains(rp, cpu) || rapl_defaults->check_unit(rp, cpu)) { > -- Applied along with the [2/2] with some minor changelog edits as 5.12 material. Thanks!