[PATCH v3 2/6] selftests/powercap: Add powercap hierarchy creation API tests

Daniel Lezcano daniel.lezcano at oss.qualcomm.com
Tue Oct 27 09:18:04 PDT 2026


On 10/27/26 17:10, Rafael J. Wysocki (Intel) wrote:
> On Tue, Oct 20, 2026 at 4:18 PM Daniel Lezcano
> <daniel.lezcano at oss.qualcomm.com> wrote:
>>
>> The powercap hierarchy API introduces generic helpers to duplicate,
>> instantiate and destroy a complete powercap hierarchy from a static
>> description.
>>
>> Add a kselftest exercising this API. The test builds a synthetic
>> powercap hierarchy composed of a package, three CPU clusters and twelve
>> CPUs, registers it as a powercap control type and checks the zone count
>> and selected sysfs attribute values. It also checks that the controller
>> directory disappears when the module is unloaded.
>>
>> Exercise direct static creation, duplication, skipped clusters and their
>> descendants, reuse after partial destruction, and repeated creation
>> returning -EBUSY without replacing existing zone pointers. Callback
>> checks verify the controller, name and backend-private data supplied by
>> the helpers.
>>
>> The test consists of:
>>
>> * a kernel module implementing a synthetic powercap hierarchy and
>>    dummy callbacks;
>> * a userspace kselftest script that loads the module, checks 16 zones
>>    and their power and constraint attributes, unloads the module with an
>>    attribute descriptor open, and checks controller removal.
>>
>> Use powercap-owned zone allocations so registration failures are cleaned
>> up by the core. Build generated module files in the selftest output
>> directory and extend the common clean target with Kbuild module cleanup.
>>
>> This provides a regression test for the powercap hierarchy helpers and
>> their integration with the powercap core.
>>
>> Cc: Manaf Meethalavalappu Pallikunhi <manaf.pallikunhi at oss.qualcomm.com>
>> Link: https://patch.msgid.link/20260806110159.69690-3-daniel.lezcano@oss.qualcomm.com
>> Assisted-by: LLM
>> Signed-off-by: Daniel Lezcano <daniel.lezcano at oss.qualcomm.com>
> 
> Sashiko is complaining about this one now:
> 
> https://sashiko.dev/#/patchset/cover.1792504834.git.daniel.lezcano%40oss.qualcomm.com

Thanks, I'll have a look




More information about the linux-arm-kernel mailing list