From patchwork Fri Oct 13 09:38:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 152465 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp1769426vqb; Fri, 13 Oct 2023 02:40:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG8jnMcQS9Fjzh+S0FEzdsdiI524SFTtOMR8zbElxZfBIaGvla/dvi9S20BXv7bIAzpHFZW X-Received: by 2002:a05:6830:4902:b0:6b9:b987:1337 with SMTP id eq2-20020a056830490200b006b9b9871337mr31406417otb.1.1697190054597; Fri, 13 Oct 2023 02:40:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697190054; cv=none; d=google.com; s=arc-20160816; b=OXLcXDFYy6iL2nClFZzVfjfw3L8Lvu13M2vudej/PlnN6PSkaPWfAsiig+qPUqIBT1 hXIF5XkvRbIyenGp02O6khGeKZ+H4f39+1MqNT1ojo38Z/1lJ73W7+8+l1VH6H5Glp0L GL9/redhLeLXT7W2uyaPUFpehK4wQmNZ0Ke5ZNk0pvairUyJj2VviG9exaSbLxD321eq 03gOfbIvTcRt4/hJKnaS5hl75qS9ziQYvwlo2U0M5IX3owE211RLZ9r16+HXtbloIhY1 BrwDs5R0RUOdsNZYGbwRHPoikZ8ivaeLe9AAPdr1LpzVLvBmzKenhcuybbzTVINdqSqm lIzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=i3fixoSEjdi1cUMrL0yxSkBDaQiFFO44Wgp+c+FpXAY=; fh=8uye8s9C8if18rbPCqEr9Dx2lVWBS99YtFOXmisNfm0=; b=xwG7wUJClOpCDMSszipjyQ11kBl8koGaYTBEk9CTFT9gPpfYHjasToiRD1PxxW6Tty DtYp4RX4/EkWiSK6Pw1tZ4xwJwj53xf+KU92ih/S4GFk2ukIEnL/Dhj5fLTTTHfDmP2v ZquJaui1o5TiFI1lorYXm8OUJq+cgQPe+GoeVILVLKPPasrN0yNJUrde/DHYwrhdK0nw qwp7hnOzbtv/5OVvsqGzgXfxmI9REdF6k1rch/Css8ZLz8gJdhiBc9P3hxcF9OupEd5U G02z92nnVcIioY9JryT2+21/wPYUanBGBQRU4e3LJJ5q1ePZAV3N2qhSZRFz55oqsxgM Ahdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=wbT835fQ; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id l16-20020a056a0016d000b0068a49a550b9si905079pfc.139.2023.10.13.02.40.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 02:40:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=wbT835fQ; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 5EA518229D16; Fri, 13 Oct 2023 02:40:41 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231702AbjJMJjD (ORCPT + 19 others); Fri, 13 Oct 2023 05:39:03 -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 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Fri, 13 Oct 2023 02:40:41 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774196688240294156 X-GMAIL-MSGID: 1779632758655239706 The following commit has been merged into the x86/core branch of tip: Commit-ID: 94f0b3978ea87c180b7e989e54faedd0a097f7ea Gitweb: https://git.kernel.org/tip/94f0b3978ea87c180b7e989e54faedd0a097f7ea 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 @@ -134,15 +135,13 @@ static DEVICE_ATTR_RO(power1_crit); static void do_read_registers_on_cu(void *_data) { struct fam15h_power_data *data = _data; - int cpu, cu; - - cpu = smp_processor_id(); + int cu; /* * With the new x86 topology modelling, cpu core id actually * is compute unit id. */ - cu = cpu_data(cpu).cpu_core_id; + cu = topology_core_id(smp_processor_id()); rdmsrl_safe(MSR_F15H_CU_PWR_ACCUMULATOR, &data->cu_acc_power[cu]); rdmsrl_safe(MSR_F15H_PTSC, &data->cpu_sw_pwr_ptsc[cu]);