Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp268619rdh; Thu, 23 Nov 2023 03:39:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IF4r4mbnQjwfAUDAUkG2XS5S4i3kk/cBGgwRSAysDuRyBJX+wIFDh+ZM8jV6EeamVjlEhPB X-Received: by 2002:a05:6830:6:b0:6d7:f540:45f7 with SMTP id c6-20020a056830000600b006d7f54045f7mr3018968otp.34.1700739558543; Thu, 23 Nov 2023 03:39:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700739558; cv=none; d=google.com; s=arc-20160816; b=Y7kPTm33BIPMIWkb98vaDL3cVG/AFmNn7eaBA86PKzDNIzUpf2Eg7XJWQNGX8h9PP4 bd/Je3fLP2xs493lFXBXa7eW2o65G8uLEyMTS/MAQvplD5TSVTNNb5QsLosfIdsX1mqc hEAQEr+o7Y09B0rmsl6rv1sp2tVtFB9vAQV27loDwLWxP6LRMMoUb9h2cKG2YDS3xd9I xv7cHMClu3Hf9GSvj//kCfofjAihdvUkfYBGCQu/Pkzxb6U4Vq1iBBerOQx6TGxOrwgT 4DDTxxR2/HfO7iDt00vccUQhAK0BRNaSA00S6XAf51XesgQCTKun3f059ZcOVMMbb+tZ pYgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=IV9z9msIdbYY+0XKk5JeC3ZLBc5bsmLCbQddKvMbiUU=; fh=mOqrdtzLxfRdhx+JUcCLIFZwj5ZpRA4B+MTwRGfrWMA=; b=hVMmPsmXC7k7AvV4iZvlUiSTL3X3s2Q8PODNZk8zKedGpnqLe4o3Yl5Vps1hntkl63 rlstbWTRFYoBV2GncApCbCx3RFqFc7GhI32CoYn4r5Wx5oJCPSxo8mF0npVSdIYb4e/v ExUUOK8Y2irSCXWgn/cUHjwdgtLXaiC1TTTYDKaubb/baG6ZnSspgNbTsGWXwLD+Oepg Hccews9+8UKKN0MtQMXY4+BlASNxiezawOO258JkleH2aXA6OU7CTeSz+0sXzMInJrNE k42FUWGktYCsChzrxQCxhvD67yN0PMONMrTtM5EUn0+HyAKpLGnrRFdLQP9+Q5hg80qB 81FA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="kAHrVt/m"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id x185-20020a6363c2000000b005bdf5961e67si1156036pgb.639.2023.11.23.03.39.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 03:39:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="kAHrVt/m"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 3CBEF8292BF8; Thu, 23 Nov 2023 03:39:16 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345097AbjKWLi6 (ORCPT + 99 others); Thu, 23 Nov 2023 06:38:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345091AbjKWLiz (ORCPT ); Thu, 23 Nov 2023 06:38:55 -0500 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBC6719D; Thu, 23 Nov 2023 03:39:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700739542; x=1732275542; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=jCUMyFk9WCdxXuAk84ueFQmAh4DwRkOjYHbY7EDCxj8=; b=kAHrVt/mDa6/da83KP9ytQIVDrvfdplVYYl8y6XRhw/KV1FNISJoH8UC cSBkqNFSadYrbqS5sTkgxTxcmpDRD0CpsCk4rMGbR2d278MVCb9HURuDf ZuCw9x7eF+QiCS/43ZikNtryl8UntFRXn92PxHFz6LZ8pPNf7QiV7gFuX kiX9PE/O3y5KUJjLA9u9gCGbcFgZnTvjof5FyputLHbB9VduTepYtG4HB UO/CfVVGZtBFIjar6f/jmiZS9DDhO9p20c3ybl/KqLw0MoxKWfz4wWUd3 KM2+nE3rtwC6FqfCxHnpXpMzh+c1927Nfs9YWPnIAu6DNvg1mM78qTyOC Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="10928694" X-IronPort-AV: E=Sophos;i="6.04,221,1695711600"; d="scan'208";a="10928694" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Nov 2023 03:39:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,221,1695711600"; d="scan'208";a="8648823" Received: from mstrobel-mobl.ger.corp.intel.com ([10.252.40.70]) by orviesa002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Nov 2023 03:39:01 -0800 Date: Thu, 23 Nov 2023 13:38:57 +0200 (EET) From: =?ISO-8859-15?Q?Ilpo_J=E4rvinen?= To: "David E. Box" cc: LKML , platform-driver-x86@vger.kernel.org, rajvi.jingar@linux.intel.com Subject: Re: [PATCH V5 19/20] platform/x86/intel/pmc: Add debug attribute for Die C6 counter In-Reply-To: <20231123040355.82139-20-david.e.box@linux.intel.com> Message-ID: <5b3b7eb7-78c-c9ec-2acd-f54ff116188@linux.intel.com> References: <20231123040355.82139-1-david.e.box@linux.intel.com> <20231123040355.82139-20-david.e.box@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Thu, 23 Nov 2023 03:39:16 -0800 (PST) On Wed, 22 Nov 2023, David E. Box wrote: > Add a "die_c6_us_show" debugfs attribute. Reads the counter value using > Intel Platform Monitoring Technology (PMT) driver API. This counter is > useful for determining the idle residency of CPUs in the compute tile. > Also adds a missing forward declaration for punit_ep which was declared in > an earlier upstream commit but only used for the first time in this one. > > Signed-off-by: David E. Box > --- > V5 - Change comment for crystal error and return value > > V4 - no change > > V3 - Split previous PATCH V2 13. Separates implementation (this patch) from > platform specific use (next patch) > > V2 - Remove use of __func__ > - Use HZ_PER_MHZ > - Fix missing newlines in printks > > drivers/platform/x86/intel/pmc/core.c | 55 +++++++++++++++++++++++++++ > drivers/platform/x86/intel/pmc/core.h | 4 ++ > 2 files changed, 59 insertions(+) > > diff --git a/drivers/platform/x86/intel/pmc/core.c b/drivers/platform/x86/intel/pmc/core.c > index 4a38d52558fd..fb2c84fba0ae 100644 > --- a/drivers/platform/x86/intel/pmc/core.c > +++ b/drivers/platform/x86/intel/pmc/core.c > +static int pmc_core_die_c6_us_show(struct seq_file *s, void *unused) > +{ > + struct pmc_dev *pmcdev = s->private; > + u64 die_c6_res, count; > + int ret; > + > + if (!pmcdev->crystal_freq) { > + dev_warn_once(&pmcdev->pdev->dev, "Crystal frequency unavailable\n"); > + return -ENXIO; > + } I actually started to wonder whether it would be better to just not show the file in this case (using .is_visible())? (I'm sorry I forgot to send the note about that earlier.) -- i.