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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B5684C64EC4 for ; Tue, 28 Feb 2023 21:30:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229515AbjB1Vac (ORCPT ); Tue, 28 Feb 2023 16:30:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229612AbjB1Vac (ORCPT ); Tue, 28 Feb 2023 16:30:32 -0500 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFE7A305D5 for ; Tue, 28 Feb 2023 13:30:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677619830; x=1709155830; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=wGgx64hhdJ+rxYOy4lEfeFtr7lByXRSwJCQEAai/nNk=; b=k6rTWsDKUS3hIO27PAwTeZnzWhGrG9UfS5PGqT7bgwYFGulchAwAO28/ OpbvbgMsmjEinQXhSJJmvVueKCiUHs+zltlJPmbqItdi3IQSSKCNpZMrQ 2a+5JuHu8IOZBoJOZf9c7hhRXlUcNReGqC5UneYOVnBfTb+e5l28iKlZO jGrEDM8LVvfu9M5NqNvhj7f7Mz0v1VOjwyK/Gb9pwEzVQ1ou+YrJuHJZ+ /hD+qIW7X+LTqUGqOwgY2CyrPVzKl0VlXYEbOBkP5gfirWuQ0WqkhLG0k cuxPQZ/UuR2n1nfU42z4INXNp1kcMpm75SjqYW+Kq2m6265MGLUmjMeNT Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10635"; a="396821793" X-IronPort-AV: E=Sophos;i="5.98,223,1673942400"; d="scan'208";a="396821793" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2023 13:30:29 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10635"; a="743138445" X-IronPort-AV: E=Sophos;i="5.98,223,1673942400"; d="scan'208";a="743138445" Received: from adixit-mobl.amr.corp.intel.com (HELO adixit-arch.intel.com) ([10.212.235.137]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2023 13:30:29 -0800 Date: Tue, 28 Feb 2023 13:18:55 -0800 Message-ID: <87wn4132v4.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Guenter Roeck Cc: Badal Nilawar , intel-gfx@lists.freedesktop.org, linux-hwmon@vger.kernel.org, riana.tauro@intel.com, anshuman.gupta@intel.com, jon.ewins@intel.com, Guenter Roeck , Joonas Lahtinen , dri-devel@lists.freedesktop.org Subject: Re: [PATCH 3/7] drm/i915/hwmon: Power PL1 limit and TDP setting In-Reply-To: References: <20220812173715.2398586-1-badal.nilawar@intel.com> <20220812173715.2398586-4-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.2 (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 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org On Fri, 12 Aug 2022 11:06:58 -0700, Guenter Roeck wrote: > Hi Guenter/linux-hwmon, > On 8/12/22 10:37, Badal Nilawar wrote: > > From: Dale B Stimson > > > > Use i915 HWMON to display/modify dGfx power PL1 limit and TDP setting. > > /snip/ > > Acked-by: Guenter Roeck > > > --- > > .../ABI/testing/sysfs-driver-intel-i915-hwmon | 20 ++ > > drivers/gpu/drm/i915/i915_hwmon.c | 176 +++++++++++++++++- > > drivers/gpu/drm/i915/i915_reg.h | 16 ++ > > drivers/gpu/drm/i915/intel_mchbar_regs.h | 7 + > > 4 files changed, 217 insertions(+), 2 deletions(-) > > > > diff --git a/Documentation/ABI/testing/sysfs-driver-intel-i915-hwmon b/Documentation/ABI/testing/sysfs-driver-intel-i915-hwmon > > index 24c4b7477d51..9a2d10edfce8 100644 > > --- a/Documentation/ABI/testing/sysfs-driver-intel-i915-hwmon > > +++ b/Documentation/ABI/testing/sysfs-driver-intel-i915-hwmon > > @@ -5,3 +5,23 @@ Contact: dri-devel@lists.freedesktop.org > > Description: RO. Current Voltage in millivolt. > > Only supported for particular Intel i915 graphics > > platforms. > > + > > +What: /sys/devices/.../hwmon/hwmon/power1_max > > +Date: June 2022 > > +KernelVersion: 5.19 > > +Contact: dri-devel@lists.freedesktop.org > > +Description: RW. Card reactive sustained (PL1/Tau) power limit in microwatts. > > + > > + The power controller will throttle the operating frequency > > + if the power averaged over a window (typically seconds) > > + exceeds this limit. We exposed this as 'power1_max' previously. However this is a "power limit". https://github.com/torvalds/linux/blob/master/Documentation/hwmon/sysfs-interface.rst says power1_max is "Maximum power". On the other hand, power1_cap is "If power use rises above this limit, the system should take action to reduce power use". So it would seem we should have chosen power1_cap for this power limit instead of power1_max? So do you think we should change this to power1_cap instead? Though even power1_max has an associated alarm so it also seems to be a sort of limit. Is there any guidance as to how these different power limits should be used? Generally speaking is: power1_max <= power1_cap <= power1_crit, or is it arbitrary or something else? Also, only power1_cap seems to have power1_cap_min and power1_cap_max (in case we wanted to use min/max values for the limits), not the others. Separately, we have already used up power1_crit (which is the other limit in official hwmon power limits) so we can't use that. Thanks. -- Ashutosh 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 073E2C64EC7 for ; Tue, 28 Feb 2023 21:30:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B77CC10E025; Tue, 28 Feb 2023 21:30:32 +0000 (UTC) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id E8D8C10E025; Tue, 28 Feb 2023 21:30:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677619830; x=1709155830; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=wGgx64hhdJ+rxYOy4lEfeFtr7lByXRSwJCQEAai/nNk=; b=k6rTWsDKUS3hIO27PAwTeZnzWhGrG9UfS5PGqT7bgwYFGulchAwAO28/ OpbvbgMsmjEinQXhSJJmvVueKCiUHs+zltlJPmbqItdi3IQSSKCNpZMrQ 2a+5JuHu8IOZBoJOZf9c7hhRXlUcNReGqC5UneYOVnBfTb+e5l28iKlZO jGrEDM8LVvfu9M5NqNvhj7f7Mz0v1VOjwyK/Gb9pwEzVQ1ou+YrJuHJZ+ /hD+qIW7X+LTqUGqOwgY2CyrPVzKl0VlXYEbOBkP5gfirWuQ0WqkhLG0k cuxPQZ/UuR2n1nfU42z4INXNp1kcMpm75SjqYW+Kq2m6265MGLUmjMeNT Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10635"; a="396821794" X-IronPort-AV: E=Sophos;i="5.98,223,1673942400"; d="scan'208";a="396821794" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2023 13:30:29 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10635"; a="743138445" X-IronPort-AV: E=Sophos;i="5.98,223,1673942400"; d="scan'208";a="743138445" Received: from adixit-mobl.amr.corp.intel.com (HELO adixit-arch.intel.com) ([10.212.235.137]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2023 13:30:29 -0800 Date: Tue, 28 Feb 2023 13:18:55 -0800 Message-ID: <87wn4132v4.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Guenter Roeck Subject: Re: [PATCH 3/7] drm/i915/hwmon: Power PL1 limit and TDP setting In-Reply-To: References: <20220812173715.2398586-1-badal.nilawar@intel.com> <20220812173715.2398586-4-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.2 (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 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-hwmon@vger.kernel.org, anshuman.gupta@intel.com, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, jon.ewins@intel.com, Guenter Roeck , Badal Nilawar , riana.tauro@intel.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Fri, 12 Aug 2022 11:06:58 -0700, Guenter Roeck wrote: > Hi Guenter/linux-hwmon, > On 8/12/22 10:37, Badal Nilawar wrote: > > From: Dale B Stimson > > > > Use i915 HWMON to display/modify dGfx power PL1 limit and TDP setting. > > /snip/ > > Acked-by: Guenter Roeck > > > --- > > .../ABI/testing/sysfs-driver-intel-i915-hwmon | 20 ++ > > drivers/gpu/drm/i915/i915_hwmon.c | 176 +++++++++++++++++- > > drivers/gpu/drm/i915/i915_reg.h | 16 ++ > > drivers/gpu/drm/i915/intel_mchbar_regs.h | 7 + > > 4 files changed, 217 insertions(+), 2 deletions(-) > > > > diff --git a/Documentation/ABI/testing/sysfs-driver-intel-i915-hwmon b/Documentation/ABI/testing/sysfs-driver-intel-i915-hwmon > > index 24c4b7477d51..9a2d10edfce8 100644 > > --- a/Documentation/ABI/testing/sysfs-driver-intel-i915-hwmon > > +++ b/Documentation/ABI/testing/sysfs-driver-intel-i915-hwmon > > @@ -5,3 +5,23 @@ Contact: dri-devel@lists.freedesktop.org > > Description: RO. Current Voltage in millivolt. > > Only supported for particular Intel i915 graphics > > platforms. > > + > > +What: /sys/devices/.../hwmon/hwmon/power1_max > > +Date: June 2022 > > +KernelVersion: 5.19 > > +Contact: dri-devel@lists.freedesktop.org > > +Description: RW. Card reactive sustained (PL1/Tau) power limit in microwatts. > > + > > + The power controller will throttle the operating frequency > > + if the power averaged over a window (typically seconds) > > + exceeds this limit. We exposed this as 'power1_max' previously. However this is a "power limit". https://github.com/torvalds/linux/blob/master/Documentation/hwmon/sysfs-interface.rst says power1_max is "Maximum power". On the other hand, power1_cap is "If power use rises above this limit, the system should take action to reduce power use". So it would seem we should have chosen power1_cap for this power limit instead of power1_max? So do you think we should change this to power1_cap instead? Though even power1_max has an associated alarm so it also seems to be a sort of limit. Is there any guidance as to how these different power limits should be used? Generally speaking is: power1_max <= power1_cap <= power1_crit, or is it arbitrary or something else? Also, only power1_cap seems to have power1_cap_min and power1_cap_max (in case we wanted to use min/max values for the limits), not the others. Separately, we have already used up power1_crit (which is the other limit in official hwmon power limits) so we can't use that. Thanks. -- Ashutosh 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 5ABB8C64EC7 for ; Tue, 28 Feb 2023 21:30:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 150AD10E058; Tue, 28 Feb 2023 21:30:33 +0000 (UTC) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id E8D8C10E025; Tue, 28 Feb 2023 21:30:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677619830; x=1709155830; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=wGgx64hhdJ+rxYOy4lEfeFtr7lByXRSwJCQEAai/nNk=; b=k6rTWsDKUS3hIO27PAwTeZnzWhGrG9UfS5PGqT7bgwYFGulchAwAO28/ OpbvbgMsmjEinQXhSJJmvVueKCiUHs+zltlJPmbqItdi3IQSSKCNpZMrQ 2a+5JuHu8IOZBoJOZf9c7hhRXlUcNReGqC5UneYOVnBfTb+e5l28iKlZO jGrEDM8LVvfu9M5NqNvhj7f7Mz0v1VOjwyK/Gb9pwEzVQ1ou+YrJuHJZ+ /hD+qIW7X+LTqUGqOwgY2CyrPVzKl0VlXYEbOBkP5gfirWuQ0WqkhLG0k cuxPQZ/UuR2n1nfU42z4INXNp1kcMpm75SjqYW+Kq2m6265MGLUmjMeNT Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10635"; a="396821794" X-IronPort-AV: E=Sophos;i="5.98,223,1673942400"; d="scan'208";a="396821794" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2023 13:30:29 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10635"; a="743138445" X-IronPort-AV: E=Sophos;i="5.98,223,1673942400"; d="scan'208";a="743138445" Received: from adixit-mobl.amr.corp.intel.com (HELO adixit-arch.intel.com) ([10.212.235.137]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2023 13:30:29 -0800 Date: Tue, 28 Feb 2023 13:18:55 -0800 Message-ID: <87wn4132v4.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Guenter Roeck In-Reply-To: References: <20220812173715.2398586-1-badal.nilawar@intel.com> <20220812173715.2398586-4-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.2 (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 3/7] drm/i915/hwmon: Power PL1 limit and TDP setting 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, dri-devel@lists.freedesktop.org, Guenter Roeck Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Fri, 12 Aug 2022 11:06:58 -0700, Guenter Roeck wrote: > Hi Guenter/linux-hwmon, > On 8/12/22 10:37, Badal Nilawar wrote: > > From: Dale B Stimson > > > > Use i915 HWMON to display/modify dGfx power PL1 limit and TDP setting. > > /snip/ > > Acked-by: Guenter Roeck > > > --- > > .../ABI/testing/sysfs-driver-intel-i915-hwmon | 20 ++ > > drivers/gpu/drm/i915/i915_hwmon.c | 176 +++++++++++++++++- > > drivers/gpu/drm/i915/i915_reg.h | 16 ++ > > drivers/gpu/drm/i915/intel_mchbar_regs.h | 7 + > > 4 files changed, 217 insertions(+), 2 deletions(-) > > > > diff --git a/Documentation/ABI/testing/sysfs-driver-intel-i915-hwmon b/Documentation/ABI/testing/sysfs-driver-intel-i915-hwmon > > index 24c4b7477d51..9a2d10edfce8 100644 > > --- a/Documentation/ABI/testing/sysfs-driver-intel-i915-hwmon > > +++ b/Documentation/ABI/testing/sysfs-driver-intel-i915-hwmon > > @@ -5,3 +5,23 @@ Contact: dri-devel@lists.freedesktop.org > > Description: RO. Current Voltage in millivolt. > > Only supported for particular Intel i915 graphics > > platforms. > > + > > +What: /sys/devices/.../hwmon/hwmon/power1_max > > +Date: June 2022 > > +KernelVersion: 5.19 > > +Contact: dri-devel@lists.freedesktop.org > > +Description: RW. Card reactive sustained (PL1/Tau) power limit in microwatts. > > + > > + The power controller will throttle the operating frequency > > + if the power averaged over a window (typically seconds) > > + exceeds this limit. We exposed this as 'power1_max' previously. However this is a "power limit". https://github.com/torvalds/linux/blob/master/Documentation/hwmon/sysfs-interface.rst says power1_max is "Maximum power". On the other hand, power1_cap is "If power use rises above this limit, the system should take action to reduce power use". So it would seem we should have chosen power1_cap for this power limit instead of power1_max? So do you think we should change this to power1_cap instead? Though even power1_max has an associated alarm so it also seems to be a sort of limit. Is there any guidance as to how these different power limits should be used? Generally speaking is: power1_max <= power1_cap <= power1_crit, or is it arbitrary or something else? Also, only power1_cap seems to have power1_cap_min and power1_cap_max (in case we wanted to use min/max values for the limits), not the others. Separately, we have already used up power1_crit (which is the other limit in official hwmon power limits) so we can't use that. Thanks. -- Ashutosh