Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp1523103ybm; Thu, 23 May 2019 02:28:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqyrRu66M6Fi0PcOIQ5fkywauZCHXMvgPEvXzZ2MznNVpXkB27kaXtMV7DMJq1At63h+IetW X-Received: by 2002:a65:6543:: with SMTP id a3mr69722015pgw.300.1558603705837; Thu, 23 May 2019 02:28:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558603705; cv=none; d=google.com; s=arc-20160816; b=nJBeVyBuTxq6jmLa4t6UldlP8Zc3i/BVuC0sDPnkEIvYp7zX8XonjTOG2sQKKo16LV funQnGrXWMLGjF78oOoKyPomcafajFS+ryRt1R+s7qqFlr2jp7uJOhvmz2tdy8WKiqWb ASA5xKHc/s1TYb3/+hAQkQpqJqooOy9y3ZVbatAJ8IpqRCV18EOeTkC49VAEl9SuLqVh eNZCV1NHGGddzIvugQ4jV1exojox/jfLOfqQfW52gFfKOpVQvJO9ovAYL6gRBFccjpcn kM6lQgXHXxkuYZEj0Bd+c6+8yt/3Hxi++42090fX7PTNmirSTzKIL085ctH9sNZ7u8VN 07GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:dkim-signature:dkim-filter; bh=PzWiXWbuZBSOSkVnmtdtZG78MA42jnTVqc1lbPq3Ihg=; b=wknYjmwz1H6WnOIuufRYSSowgq+RDd94py/j4jY92vapnMJJiqXE4ss5xRQQPE8zEY kMl4dSKtDCk4mGRn6CcoBeJZM3Y/Dp5AHCEB92Sv6ezKPJT9z3F7z/6mqCerMkzvz9dO 3UEvMI369g1A6PA3t+px2RSvB5kJoc07PDKAvgfB4MppFob48NXTEwBbN3tvGz7+RbqG UD9HgWGeOjQe/JDMTFJ34KKDwXqEGM60xX/N+akIrxzfasP/othJJKuGIobX+WajRKj9 v0DUtozRCzlTk1mTlFBb8jQNJVbMdNktKiEmQw10mzK7Ro+sArLzD46GRBgGnZduSo5B 2RUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2019051801 header.b=pS7uVPzC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 88si28830438plf.293.2019.05.23.02.28.11; Thu, 23 May 2019 02:28:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@zytor.com header.s=2019051801 header.b=pS7uVPzC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730250AbfEWJ1G (ORCPT + 99 others); Thu, 23 May 2019 05:27:06 -0400 Received: from terminus.zytor.com ([198.137.202.136]:45249 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726429AbfEWJ1G (ORCPT ); Thu, 23 May 2019 05:27:06 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x4N9QuRG4041804 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 23 May 2019 02:26:56 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 terminus.zytor.com x4N9QuRG4041804 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019051801; t=1558603616; bh=PzWiXWbuZBSOSkVnmtdtZG78MA42jnTVqc1lbPq3Ihg=; h=Date:From:Cc:Reply-To:In-Reply-To:References:To:Subject:From; b=pS7uVPzCi1kxl2D2vUpzGbJq3p9hrXiAkIWTPsGdyZSPExwd72uNFbo5hGYhXRHOg o64+3ZXCUtqXhCnkicTq6n6cubVMZ8Vjt7O0cKuB3oXmCo/ChOywzuZcVH0oDBVGoI wXM0uVH0GNEO9fVYMqPgTk8zv1Pr2BUWdtOyjPHefBFnyWo5YS1TupwZZt/1tW0X8t XFxGhoFs16PwRXCnKOOYT99BqR5S7iq6feFSpHRmPb/rywjmm+c4G7FC8lIFF8m4xP 0Ob4HK4aOtWyt8YRK5DLpxRCPQhVDHl9dqewiLet0MAN8/6meeFgc3WTRkAMgFdBkk VtnA6xrJgUdYA== Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x4N9Qta54041801; Thu, 23 May 2019 02:26:55 -0700 Date: Thu, 23 May 2019 02:26:55 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Zhang Rui Message-ID: Cc: peterz@infradead.org, rafael.j.wysocki@intel.com, hpa@zytor.com, rui.zhang@intel.com, tglx@linutronix.de, mingo@kernel.org, linux-kernel@vger.kernel.org, len.brown@intel.com Reply-To: rafael.j.wysocki@intel.com, hpa@zytor.com, peterz@infradead.org, len.brown@intel.com, mingo@kernel.org, linux-kernel@vger.kernel.org, rui.zhang@intel.com, tglx@linutronix.de In-Reply-To: <9fcb4719aeb7efccf3bc75ed8dd559e46121649f.1557769318.git.len.brown@intel.com> References: <9fcb4719aeb7efccf3bc75ed8dd559e46121649f.1557769318.git.len.brown@intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/topology] powercap/intel_rapl: Support multi-die/package Git-Commit-ID: 32fb480e0a2cf1f71e4174d6477198c94dbc746c X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-3.1 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, T_DATE_IN_FUTURE_96_Q autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 32fb480e0a2cf1f71e4174d6477198c94dbc746c Gitweb: https://git.kernel.org/tip/32fb480e0a2cf1f71e4174d6477198c94dbc746c Author: Zhang Rui AuthorDate: Mon, 13 May 2019 13:58:51 -0400 Committer: Thomas Gleixner CommitDate: Thu, 23 May 2019 10:08:32 +0200 powercap/intel_rapl: Support multi-die/package RAPL "package" domains are actually implemented in hardware per-die. Thus, the new multi-die/package systems have mulitple domains within each physical package. Update the intel_rapl driver to be "die aware" -- exporting multiple domains within a single package, when present. No change on single die/package systems. Signed-off-by: Zhang Rui Signed-off-by: Len Brown Signed-off-by: Thomas Gleixner Reviewed-by: Ingo Molnar Acked-by: Rafael J. Wysocki Acked-by: Peter Zijlstra (Intel) Cc: linux-pm@vger.kernel.org Link: https://lkml.kernel.org/r/9fcb4719aeb7efccf3bc75ed8dd559e46121649f.1557769318.git.len.brown@intel.com --- drivers/powercap/intel_rapl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/powercap/intel_rapl.c b/drivers/powercap/intel_rapl.c index 3c3c0c23180b..9202dbcef96d 100644 --- a/drivers/powercap/intel_rapl.c +++ b/drivers/powercap/intel_rapl.c @@ -266,7 +266,7 @@ static struct rapl_domain *platform_rapl_domain; /* Platform (PSys) domain */ /* caller to ensure CPU hotplug lock is held */ static struct rapl_package *rapl_find_package_domain(int cpu) { - int id = topology_physical_package_id(cpu); + int id = topology_logical_die_id(cpu); struct rapl_package *rp; list_for_each_entry(rp, &rapl_packages, plist) { @@ -1459,7 +1459,7 @@ static void rapl_remove_package(struct rapl_package *rp) /* called from CPU hotplug notifier, hotplug lock held */ static struct rapl_package *rapl_add_package(int cpu) { - int id = topology_physical_package_id(cpu); + int id = topology_logical_die_id(cpu); struct rapl_package *rp; int ret;