public inbox for dri-devel@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com>
To: Jeff Hugo <jeff.hugo@oss.qualcomm.com>, dri-devel@lists.freedesktop.org
Cc: oded.gabbay@gmail.com, karol.wachowski@linux.intel.com,
	lizhi.hou@amd.com, maciej.falkowski@linux.intel.com
Subject: Re: [PATCH] accel/ivpu: Add support for limiting NPU frequency
Date: Thu, 9 Apr 2026 23:12:02 +0200	[thread overview]
Message-ID: <2807038a-b931-4a7a-9d8a-ea4feb53b595@linux.intel.com> (raw)
In-Reply-To: <74542a6e-14d6-4736-961f-59443d59b146@oss.qualcomm.com>

On 09-Apr-26 9:19 PM, Jeff Hugo wrote:
> On 4/8/2026 7:01 AM, Andrzej Kacprowski wrote:
>> On 31-Mar-26 8:12 AM, Jeff Hugo wrote:
>>> On 3/30/2026 2:38 AM, 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)
>>> I don't see Documentation/ABI changes in this patch, which are 
>>> required for sysfs.
>>>
>> Good point. I will add required documentation for all attributes 
>> exported by the ivpu driver.
>> [PATCH V2] will follow.
>>
>>> However, I wonder if this is the best way to move forward. At best, 
>>> you appear to be implementing a completely custom version of hwmon. 
>>> However, I wonder if hwmon/sysfs will be limiting as you support 3 
>>> generations of devices if I recall correctly, and that number is 
>>> probably going to go up. With the different generations supporting 
>>> different capabilities, I suspect the sysfs approach will eventually 
>>> put you into a corner.
>> Hwmon supports a fixed set of sensor types (temperature, voltage, fan 
>> speed, etc...) but it does not support frequency, so its not suitable 
>> for the purpose.
> 
> hwmon_device_register_with_info() allows you to extend the interface 
> with the extra_groups parameter.
Indeed, looks like there is way to add custom attributes.
Still I haven't found any example where frequency would be managed 
though hwmon interface.

The intended purpose of the proposed ivpu feature is to allow system 
level power manager to limit NPU power usage and extend system battery 
life.

Hwmon does not seem to be a good match here - its main value is 
providing standardized sensors that can be accessed though common 
software like lm-sensors.

- Andrzej
> 
>> Frequency limiting is supported on 2 hardware generations (50XX and 
>> 60XX) without any delta. I'm not expecting any changes in this code 
>> for future hardware.
>>>
>>> Your collegues over in the XE area have proposed a netlink mechanism, 
>>> which is in -next currently (expected to go in the 7.1 merge window). 
>>> We collaborated on that mechanism, and have plans to extend it for 
>>> these kinds of "telemetry" items. I'm expecting we'll have some 
>>> patches posted on list in a week, maybe 2 (finishing up some of the 
>>> final details). Perhaps you would find that useful?
>> The DRM RAS over netlink seems to be tailored for reporting error 
>> counters.
>>
>> The xe driver I was mimicking, still manages frequency limiting with 
>> sysfs, even thou it supported hwmon for discrete hw sensors, and now 
>> RAS over netlink as well for error counters.
>>
>> - Andrzej
>>>
>>> -Jeff
>>
> 


      reply	other threads:[~2026-04-09 21:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-30  8:38 [PATCH] accel/ivpu: Add support for limiting NPU frequency Andrzej Kacprowski
2026-03-31  6:12 ` Jeff Hugo
2026-04-08 13:01   ` Andrzej Kacprowski
2026-04-09 19:19     ` Jeff Hugo
2026-04-09 21:12       ` Andrzej Kacprowski [this message]

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=2807038a-b931-4a7a-9d8a-ea4feb53b595@linux.intel.com \
    --to=andrzej.kacprowski@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jeff.hugo@oss.qualcomm.com \
    --cc=karol.wachowski@linux.intel.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