LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: tip-bot for Zhang Rui <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux@roeck-us.net, peterz@infradead.org,
	linux-kernel@vger.kernel.org, len.brown@intel.com,
	tglx@linutronix.de, rui.zhang@intel.com, mingo@kernel.org,
	hpa@zytor.com
Subject: [tip:x86/topology] hwmon/coretemp: Support multi-die/package
Date: Thu, 23 May 2019 02:29:03 -0700	[thread overview]
Message-ID: <tip-cfcd82e632882372db960b50782a439a8ba56c09@git.kernel.org> (raw)
In-Reply-To: <ec2868f35113a01ff72d9041e0b97fc6a1c7df84.1557769318.git.len.brown@intel.com>

Commit-ID:  cfcd82e632882372db960b50782a439a8ba56c09
Gitweb:     https://git.kernel.org/tip/cfcd82e632882372db960b50782a439a8ba56c09
Author:     Zhang Rui <rui.zhang@intel.com>
AuthorDate: Mon, 13 May 2019 13:58:54 -0400
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 23 May 2019 10:08:33 +0200

hwmon/coretemp: Support multi-die/package

Package temperature sensors are actually implemented in hardware per-die.

Update coretemp to be "die-aware", so it can expose mulitple sensors per
package, instead of just one.  No change to single-die/package systems.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: linux-pm@vger.kernel.org
Cc: linux-hwmon@vger.kernel.org
Link: https://lkml.kernel.org/r/ec2868f35113a01ff72d9041e0b97fc6a1c7df84.1557769318.git.len.brown@intel.com

---
 drivers/hwmon/coretemp.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
