From mboxrd@z Thu Jan 1 00:00:00 1970 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 183FCECAAD2 for ; Tue, 30 Aug 2022 03:16:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 126CD10E84B; Tue, 30 Aug 2022 03:15:51 +0000 (UTC) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2E87010E84B for ; Tue, 30 Aug 2022 03:15:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661829343; x=1693365343; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=r7ToRVv/oXCMQZupiqpbIgiIhrndlEsMz11PilAmA4c=; b=S6GF+U3LWxAvo0wrG0Y9iYkwiLc1IVdWokDcUljX75VL2K1NCGXLZ9C5 mIOAw6jJf7aqIZFVjQSfxWisj9NyfDfdM4bn4728LLmGddE+xYraPXPVI hWlHEhIBXi5sfY+wCYaaeqhlwXHsoTILgDVv6X2mLThasDU1fIDaeUTPF 6SFOIg4CqvZ1XgEkwUm3axDfUb8ZlXHcG2Er1ugYe1C7u7CR9xgM4n2mo O2jyZFBDNljQf+lAAdG0F0RD1mRV76RR34X46Mp387cyLA04zE4GL2lHV acLu6YzyfCc8T5UW7L44oCmxo2ukhx/Nxvvs2b9kGRT/KNvMcf3Jhem2j w==; X-IronPort-AV: E=McAfee;i="6500,9779,10454"; a="381362374" X-IronPort-AV: E=Sophos;i="5.93,274,1654585200"; d="scan'208";a="381362374" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Aug 2022 20:15:42 -0700 X-IronPort-AV: E=Sophos;i="5.93,274,1654585200"; d="scan'208";a="856950279" Received: from adixit-mobl.amr.corp.intel.com (HELO adixit-arch.intel.com) ([10.252.143.205]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Aug 2022 20:15:42 -0700 Date: Mon, 29 Aug 2022 20:14:50 -0700 Message-ID: <87ilmazal1.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Badal Nilawar In-Reply-To: <20220825132118.784407-5-badal.nilawar@intel.com> References: <20220825132118.784407-1-badal.nilawar@intel.com> <20220825132118.784407-5-badal.nilawar@intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Subject: Re: [Intel-gfx] [PATCH 4/7] drm/i915/hwmon: Show device level energy usage X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-hwmon@vger.kernel.org, intel-gfx@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Thu, 25 Aug 2022 06:21:15 -0700, Badal Nilawar wrote: > > From: Dale B Stimson > > Use i915 HWMON to display device level energy input. > > v2: > - Updated the date and kernel version in feature description A few things to delete below but since no other changes this is: Reviewed-by: Ashutosh Dixit > diff --git a/Documentation/ABI/testing/sysfs-driver-intel-i915-hwmon b/Documentation/ABI/testing/sysfs-driver-intel-i915-hwmon > index 9a2d10edfce8..03d71c6869d3 100644 > --- a/Documentation/ABI/testing/sysfs-driver-intel-i915-hwmon > +++ b/Documentation/ABI/testing/sysfs-driver-intel-i915-hwmon > @@ -25,3 +25,11 @@ Contact: dri-devel@lists.freedesktop.org > Description: RO. Card default power limit (default TDP setting). > > Only supported for particular Intel i915 graphics platforms. > + > +What: /sys/devices/.../hwmon/hwmon/energy1_input > +Date: June 2022 > +KernelVersion: 5.19 Need to update kernel version on all patches now at least to 6.0 if not 6.1. > +static int > +hwm_energy(struct hwm_drvdata *ddat, long *energy) > +{ > + struct intel_uncore *uncore = ddat->uncore; > + struct i915_hwmon *hwmon = ddat->hwmon; > + struct hwm_energy_info *ei = &ddat->ei; > + intel_wakeref_t wakeref; > + i915_reg_t rgaddr; > + u32 reg_val; > + > + rgaddr = hwmon->rg.energy_status_all; > + > + if (!i915_mmio_reg_valid(rgaddr)) > + return -EOPNOTSUPP; Delete two lines above. Something like this is only needed if we have i915_hwmon_energy_status_get() which we are deleting below. hwm_energy_is_visible() takes care of making the sysfs node invisible when something cannot be supported and has the same check. > +int > +i915_hwmon_energy_status_get(struct drm_i915_private *i915, long *energy) > +{ > + struct i915_hwmon *hwmon = i915->hwmon; > + struct hwm_drvdata *ddat = &hwmon->ddat; > + > + return hwm_energy(ddat, energy); > +} Let's delete this function, there are no users for it at present. > diff --git a/drivers/gpu/drm/i915/i915_hwmon.h b/drivers/gpu/drm/i915/i915_hwmon.h > index 7ca9cf2c34c9..4e5b6c149f3a 100644 > --- a/drivers/gpu/drm/i915/i915_hwmon.h > +++ b/drivers/gpu/drm/i915/i915_hwmon.h > @@ -17,4 +17,5 @@ static inline void i915_hwmon_register(struct drm_i915_private *i915) { }; > static inline void i915_hwmon_unregister(struct drm_i915_private *i915) { }; > #endif > > +int i915_hwmon_energy_status_get(struct drm_i915_private *i915, long *energy); Delete.