<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/tools/power/cpupower/lib, branch v6.12.80</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-03-04T12:20:53+00:00</updated>
<entry>
<title>tools/power cpupower: Reset errno before strtoull()</title>
<updated>2026-03-04T12:20:53+00:00</updated>
<author>
<name>Kaushlendra Kumar</name>
<email>kaushlendra.kumar@intel.com</email>
</author>
<published>2025-12-01T12:17:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=bcbfd4d818120bd56fa0ccb09218a4bee428daad'/>
<id>urn:sha1:bcbfd4d818120bd56fa0ccb09218a4bee428daad</id>
<content type='text'>
[ Upstream commit f9bd3762cf1bd0c2465f2e6121b340883471d1bf ]

cpuidle_state_get_one_value() never cleared errno before calling
strtoull(), so a prior ERANGE caused every cpuidle counter read to
return zero. Reset errno to 0 before the conversion so each sysfs read
is evaluated independently.

Link: https://lore.kernel.org/r/20251201121745.3776703-1-kaushlendra.kumar@intel.com
Signed-off-by: Kaushlendra Kumar &lt;kaushlendra.kumar@intel.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>tools/cpupower: Fix incorrect size in cpuidle_state_disable()</title>
<updated>2025-11-13T20:34:08+00:00</updated>
<author>
<name>Kaushlendra Kumar</name>
<email>kaushlendra.kumar@intel.com</email>
</author>
<published>2025-09-17T05:08:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=02e73f9f561480364e44f4cc23a80e990f859400'/>
<id>urn:sha1:02e73f9f561480364e44f4cc23a80e990f859400</id>
<content type='text'>
[ Upstream commit 23199d2aa6dcaf6dd2da772f93d2c94317d71459 ]

Fix incorrect size parameter passed to cpuidle_state_write_file() in
cpuidle_state_disable().

The function was incorrectly using sizeof(disable) which returns the
size of the unsigned int variable (4 bytes) instead of the actual
length of the string stored in the 'value' buffer.

Since 'value' is populated with snprintf() to contain the string
representation of the disable value, we should use the length
returned by snprintf() to get the correct string length for
writing to the sysfs file.

This ensures the correct number of bytes is written to the cpuidle
state disable file in sysfs.

Link: https://lore.kernel.org/r/20250917050820.1785377-1-kaushlendra.kumar@intel.com
Signed-off-by: Kaushlendra Kumar &lt;kaushlendra.kumar@intel.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>tools/cpupower: fix error return value in cpupower_write_sysfs()</title>
<updated>2025-11-13T20:34:06+00:00</updated>
<author>
<name>Kaushlendra Kumar</name>
<email>kaushlendra.kumar@intel.com</email>
</author>
<published>2025-08-28T06:30:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=eff9be1646922a3a0d2c0dc569d82f2f041db312'/>
<id>urn:sha1:eff9be1646922a3a0d2c0dc569d82f2f041db312</id>
<content type='text'>
[ Upstream commit 57b100d4cf14276e0340eecb561005c07c129eb8 ]

The cpupower_write_sysfs() function currently returns -1 on
write failure, but the function signature indicates it should
return an unsigned int. Returning -1 from an unsigned function
results in a large positive value rather than indicating
an error condition.

Fix this by returning 0 on failure, which is more appropriate
for an unsigned return type and maintains consistency with typical
success/failure semantics where 0 indicates failure and non-zero
indicates success (bytes written).

Link: https://lore.kernel.org/r/20250828063000.803229-1-kaushlendra.kumar@intel.com
Signed-off-by: Kaushlendra Kumar &lt;kaushlendra.kumar@intel.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>pm:cpupower: Add missing powercap_set_enabled() stub function</title>
<updated>2024-09-06T00:48:57+00:00</updated>
<author>
<name>John B. Wyatt IV</name>
<email>jwyatt@redhat.com</email>
</author>
<published>2024-09-05T02:19:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4b80294fb53845dc5c98cca0c989da09150f2ca9'/>
<id>urn:sha1:4b80294fb53845dc5c98cca0c989da09150f2ca9</id>
<content type='text'>
There was a symbol listed in the powercap.h file that was not implemented.
Implement it with a stub return of 0.

