From: Karol Wachowski <karol.wachowski@linux.intel.com>
To: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com>,
dri-devel@lists.freedesktop.org
Cc: oded.gabbay@gmail.com, jeff.hugo@oss.qualcomm.com,
lizhi.hou@amd.com, maciej.falkowski@linux.intel.com
Subject: Re: [PATCH v2] accel/ivpu: Add support for limiting NPU frequency
Date: Wed, 8 Apr 2026 16:14:53 +0200 [thread overview]
Message-ID: <6da500f8-d9e2-4bf0-b6e4-9be5699b5ad6@linux.intel.com> (raw)
In-Reply-To: <20260408130827.2082946-1-andrzej.kacprowski@linux.intel.com>
On 4/8/2026 3:08 PM, Andrzej Kacprowski wrote:
> Add configurable frequency limits to allow users to constrain the NPU
> operating frequency range for power and thermal management. This support
> requires firmware API version 3.34.0 or newer.
>
> New sysfs interface:
>
> The freq/ subdirectory contains the following attributes:
>
> - hw_min_freq: Minimum frequency supported by hardware (read-only)
> - hw_max_freq: Maximum frequency supported by hardware (read-only)
> - hw_efficient_freq: Hardware's optimal operating frequency (read-only)
> - current_freq: Current NPU frequency in MHz (read-only)
> - set_min_freq: Configure minimum operating frequency (50XX+ devices)
> - set_max_freq: Configure maximum operating frequency (50XX+ devices)
>
> Legacy attributes npu_max_frequency_mhz and npu_current_frequency_mhz
> are maintained for backward compatibility.
>
> Implementation details:
>
> - Frequency configuration is communicated to firmware via JSM messages
> - User-specified frequency values are clamped to hardware limits
> - Power-efficient frequency (pn_ratio) is adjusted dynamically to stay
> within the configured range
> - Frequency configuration is initialized during device boot
> - The JSM API header is updated to version 3.34.0 to support the new
> VPU_JSM_MSG_FREQ_CONFIG firmware message
>
> Added description for the sysfs attributes in the Documentation/ABI.
>
> Signed-off-by: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com>
> ---
> Changes in v2:
> - Added sysfs attribute documentation in Documentation/ABI.
> - Updated MAINTAINERS to include the new documentation files.
>
> Documentation/ABI/obsolete/sysfs-driver-ivpu | 30 +++
> Documentation/ABI/testing/sysfs-driver-ivpu | 65 +++++++
> MAINTAINERS | 2 +
> drivers/accel/ivpu/ivpu_drv.c | 8 +-
> drivers/accel/ivpu/ivpu_hw.h | 16 +-
> drivers/accel/ivpu/ivpu_hw_btrs.c | 112 ++++++++---
> drivers/accel/ivpu/ivpu_hw_btrs.h | 10 +-
> drivers/accel/ivpu/ivpu_jsm_msg.c | 18 +-
> drivers/accel/ivpu/ivpu_jsm_msg.h | 4 +-
> drivers/accel/ivpu/ivpu_sysfs.c | 186 ++++++++++++++++---
> drivers/accel/ivpu/vpu_jsm_api.h | 34 +++-
> 11 files changed, 420 insertions(+), 65 deletions(-)
> create mode 100644 Documentation/ABI/obsolete/sysfs-driver-ivpu
> create mode 100644 Documentation/ABI/testing/sysfs-driver-ivpu
>
> diff --git a/Documentation/ABI/obsolete/sysfs-driver-ivpu b/Documentation/ABI/obsolete/sysfs-driver-ivpu
> new file mode 100644
> index 000000000000..16f6a0b22406
> --- /dev/null
> +++ b/Documentation/ABI/obsolete/sysfs-driver-ivpu
> @@ -0,0 +1,30 @@
> +What: /sys/bus/pci/drivers/intel_vpu/.../sched_mode
> +Date: October 2024
> +KernelVersion: 6.12
> +Contact: dri-devel@lists.freedesktop.org
> +Description: Current NPU scheduling mode. Returns one of the following strings:
> + - "HW" - Hardware Scheduler mode
> + - "OS" - Operating System Scheduler mode
> + Read-only.
> + Deprecated since the "OS" scheduling mode is not usable
> + and will be removed from future versions of the driver.
> + Will be removed in 2027
> +
> +What: /sys/bus/pci/drivers/intel_vpu/.../npu_max_frequency_mhz
This says npu_max_frequency_mhz
> +Date: April 2025
> +KernelVersion: 6.15
> +Contact: dri-devel@lists.freedesktop.org
> +Description: Legacy alias for /sys/bus/pci/drivers/intel_vpu/.../freq/hw_min_freq.
But this is hw_min_freq - supposed to be hw_max_freq
> + Shows maximum frequency in MHz of the NPU's data processing unit.
> + Read-only.
> + Will be removed in 2027
> +
> +What: /sys/bus/pci/drivers/intel_vpu/.../npu_current_frequency_mhz
> +Date: April 2025
> +KernelVersion: 6.15
> +Contact: dri-devel@lists.freedesktop.org
> +Description: Legacy alias for /sys/bus/pci/drivers/intel_vpu/.../freq/current_freq.
> + Shows current frequency in MHz of the NPU's data processing unit.
> + The value is read only when the device is active; otherwise it returns 0.
> + Read-only.
> + Will be removed in 2027
...
> diff --git a/drivers/accel/ivpu/ivpu_jsm_msg.h b/drivers/accel/ivpu/ivpu_jsm_msg.h
> index a74f5a0b0d93..ead7d07d300f 100644
> --- a/drivers/accel/ivpu/ivpu_jsm_msg.h
> +++ b/drivers/accel/ivpu/ivpu_jsm_msg.h
> @@ -1,6 +1,6 @@
> /* SPDX-License-Identifier: GPL-2.0-only */
> /*
> - * Copyright (C) 2020-2024 Intel Corporation
> + * Copyright (C) 2020-2026 Intel Corporation
> */
>
> #ifndef __IVPU_JSM_MSG_H__
> @@ -45,5 +45,7 @@ int ivpu_jsm_dct_enable(struct ivpu_device *vdev, u32 active_us, u32 inactive_us
> int ivpu_jsm_dct_disable(struct ivpu_device *vdev);
> int ivpu_jsm_state_dump(struct ivpu_device *vdev);
> int ivpu_jsm_state_dump_no_reply(struct ivpu_device *vdev);
> +int ivpu_jsm_msg_freq_config(struct ivpu_device *vdev, u16 min_ratio, u16 pn_ratio, u16 max_ratio);
> +int ivpu_jsm_msg_freq_config(struct ivpu_device *vdev, u16 min_ratio, u16 pn_ratio, u16 max_ratio);
This got added twice.
...
Karol
next prev parent reply other threads:[~2026-04-08 14:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-08 13:08 [PATCH v2] accel/ivpu: Add support for limiting NPU frequency Andrzej Kacprowski
2026-04-08 14:14 ` Karol Wachowski [this message]
2026-04-12 2:24 ` Claude review: " Claude Code Review Bot
2026-04-12 2:24 ` Claude Code Review Bot
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=6da500f8-d9e2-4bf0-b6e4-9be5699b5ad6@linux.intel.com \
--to=karol.wachowski@linux.intel.com \
--cc=andrzej.kacprowski@linux.intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jeff.hugo@oss.qualcomm.com \
--cc=lizhi.hou@amd.com \
--cc=maciej.falkowski@linux.intel.com \
--cc=oded.gabbay@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox