All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Mallesh, Koujalagi" <mallesh.koujalagi@intel.com>
To: Karthik Poosa <karthik.poosa@intel.com>
Cc: <rodrigo.vivi@intel.com>, <anshuman.gupta@intel.com>,
	<badal.nilawar@intel.com>, <raag.jadav@intel.com>,
	<riana.tauro@intel.com>, <sk.anirban@intel.com>,
	<soham.purkait@intel.com>, <ravi.kishore.koppuravuri@intel.com>,
	"intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH v3 1/2] drm/xe/hwmon: Expose powerX_cap_max
Date: Tue, 24 Nov 2026 17:55:59 +0530	[thread overview]
Message-ID: <9df8cd40-876e-4ab1-a475-9db39410a816@intel.com> (raw)
In-Reply-To: <20261123170259.394360-2-karthik.poosa@intel.com>


On 23-11-2026 10:32 pm, Karthik Poosa wrote:
> Add a read-only power<i>_cap_max attribute for the card and package
> channels. It reports the PL2 (burst) power limit that firmware sets at
> boot, which is the highest value userspace can write to power<i>_cap.
> The attribute is present only on platforms using mailbox power limits
> where PL2 is enabled at boot.
>
> Signed-off-by: Karthik Poosa <karthik.poosa@intel.com>
> ---
> v2: Update KernelVersion to 7.5 Xe hwmon documentation. (Rodrigo)
>
>   .../ABI/testing/sysfs-driver-intel-xe-hwmon   | 24 +++++++++++++++++++
>   drivers/gpu/drm/xe/xe_hwmon.c                 | 11 +++++++--
>   2 files changed, 33 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/ABI/testing/sysfs-driver-intel-xe-hwmon b/Documentation/ABI/testing/sysfs-driver-intel-xe-hwmon
> index 0da739d9a816..e66e730f5ecd 100644
> --- a/Documentation/ABI/testing/sysfs-driver-intel-xe-hwmon
> +++ b/Documentation/ABI/testing/sysfs-driver-intel-xe-hwmon
> @@ -296,6 +296,30 @@ Description:	RW. Package burst (PL2) power limit in microwatts.
>   
>   		Only supported for particular Intel Xe graphics platforms.
>   
> +What:		/sys/bus/pci/drivers/xe/.../hwmon/hwmon<i>/power1_cap_max
> +Date:		November 2026
> +KernelVersion:	7.5
> +Contact:	intel-xe@lists.freedesktop.org
> +Description:	RO. Card default burst (PL2) power limit in microwatts.
> +
> +		This is the firmware-provided default limit and the maximum
> +		value accepted for power1_cap.

nit: Mention larger writes are clamped.

Looks good to me.

Reviewed-by: Mallesh Koujalagi <mallesh.koujalagi@intel.com>

> +
> +		Only supported for particular Intel Xe graphics platforms where
> +		PL2 is enabled.
> +
> +What:		/sys/bus/pci/drivers/xe/.../hwmon/hwmon<i>/power2_cap_max
> +Date:		November 2026
> +KernelVersion:	7.5
> +Contact:	intel-xe@lists.freedesktop.org
> +Description:	RO. Package default burst (PL2) power limit in microwatts.
> +
> +		This is the firmware-provided default limit and the maximum
> +		value accepted for power2_cap.
> +
> +		Only supported for particular Intel Xe graphics platforms where
> +		PL2 is enabled.
> +
>   What:		/sys/bus/pci/drivers/xe/.../hwmon/hwmon<i>/power1_cap_interval
>   Date:		May 2025
>   KernelVersion:	6.15
> diff --git a/drivers/gpu/drm/xe/xe_hwmon.c b/drivers/gpu/drm/xe/xe_hwmon.c
> index 42c2f9129da5..8b848470d5e5 100644
> --- a/drivers/gpu/drm/xe/xe_hwmon.c
> +++ b/drivers/gpu/drm/xe/xe_hwmon.c
> @@ -865,8 +865,9 @@ static const struct hwmon_channel_info hwmon_temp_info = {
>   static const struct hwmon_channel_info * const hwmon_info[] = {
>   	&hwmon_temp_info,
>   	HWMON_CHANNEL_INFO(power, HWMON_P_MAX | HWMON_P_RATED_MAX | HWMON_P_LABEL | HWMON_P_CRIT |
> -			   HWMON_P_CAP,
> -			   HWMON_P_MAX | HWMON_P_RATED_MAX | HWMON_P_LABEL | HWMON_P_CAP),
> +			   HWMON_P_CAP | HWMON_P_CAP_MAX,
> +			   HWMON_P_MAX | HWMON_P_RATED_MAX | HWMON_P_LABEL | HWMON_P_CAP |
> +			   HWMON_P_CAP_MAX),
>   	HWMON_CHANNEL_INFO(curr, HWMON_C_LABEL, HWMON_C_CRIT | HWMON_C_LABEL),
>   	HWMON_CHANNEL_INFO(in, HWMON_I_INPUT | HWMON_I_LABEL, HWMON_I_INPUT | HWMON_I_LABEL),
>   	HWMON_CHANNEL_INFO(energy, HWMON_E_INPUT | HWMON_E_LABEL, HWMON_E_INPUT | HWMON_E_LABEL),
> @@ -1423,6 +1424,8 @@ xe_hwmon_power_is_visible(struct xe_hwmon *hwmon, u32 attr, int channel)
>   	struct xe_mmio *mmio = xe_root_tile_mmio(hwmon->xe);
>   
>   	switch (attr) {
> +	case hwmon_power_cap_max:
> +		return hwmon->pl2_on_boot[channel] ? 0444 : 0;
>   	case hwmon_power_max:
>   	case hwmon_power_cap:
>   		if (hwmon->xe->info.has_mbx_power_limits) {
> @@ -1486,6 +1489,10 @@ static int
>   xe_hwmon_power_read(struct xe_hwmon *hwmon, u32 attr, int channel, long *val)
>   {
>   	switch (attr) {
> +	case hwmon_power_cap_max:
> +		*val = mul_u32_u32(REG_FIELD_GET(PWR_LIM_VAL, hwmon->pl2_on_boot[channel]),
> +				   SF_POWER) >> hwmon->scl_shift_power;
> +		return 0;
>   	case hwmon_power_max:
>   	case hwmon_power_cap:
>   		return xe_hwmon_power_max_read(hwmon, attr, channel, val);

  reply	other threads:[~2026-11-24 12:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23 17:02 [PATCH v2 0/2] Expose power1_cap_max Karthik Poosa
2026-11-23 17:02 ` [PATCH v3 1/2] drm/xe/hwmon: Expose powerX_cap_max Karthik Poosa
2026-11-24 12:25   ` Mallesh, Koujalagi [this message]
2026-11-23 17:02 ` [PATCH v3 2/2] drm/xe/hwmon: Improve mailbox power limit init and visibility Karthik Poosa
2026-11-25 17:02   ` Rodrigo Vivi
2026-11-23 17:14 ` ✗ CI.KUnit: failure for Expose power1_cap_max (rev2) Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9df8cd40-876e-4ab1-a475-9db39410a816@intel.com \
    --to=mallesh.koujalagi@intel.com \
    --cc=anshuman.gupta@intel.com \
    --cc=badal.nilawar@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=karthik.poosa@intel.com \
    --cc=raag.jadav@intel.com \
    --cc=ravi.kishore.koppuravuri@intel.com \
    --cc=riana.tauro@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=sk.anirban@intel.com \
    --cc=soham.purkait@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.