Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp1526212ybm; Thu, 23 May 2019 02:31:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqyS5FboTCqWjLRpL48lh2kFfEF84njlL/N1mJyrC8tKJQQ4IIAfbmQdX7PY1ou8vc8G7N7I X-Received: by 2002:a17:902:298a:: with SMTP id h10mr70601153plb.6.1558603919353; Thu, 23 May 2019 02:31:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558603919; cv=none; d=google.com; s=arc-20160816; b=Y6coQIxDuTg+g51epO/rFV4swFNzSfG+2l5Vsrsaxm+I9TcuGpOcqxNFFnCcz86d/0 hiRzFBq9hiyy2NVk3md8ayAmKoLKPLxepjjY5Ny5zuiCNecEYl+cd3YV0XfDeCJXJ6fN 8geXAkdRoWVcymWfofeqIt7BBfafMPVKxVfl86iKHmYj5zpiALnRr17soyM3EOX0E8Dm VRTfuzmcsymTgT1XXesiQibrvC57RnQHZvO1ocgDOOrarsYQpkiRbUe1N7epcqcU3k6C it7B6NNV/P29FdB4Vv4CnSC5J5Zjt8wnDpWOW07DWYr7IqIn2hsmufkO/NXUAI16C0NC njHQ== 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=x6zjVOAulB5sB+Og5ouCDwrEuGfiyZ/AFuJ+CqSTKHE=; b=F17MT4uFklyafyYUC2Yxlzeni03vcAPeNUEpXqvx5FvN9pemK87MoioYcAKulkPh0Y QZ7YrAglaF+DavvqSzFs7v0w30wifIIgN3FnN1DB2V5BrtadFJq/QL/53dqO49QabFyZ p1pdOroQADm91F8V/DQ9Qz65r1a6twWDDLdmD6kTVhffezd6ADzccIEV/wnv7SrPASH3 y2KLex9Vz5Xs954IE6pfzB1YDwbqg7i1hjT8TZ5errWQ+CLCEPGvOJyCGOjQ6qoNpypc dvg+amoxsFFgaIjIm1hEudHPIvjUlBx4BRSGRWLOrOjjzayn45IdH8k94hEY4ng8YgL1 W4yA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2019051801 header.b=KH1WfXm5; 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 s11si896035pgp.326.2019.05.23.02.31.44; Thu, 23 May 2019 02:31:59 -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=KH1WfXm5; 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 S1729949AbfEWJ3e (ORCPT + 99 others); Thu, 23 May 2019 05:29:34 -0400 Received: from terminus.zytor.com ([198.137.202.136]:44367 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726309AbfEWJ3e (ORCPT ); Thu, 23 May 2019 05:29:34 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x4N9T3CA4042229 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 23 May 2019 02:29:03 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 terminus.zytor.com x4N9T3CA4042229 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019051801; t=1558603744; bh=x6zjVOAulB5sB+Og5ouCDwrEuGfiyZ/AFuJ+CqSTKHE=; h=Date:From:Cc:Reply-To:In-Reply-To:References:To:Subject:From; b=KH1WfXm5ytFVuLNkvVGPHI2ZivUWuJo1WmSTFwqbz9hafVYN30MWVEx6pwWHD63N4 34jUHLiFfQXr+mXH7KkIlcJzfApaAAxvAeMRR2W8xP1QLIHvKBsGvJNcEhlSeo7oWK OMnhKRTE87Y5C5yNor9QyHTh+6JhgrI3NhHfxRE5Oa0CxiNYZBAJ+BnSIWs+Be+A7X 99biqiS3oR3CxHOMM6jUUFOyPkTRNYyKkxkm8l4lvfSibSeNOPD+U6XbtuAJ/83Nej qJ53NSUlNBaRY5Dm1O7iPNixnLnVlVYtpMmLK4XNje4FZWFFYVCV7VZpDdIW52IW9N oDVxWfHV90mYw== Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x4N9T3Ih4042225; Thu, 23 May 2019 02:29:03 -0700 Date: Thu, 23 May 2019 02:29:03 -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: 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 Reply-To: tglx@linutronix.de, rui.zhang@intel.com, linux-kernel@vger.kernel.org, len.brown@intel.com, peterz@infradead.org, linux@roeck-us.net, hpa@zytor.com, mingo@kernel.org In-Reply-To: References: To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/topology] hwmon/coretemp: Support multi-die/package Git-Commit-ID: cfcd82e632882372db960b50782a439a8ba56c09 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: cfcd82e632882372db960b50782a439a8ba56c09 Gitweb: https://git.kernel.org/tip/cfcd82e632882372db960b50782a439a8ba56c09 Author: Zhang Rui AuthorDate: Mon, 13 May 2019 13:58:54 -0400 Committer: Thomas Gleixner 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 Signed-off-by: Len Brown Signed-off-by: Thomas Gleixner Reviewed-by: Ingo Molnar Acked-by: Guenter Roeck Acked-by: Peter Zijlstra (Intel) 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)