Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3092801imj; Mon, 18 Feb 2019 19:42:56 -0800 (PST) X-Google-Smtp-Source: AHgI3IaXas4BW8TmFDVV2CIAEuVRDRg4loT9Bw7jK2eOmHqENOAmtwL/KxP7MDNVcAoQSnAWnkKo X-Received: by 2002:a17:902:6686:: with SMTP id e6mr28681891plk.208.1550547776431; Mon, 18 Feb 2019 19:42:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550547776; cv=none; d=google.com; s=arc-20160816; b=yx4nEBuYcfcWNYqpD/BqDhwBhnQVv3F+TCup/LSQGOLcQwaM+S/E5dijdfTYiaRaQf MAKNUvOT7Xby3Jxu/uoKE/fO/7JSAg2xST9AA2C1v9FA+3HmLTAX4XWfyNhMCR6uMCuN dCgMFIr08QIv8z2zBXFoozhfnpBcDsd65iaN1RmjOMBP3d76s+fx0bAbErvQq9ppyc6X 40XOEqfgGtQiqiGd3LNnwjaGrCe2fE5aLHyfjjW6tY1f2PN0N2cW4b5MpF9+QzFPE2Ke ymXJetUqt1ya1+okrCLL2S7rdRxFrc0j+7y4Km9bqxIXGtN0Tva9wHsmYmAZzDIwxfXU IlNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=0bkBhlZLwP0+CkBpq0MCToedKfvIRPENpISccQCmWHc=; b=KejcnqQdoxAXwxCX9fnAQnv1iz3guDI6D+hsWdQco6emr6Vb3of86kqgTJft6tY62X pPZAxraYpgHrUWuMDOMSgtcs+D57689M5PuAoL96kgxGLmqH4M6ihJWqiUfsWoN2I93V CTG64wwCgamLjVE1qXpAsD7qBpH5KUQfS0Lbwv9eNmZMQnso0l4Zankxi1sI2P8WIe4T im7B6Q7g17xVDgHYmxaZcwACBNGL3IQBEdqekCRM1ZEiW/3gA+dMeFrTmooSbP9oYplv 5gfdeAojZq0l9MWgAzkM50UURaIFMs/yQ4rEXR+Ks+7QjtwRYXpIYPp5BdiSsCZWSE83 KdVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=es4XB11R; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i12si11477949pgq.466.2019.02.18.19.42.41; Mon, 18 Feb 2019 19:42:56 -0800 (PST) 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=fail header.i=@gmail.com header.s=20161025 header.b=es4XB11R; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726473AbfBSDke (ORCPT + 99 others); Mon, 18 Feb 2019 22:40:34 -0500 Received: from mail-qk1-f196.google.com ([209.85.222.196]:42074 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726407AbfBSDkd (ORCPT ); Mon, 18 Feb 2019 22:40:33 -0500 Received: by mail-qk1-f196.google.com with SMTP id y140so11245139qkb.9; Mon, 18 Feb 2019 19:40:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :reply-to:organization; bh=0bkBhlZLwP0+CkBpq0MCToedKfvIRPENpISccQCmWHc=; b=es4XB11RZcKTOAIfruUnBqZi7VwGu0c+JWkmvnPZ6yOfdWEQZL9iQtUTm5QAwxOqo7 yrfhxbJ0hfEBo4CXbCXWU/Lbwmvjpkd2D1AWOy1zfw0VGWUwbCJnYftC7+P7t1QtwVJZ Aks81w3SpTJxr31LFLui1fP6IwhrGChInkLZAtBQGES2wl8Do4QZHabC8dXLDFuKY1Eh PnPP0U/hiSp8/3kNMCiY4zGGBuzwp62j7hYZTMls0hyKiTCs8S17bPcN1tYppLraidsf ACvDF1wgTaLFbR/1en6fWSIQY57RiK6KFNO4oEc0hHak0Cfhttb4OwnQNWyWglhZ65Xs KUFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:reply-to:organization; bh=0bkBhlZLwP0+CkBpq0MCToedKfvIRPENpISccQCmWHc=; b=QpNTLPoMVbaUP6vAnjR0IIF6KGnnYq+FO4aGan6LV8K6rFkwasA4v+iVp8IYInMkUR dMYSZgJt1arkG2VaQI6fcMKZPrXIaoJnqeyetJHjfh/yotIMJhRlLaD56Z52bzwc0ENA InzAv4OvC6vmu7nhJjazgJ0FoBdebkjF79v6bmHzTszAsokz4LYNcsoq6QMrxiRTpiaz zDGU5uMqONnEkbLH+Q766qHU0v4Dg4QLkOnRyh6UvDIKE3AQWhfMnLR47M8UpP924STv FhFHmm6meDK9KRfxdqMuza50rC9NJDOC3tp4UGaEO/Eu/poNuLTh3EZFmXJYyoYgFXp4 /CrQ== X-Gm-Message-State: AHQUAuY7RdLm9JwWrR0lQILvqrCS05E+Wv0vmXwYwQ2yZDSzu2uqi49T JbpbKbo7SCL/LBwm336e2Q4= X-Received: by 2002:a37:b381:: with SMTP id c123mr19018860qkf.346.1550547632534; Mon, 18 Feb 2019 19:40:32 -0800 (PST) Received: from kbl.fios-router.home (pool-96-233-42-17.bstnma.fios.verizon.net. [96.233.42.17]) by smtp.gmail.com with ESMTPSA id u5sm7327680qtg.37.2019.02.18.19.40.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Feb 2019 19:40:31 -0800 (PST) From: Len Brown To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Zhang Rui , Len Brown , linux-pm@vger.kernel.org Subject: [PATCH 08/11] powercap/intel_rapl: Support multi-die/package Date: Mon, 18 Feb 2019 22:40:10 -0500 Message-Id: <3349c9e551eecbfe849320c0e938daf4e0126734.1550545163.git.len.brown@intel.com> X-Mailer: git-send-email 2.18.0-rc0 In-Reply-To: <635b2bf8b1151a191cd9299276b75791a818c0c2.1550545163.git.len.brown@intel.com> References: <635b2bf8b1151a191cd9299276b75791a818c0c2.1550545163.git.len.brown@intel.com> Reply-To: Len Brown Organization: Intel Open Source Technology Center Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zhang Rui On the new dual-die/package systems, the RAPL MSR becomes die-scope. Thus instead of one powercap device per physical package, now there should be one powercap device for each unique die on these systems. This patch introduces intel_rapl driver support for new dual-die/package systems. On the hardwares that do not have multi-die, topology_unique_die_id() equals topology_physical_package_id(), thus there is no functional change. Signed-off-by: Zhang Rui Signed-off-by: Len Brown Cc: linux-pm@vger.kernel.org Signed-off-by: Len Brown --- 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 6057d9695fed..e004707283da 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(int cpu) { - int id = topology_physical_package_id(cpu); + int id = topology_unique_die_id(cpu); struct rapl_package *rp; list_for_each_entry(rp, &rapl_packages, plist) { @@ -1457,7 +1457,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_unique_die_id(cpu); struct rapl_package *rp; int ret; -- 2.18.0-rc0