Programs like SWIG require that functions that are defined in the
headers be implemented.

Fixes: c2294c1496b7 ("cpupower: Introduce powercap intel-rapl library and powercap-info command")
Suggested-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Signed-off-by: John B. Wyatt IV &lt;jwyatt@redhat.com&gt;
Signed-off-by: John B. Wyatt IV &lt;sageofredondo@gmail.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tools/cpupower: display residency value in idle-info</title>
<updated>2024-08-09T16:32:33+00:00</updated>
<author>
<name>Aboorva Devarajan</name>
<email>aboorvad@linux.ibm.com</email>
</author>
<published>2024-08-09T08:37:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=76fb981ad6774b82f06703c896b492c8659b543b'/>
<id>urn:sha1:76fb981ad6774b82f06703c896b492c8659b543b</id>
<content type='text'>
Update cpuidle tool to display the residency value of cpuidle
states. This addition provides a clearer and more detailed view
of idle state information when using cpuidle-info.

 --------------------------------
 Before Patch:
 --------------------------------
 $ cpupower idle-info
 CPUidle driver: intel_idle
 CPUidle governor: menu
 analyzing CPU 28:

 Number of idle states: 3
 Available idle states: POLL C1 C1E
 POLL:
 Flags/Description: CPUIDLE CORE POLL IDLE
 Latency: 0
 Usage: 7448
 Duration: 207170
 C1:
 Flags/Description: MWAIT 0x00
 Latency: 2
 Usage: 7023
 Duration: 3736853
 C1E:
 Flags/Description: MWAIT 0x01
 Latency: 10
 Usage: 18468
 Duration: 11396212

 --------------------------------
 After Patch:
 --------------------------------
 $ cpupower idle-info
 CPUidle driver: intel_idle
 CPUidle governor: menu
 analyzing CPU 12:

 Number of idle states: 3
 Available idle states: POLL C1 C1E
 POLL:
 Flags/Description: CPUIDLE CORE POLL IDLE
 Latency: 0
 Residency: 0
 Usage: 1950
 Duration: 38458
 C1:
 Flags/Description: MWAIT 0x00
 Latency: 2
 Residency: 2
 Usage: 10688
 Duration: 7133020
 C1E:
 Flags/Description: MWAIT 0x01
 Latency: 10
 Residency: 20
 Usage: 22356
 Duration: 15687259
 --------------------------------

Signed-off-by: Aboorva Devarajan &lt;aboorvad@linux.ibm.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>cpupower: Add is_valid_path API</title>
<updated>2023-07-18T22:06:44+00:00</updated>
<author>
<name>Wyes Karny</name>
<email>wyes.karny@amd.com</email>
</author>
<published>2023-06-19T19:05:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1ce5ab7c1dbfa82f0d382a48cccb51178cbf5416'/>
<id>urn:sha1:1ce5ab7c1dbfa82f0d382a48cccb51178cbf5416</id>
<content type='text'>
Add is_valid_path API to check whether the sysfs file is present or not.

Suggested-by: Gautham R. Shenoy &lt;gautham.shenoy@amd.com&gt;
Reviewed-by: Mario Limonciello &lt;mario.limonciello@amd.com&gt;
Signed-off-by: Wyes Karny &lt;wyes.karny@amd.com&gt;
Tested-by: Perry Yuan &lt;Perry.Yuan@amd.com&gt;
Acked-by: Huang Rui &lt;ray.huang@amd.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>cpupower:Fix resource leaks in sysfs_get_enabled()</title>
<updated>2023-05-08T14:11:24+00:00</updated>
<author>
<name>Hao Zeng</name>
<email>zenghao@kylinos.cn</email>
</author>
<published>2023-04-18T01:30:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e652be0f59d4ba4d5c636b1f7f4dcb73aae049fa'/>
<id>urn:sha1:e652be0f59d4ba4d5c636b1f7f4dcb73aae049fa</id>
<content type='text'>
The sysfs_get_enabled() opened file processor not closed,
may cause a file handle leak.
Putting error handling and resource cleanup code together
makes the code easy to maintain and read.
Removed the unnecessary else if branch from the original
function, as it should return an error in cases other than '0'.

