From nobody Thu Dec 18 05:00:49 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5BF9FCDB484 for ; Fri, 13 Oct 2023 09:39:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231730AbjJMJjE (ORCPT ); Fri, 13 Oct 2023 05:39:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231256AbjJMJiP (ORCPT ); Fri, 13 Oct 2023 05:38:15 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60D85CC; Fri, 13 Oct 2023 02:38:12 -0700 (PDT) Date: Fri, 13 Oct 2023 09:38:10 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1697189891; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=i3fixoSEjdi1cUMrL0yxSkBDaQiFFO44Wgp+c+FpXAY=; b=wbT835fQZdamMO0dEG9zjyuBPSmkvO5hxkeoC+0pVmZdM90lqAaaOgK822orexSbi1bgqC MzRKvxSeGieVP2UIjTOCcKuBPFy1eifTqK2sGb6awuT4Dj1+WbKMqkTITnU9D3fqb9FYxs X8gQQW3DjBCo9va+mSv16VRDjwto2/ISCe5/+8dBwqz8qXECMb0H4T/cyqddy8MflP/M7d dQqn1YBAsGsrEQixb4hlRPVEYHWSmoLzCdqyVpEC01q8Tsk5sxX+Z8plZB5tnSqlc0oPqH VtiPG+sKKm/MFahD5Wq4bIJB00CqpOeCk5hPRJc/6V/uCoAM5SNZiZXLvM1eVg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1697189891; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=i3fixoSEjdi1cUMrL0yxSkBDaQiFFO44Wgp+c+FpXAY=; b=Y0zSyvmll74g1hzoEdlSlO/lCkiBvGhIWizcMf3l72eVBY3xalcDx3t9EQkmt++1OKxt96 hBEHiqLGeYm1DXBQ== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/core] hwmon: (fam15h_power) Use topology_core_id() Cc: Thomas Gleixner , Juergen Gross , Sohil Mehta , Michael Kelley , "Peter Zijlstra (Intel)" , Zhang Rui , Guenter Roeck , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230814085112.506988471@linutronix.de> References: <20230814085112.506988471@linutronix.de> MIME-Version: 1.0 Message-ID: <169718989041.3135.9102146734105924342.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/core branch of tip: Commit-ID: 94f0b3978ea87c180b7e989e54faedd0a097f7ea Gitweb: https://git.kernel.org/tip/94f0b3978ea87c180b7e989e54faedd0a= 097f7ea Author: Thomas Gleixner AuthorDate: Mon, 14 Aug 2023 10:18:33 +02:00 Committer: Thomas Gleixner CommitterDate: Tue, 10 Oct 2023 14:38:17 +02:00 hwmon: (fam15h_power) Use topology_core_id() Use the provided topology helper function instead of fiddling in cpu_data. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Tested-by: Sohil Mehta Tested-by: Michael Kelley Tested-by: Peter Zijlstra (Intel) Tested-by: Zhang Rui Acked-by: Guenter Roeck Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20230814085112.506988471@linutronix.de --- drivers/hwmon/fam15h_power.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/hwmon/fam15h_power.c b/drivers/hwmon/fam15h_power.c index 521534d..6307112 100644 --- a/drivers/hwmon/fam15h_power.c +++ b/drivers/hwmon/fam15h_power.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include =20 @@ -134,15 +135,13 @@ static DEVICE_ATTR_RO(power1_crit); static void do_read_registers_on_cu(void *_data) { struct fam15h_power_data *data =3D _data; - int cpu, cu; - - cpu =3D smp_processor_id(); + int cu; =20 /* * With the new x86 topology modelling, cpu core id actually * is compute unit id. */ - cu =3D cpu_data(cpu).cpu_core_id; + cu =3D topology_core_id(smp_processor_id()); =20 rdmsrl_safe(MSR_F15H_CU_PWR_ACCUMULATOR, &data->cu_acc_power[cu]); rdmsrl_safe(MSR_F15H_PTSC, &data->cpu_sw_pwr_ptsc[cu]);