[PATCH v4 1/6] powercap: Add generic zone hierarchy creation helpers
Lukasz Luba
lukasz.luba at arm.com
Fri Oct 30 07:02:13 PDT 2026
On 10/29/26 16:56, Daniel Lezcano wrote:
> Powercap controllers may need to create several powercap zones organized
> as a hierarchy. At present, each controller has to open-code the
> hierarchy traversal, parent lookup, error rollback and reverse-order
> destruction.
>
> Introduce struct powercap_hierarchy to describe a powercap
> hierarchy. Each node contains its name, parent, backend-specific data
> and the powercap zone created for it.
[snip]
>
> Cc: Manaf Meethalavalappu Pallikunhi <manaf.pallikunhi at oss.qualcomm.com>
> Link: https://patch.msgid.link/20260806110159.69690-2-daniel.lezcano@oss.qualcomm.com
> Signed-off-by: Daniel Lezcano <daniel.lezcano at oss.qualcomm.com>
> ---
> Changes in v4 (since v3):
> - Rebase on v7.3; no code or commit-description changes.
>
> Changes in v3 (since v2):
> - Rebase on v7.3-rc7.
> - Add a static initializer and clarify hierarchy ownership and locking.
> - Check for existing zones and validate names and parent ordering before
> creation; use zone for the runtime pointer member.
> - Allow NULL callback results to skip branches; keep errors fatal.
> - Use explicit locking and a signed reverse-loop index.
> - Explain the controller callbacks, their arguments and their relationship
> to zone operations; update the description.
>
> drivers/powercap/powercap_sys.c | 204 +++++++++++++++++++++++++++++++
> include/linux/powercap.h | 205 ++++++++++++++++++++++++++++++++
> 2 files changed, 409 insertions(+)
>
Reviewed-by: Lukasz Luba <lukasz.luba at arm.com>
More information about the linux-arm-kernel
mailing list