Signed-off-by: Hao Zeng &lt;zenghao@kylinos.cn&gt;
Suggested-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>cpupower: Introduce powercap intel-rapl library and powercap-info command</title>
<updated>2022-11-30T23:48:28+00:00</updated>
<author>
<name>Thomas Renninger</name>
<email>trenn@suse.de</email>
</author>
<published>2022-11-23T11:18:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c2294c1496b7169d5b14c2fa27526ba35da9f5ac'/>
<id>urn:sha1:c2294c1496b7169d5b14c2fa27526ba35da9f5ac</id>
<content type='text'>
Read out powercap zone information via:
cpupower powercap-info
and show the zone hierarchy to the user:

./cpupower powercap-info
Driver: intel-rapl
Powercap domain hierarchy:

Zone: package-0 (enabled)
Power consumption can be monitored in micro Watts

        Zone: core (disabled)
        Power consumption can be monitored in micro Watts

        Zone: uncore (disabled)
        Power consumption can be monitored in micro Watts

        Zone: dram (disabled)
        Power consumption can be monitored in micro Watts

There is a dummy -a option for powercap-info which can/should be used to
show more detailed info later. Like that other args can be added easily
later as well.

A enable/disable option via powercap-set subcommand is also an enhancement
for later.

Also not all RAPL domains are shown. The func walking through RAPL
subdomains is restricted and hardcoded to: "intel-rapl/intel-rapl:0"
On my system above powercap domains map to:
intel-rapl/intel-rapl:0
-&gt; pack (age-0)
intel-rapl/intel-rapl:0/intel-rapl:0:0
-&gt; core
intel-rapl/intel-rapl:0/intel-rapl:0:1
-&gt; uncore

Missing ones on my system are:
intel-rapl-mmio/intel-rapl-mmio:0
-&gt; pack (age-0)

intel-rapl/intel-rapl:1
-&gt; psys

This could get enhanced in:
struct powercap_zone *powercap_init_zones()
and adopted to walk through all intel-rapl zones, but
also to other powercap drivers like dtpm
(Dynamic Thermal Power Management framework),
cmp with: drivers/powercap/dtpm_*

Signed-off-by: Thomas Renninger &lt;trenn@suse.de&gt;
CC: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>cpupower: Introduce ACPI CPPC library</title>
<updated>2022-02-23T01:36:50+00:00</updated>
<author>
<name>Huang Rui</name>
<email>ray.huang@amd.com</email>
</author>
<published>2022-02-22T15:34:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4a06806e5d4a781d2c81f6064985018562b2604b'/>
<id>urn:sha1:4a06806e5d4a781d2c81f6064985018562b2604b</id>
<content type='text'>
Kernel ACPI subsytem introduced the sysfs attributes for acpi cppc
library in below path:

/sys/devices/system/cpu/cpuX/acpi_cppc/

And these attributes will be used for AMD P-State driver to provide some
performance and frequency values.

Reviewed-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Signed-off-by: Huang Rui &lt;ray.huang@amd.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>cpupower: Add the function to get the sysfs value from specific table</title>
<updated>2022-02-23T01:36:44+00:00</updated>
<author>
<name>Huang Rui</name>
<email>ray.huang@amd.com</email>
</author>
<published>2022-02-22T15:34:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e3ede97657d8cfc4fd75aecad50269534bb55aed'/>
<id>urn:sha1:e3ede97657d8cfc4fd75aecad50269534bb55aed</id>
<content type='text'>
Expose the helper into cpufreq header, then cpufreq driver can use this
function to get the sysfs value if it has any specific sysfs interfaces.

Reviewed-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Signed-off-by: Huang Rui &lt;ray.huang@amd.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
</feed>
