Re: [PATCH v3 2/5] powercap/drivers/dtpm: Create a registering system

From: Lukasz Luba
Date: Thu Mar 11 2021 - 05:23:59 EST




On 3/10/21 11:02 AM, Daniel Lezcano wrote:
A SoC can be differently structured depending on the platform and the
kernel can not be aware of all the combinations, as well as the
specific tweaks for a particular board.

The creation of the hierarchy must be delegated to userspace.

These changes provide a registering mechanism where the different
subsystems will initialize their dtpm backends and register with a
name the dtpm node in a list.

The next changes will provide an userspace interface to create
hierachically the different nodes. Those will be created by name and

s/hierachically/hierarchically

found via the list filled by the different subsystem.

If a specified name is not found in the list, it is assumed to be a
virtual node which will have children and the default is to allocate
such node.

When the node register in the list, the function will be dtpm_register
where the previous semantic was to create the node. Thus, the
functions are renamed to reflect their purpose.

Signed-off-by: Daniel Lezcano <daniel.lezcano@xxxxxxxxxx>
---

V2:
- Fixed error code path by dropping lock
---
drivers/powercap/dtpm.c | 161 ++++++++++++++++++++++++++++++++++--
drivers/powercap/dtpm_cpu.c | 4 +-
include/linux/dtpm.h | 12 ++-
3 files changed, 164 insertions(+), 13 deletions(-)


apart from the above, LGTM

Reviewed-by: Lukasz Luba <lukasz.luba@xxxxxxx>