Re: [PATCH v2] cpupower: Implement powercap enabled setters
From: Shuah Khan
Date: Tue May 26 2026 - 15:53:36 EST
On 5/12/26 10:11, Mateusz Jaśkiewicz wrote:
powercap_set_enabled() and powercap_zone_set_enabled() are part of the
public libcpupower API, but both currently return success without
updating sysfs.
Write the requested value to the matching enabled attribute so callers
can actually enable or disable the powercap control type or zone, and
report write failures back to the caller.
---
Everything after the the 3 dots gets thrown away when patch is
applied. Patch version changes should be added after the
Signed-off-by
s
Changes in v2:
- Check current enabled value before writing.
- Use fd < 0 style for open() failures.
- Print sysfs open/write failures with perror().
- Drop the sizeof(path) typecast.
Signed-off-by: Mateusz Jaśkiewicz <jaskiewiczteo@xxxxxxxxx>
---
Here
tools/power/cpupower/lib/powercap.c | 58 +++++++++++++++++++++++------
1 file changed, 47 insertions(+), 11 deletions(-)
Please fix this and send me v3.
thanks,
-- Shuah