mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lukasz Luba <lukasz.luba@arm.com>
To: Daniel Lezcano <daniel.lezcano@oss.qualcomm.com>
Cc: Daniel Lezcano <daniel.lezcano@kernel.org>,
	rafael@kernel.org, Heiko Stuebner <heiko@sntech.de>,
	Shuah Khan <shuah@kernel.org>,
	Manaf Meethalavalappu Pallikunhi
	<manaf.pallikunhi@oss.qualcomm.com>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org,
	linux-kselftest@vger.kernel.org
Subject: Re: [PATCH v5 4/6] powercap: dtpm: Use generic powercap hierarchy helpers
Date: Mon, 9 Nov 2026 09:09:09 +0000	[thread overview]
Message-ID: <bcb0bfcb-e359-4710-aa6f-8de032327d03@arm.com> (raw)
In-Reply-To: <bded992091c92baa7246b939f266297f99c8942b.1793666444.git.daniel.lezcano@oss.qualcomm.com>



On 11/3/26 04:48, Daniel Lezcano wrote:
> DTPM implements its own hierarchy creation and destruction logic while
> the powercap core now provides generic helpers for this purpose.
> 
> Convert DTPM to use the generic powercap hierarchy infrastructure.
> Duplicate the platform hierarchy before creating it, and use
> powercap_hierarchy_create() and powercap_hierarchy_destroy() to manage
> the DTPM zones.
> 
> Add DTPM callbacks to create and destroy the zones associated with each
> powercap hierarchy node. Adapt the CPU and devfreq backends to return
> the created DTPM instance and use the node name provided by the
> hierarchy.
> 
> Convert the Rockchip RK3399 description to struct powercap_hierarchy
> and keep the device tree path as DTPM-specific node data.
> 
> This removes the DTPM-specific hierarchy traversal and destruction code
> and leaves the hierarchy management to the powercap core.
> 
> Preserve best-effort creation: an unavailable backend returns NULL to
> skip its branch, and setup failures are warned about and skipped rather
> than rolling back independent zones. Invalid node descriptors remain
> fatal. Reject a DT node with a NULL path before calling
> of_find_node_by_path(), treating it as an invalid descriptor rather
> than an unavailable backend.
> 
> When the representative CPU is offline, find an active policy through an
> online sibling whose related_cpus mask contains it. Hold the CPU hotplug
> read lock during selection and setup, and initialize the zone through the
> policy's active CPU while keeping the hierarchy-provided name. An entirely
> offline policy still has no active CPU to initialize through.
> 
> Signed-off-by: Daniel Lezcano <daniel.lezcano@oss.qualcomm.com>
> ---
> Changes in v5 (since v4):
> - Reject a NULL DT node path with -EINVAL before invoking
>    dtpm_setup_dt(), as suggested by Lukasz Luba.
> - Document that a missing path is an invalid hierarchy descriptor.
> 
> 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.
> - Preserve best-effort branch creation using the generic NULL result.
> - Find an online policy sibling for offline CPU representatives and
>    protect policy selection and setup against CPU hotplug.
> - Keep generic API behavior and documentation in patch 1.
> - Fix __initdata placement; match-table indentation is handled in patch 3.
> - Name setup callback arguments and remove whitespace-only lines.
> - Update the description.
> 
>   drivers/powercap/dtpm.c         | 180 +++++++++++++++-----------------
>   drivers/powercap/dtpm_cpu.c     |  62 ++++++++---
>   drivers/powercap/dtpm_devfreq.c |  22 ++--
>   drivers/soc/rockchip/dtpm.c     |  67 +++++++++---
>   include/linux/dtpm.h            |   6 +-
>   5 files changed, 198 insertions(+), 139 deletions(-)
> 

Thank you Daniel for addressing that, LGTM

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

  parent reply	other threads:[~2026-11-09  9:08 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-03  4:48 [PATCH v5 0/6] powercap: Add generic hierarchy support and convert DTPM Daniel Lezcano
2026-11-03  4:48 ` [PATCH v5 1/6] powercap: Add generic zone hierarchy creation helpers Daniel Lezcano
2026-11-05  9:35   ` Manaf Meethalavalappu Pallikunhi
2026-11-05 15:32     ` Daniel Lezcano
2026-11-03  4:48 ` [PATCH v5 2/6] selftests/powercap: Add powercap hierarchy creation API tests Daniel Lezcano
2026-11-03  4:48 ` [PATCH v5 3/6] powercap: dtpm: Remove duplicate RK3399 CPU hierarchy nodes Daniel Lezcano
2026-11-07 14:49   ` Heiko Stuebner
2026-11-03  4:48 ` [PATCH v5 4/6] powercap: dtpm: Use generic powercap hierarchy helpers Daniel Lezcano
2026-11-07 14:55   ` Heiko Stuebner
2026-11-09  9:09   ` Lukasz Luba [this message]
2026-11-03  4:48 ` [PATCH v5 5/6] powercap: dtpm: Rename Rockchip virtual node descriptor Daniel Lezcano
2026-11-07 14:56   ` Heiko Stuebner
2026-11-03  4:48 ` [PATCH v5 6/6] powercap: dtpm: Add RK3588 hierarchy Daniel Lezcano
2026-11-07 15:14   ` Heiko Stuebner
2026-11-06 15:21 ` [PATCH v5 0/6] powercap: Add generic hierarchy support and convert DTPM Rafael J. Wysocki (Intel)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bcb0bfcb-e359-4710-aa6f-8de032327d03@arm.com \
    --to=lukasz.luba@arm.com \
    --cc=daniel.lezcano@kernel.org \
    --cc=daniel.lezcano@oss.qualcomm.com \
    --cc=heiko@sntech.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=manaf.pallikunhi@oss.qualcomm.com \
    --cc=rafael@kernel.org \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®