index 5d34f7271e67..c64ce32d3214 100644
--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
@@ -435,7 +435,7 @@ static int chk_ucode_version(unsigned int cpu)
 
 static struct platform_device *coretemp_get_pdev(unsigned int cpu)
 {
-	int pkgid = topology_logical_package_id(cpu);
+	int pkgid = topology_logical_die_id(cpu);
 
 	if (pkgid >= 0 && pkgid < max_packages)
 		return pkg_devices[pkgid];
@@ -579,7 +579,7 @@ static struct platform_driver coretemp_driver = {
 
 static struct platform_device *coretemp_device_add(unsigned int cpu)
 {
-	int err, pkgid = topology_logical_package_id(cpu);
+	int err, pkgid = topology_logical_die_id(cpu);
 	struct platform_device *pdev;
 
 	if (pkgid < 0)
@@ -703,7 +703,7 @@ static int coretemp_cpu_offline(unsigned int cpu)
 	 * the rest.
 	 */
 	if (cpumask_empty(&pd->cpumask)) {
-		pkg_devices[topology_logical_package_id(cpu)] = NULL;
+		pkg_devices[topology_logical_die_id(cpu)] = NULL;
 		platform_device_unregister(pdev);
 		return 0;
 	}
@@ -741,7 +741,7 @@ static int __init coretemp_init(void)
 	if (!x86_match_cpu(coretemp_ids))
 		return -ENODEV;
 
-	max_packages = topology_max_packages();
+	max_packages = topology_max_packages() * topology_max_die_per_package();
 	pkg_devices = kcalloc(max_packages, sizeof(struct platform_device *),
 			      GFP_KERNEL);
 	if (!pkg_devices)

  reply	other threads:[~2019-05-23  9:29 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-13 17:58 [PATCH 01/19] x86 topology: Add CPUID.1F multi-die/package support Len Brown
2019-05-13 17:58 ` [PATCH 03/19] cpu topology: Export die_id Len Brown
2019-05-23  9:24   ` [tip:x86/topology] cpu/topology: " tip-bot for Len Brown
2019-05-13 17:58 ` [PATCH 04/19] x86 topology: Define topology_die_id() Len Brown
2019-05-23  9:24   ` [tip:x86/topology] x86/topology: " tip-bot for Len Brown
2019-05-13 17:58 ` [PATCH 05/19] x86 topology: Define topology_logical_die_id() Len Brown
2019-05-23  9:25   ` [tip:x86/topology] x86/topology: " tip-bot for Len Brown
2019-05-13 17:58 ` [PATCH 06/19] powercap/intel_rapl: Simplify rapl_find_package() Len Brown
2019-05-23  9:26   ` [tip:x86/topology] " tip-bot for Zhang Rui
2019-05-13 17:58 ` [PATCH 07/19] powercap/intel_rapl: Support multi-die/package Len Brown
2019-05-23  9:26   ` [tip:x86/topology] " tip-bot for Zhang Rui
2019-05-13 17:58 ` [PATCH 08/19] thermal/x86_pkg_temp_thermal: " Len Brown
2019-05-23  9:27   ` [tip:x86/topology] " tip-bot for Zhang Rui
2019-05-13 17:58 ` [PATCH 09/19] powercap/intel_rapl: Update RAPL domain name and debug messages Len Brown
2019-05-23  9:28   ` [tip:x86/topology] " tip-bot for Zhang Rui
2019-05-13 17:58 ` [PATCH 10/19] hwmon/coretemp: Support multi-die/package Len Brown
2019-05-23  9:29   ` tip-bot for Zhang Rui [this message]
2019-05-13 17:58 ` [PATCH 11/19] topology: Create package_cpus sysfs attribute Len Brown
2019-05-23  9:29   ` [tip:x86/topology] " tip-bot for Len Brown
2019-05-13 17:58 ` [PATCH 12/19] topology: Create core_cpus and die_cpus sysfs attributes Len Brown
2019-05-23  9:30   ` [tip:x86/topology] " tip-bot for Len Brown
2019-05-13 17:58 ` [PATCH 13/19] perf/x86/intel/uncore: Support multi-die/package Len Brown
2019-05-23  9:31   ` [tip:x86/topology] " tip-bot for Kan Liang
2019-05-13 17:58 ` [PATCH 14/19] perf/x86/intel/rapl: " Len Brown
2019-05-23  9:31   ` [tip:x86/topology] " tip-bot for Kan Liang
2019-05-13 17:58 ` [PATCH 15/19] perf/x86/intel/cstate: " Len Brown
2019-05-23  9:32   ` [tip:x86/topology] " tip-bot for Kan Liang
2019-05-13 17:59 ` [PATCH 16/19] thermal/x86_pkg_temp_thermal: Cosmetic: Rename internal variables to zones from packages Len Brown
2019-05-23  9:33   ` [tip:x86/topology] " tip-bot for Len Brown
2019-05-13 17:59 ` [PATCH 17/19] hwmon/coretemp: " Len Brown
2019-05-23  9:34   ` [tip:x86/topology] " tip-bot for Len Brown
2019-05-13 17:59 ` [PATCH 18/19] perf/x86/intel/uncore: Cosmetic renames in response to multi-die/pkg support Len Brown
2019-05-23  9:34   ` [tip:x86/topology] " tip-bot for Kan Liang
2019-05-13 17:59 ` [PATCH 19/19] perf/x86/intel/rapl: Cosmetic rename internal variables " Len Brown
2019-05-23  9:35   ` [tip:x86/topology] " tip-bot for Kan Liang
  -- strict thread matches above, loose matches on Subject: below --
2019-05-13 17:58 [PATCH 0/19] v6 multi-die/package topology support Len Brown
2019-05-15  8:55 ` Peter Zijlstra
2019-05-15 16:38   ` Ingo Molnar
2019-05-22 20:44 ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-cfcd82e632882372db960b50782a439a8ba56c09@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=hpa@zytor.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rui.zhang@intel.com \
    --cc=tglx@linutronix.de \
    --subject='Re: [tip:x86/topology] hwmon/coretemp: Support multi-die/package' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).