Linux Power Management development
 help / color / mirror / Atom feed
* [PATCH] pmdomain: tegra: Add support for multi-socket platforms
@ 2026-05-22 16:02 Jon Hunter
  2026-05-29 15:12 ` Thierry Reding
  0 siblings, 1 reply; 2+ messages in thread
From: Jon Hunter @ 2026-05-22 16:02 UTC (permalink / raw)
  To: Ulf Hansson, Thierry Reding; +Cc: linux-pm, linux-tegra, Jon Hunter

On multi-socket platforms each socket has its own BPMP that is
registered with the kernel. For such platforms append the NUMA ID for
each socket to the BPMP powergate name to ensure there is a unique name
for each power-domain. Note that we only append the NUMA ID for
powergates that return a valid name because an invalid name indicates
that the powergate ID is not supported.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
 drivers/pmdomain/tegra/powergate-bpmp.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/pmdomain/tegra/powergate-bpmp.c b/drivers/pmdomain/tegra/powergate-bpmp.c
index 8cde4f384846..1faaa92a5b02 100644
--- a/drivers/pmdomain/tegra/powergate-bpmp.c
+++ b/drivers/pmdomain/tegra/powergate-bpmp.c
@@ -137,6 +137,11 @@ static char *tegra_bpmp_powergate_get_name(struct tegra_bpmp *bpmp,
 	if (err < 0 || msg.rx.ret < 0)
 		return NULL;
 
+	if (response.get_name.name[0] != '\0' &&
+	    dev_to_node(bpmp->dev) != NUMA_NO_NODE)
+		return kasprintf(GFP_KERNEL, "%s.%d", response.get_name.name,
+				 dev_to_node(bpmp->dev));
+
 	return kstrdup(response.get_name.name, GFP_KERNEL);
 }
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] pmdomain: tegra: Add support for multi-socket platforms
  2026-05-22 16:02 [PATCH] pmdomain: tegra: Add support for multi-socket platforms Jon Hunter
@ 2026-05-29 15:12 ` Thierry Reding
  0 siblings, 0 replies; 2+ messages in thread
From: Thierry Reding @ 2026-05-29 15:12 UTC (permalink / raw)
  To: Jon Hunter; +Cc: Ulf Hansson, Thierry Reding, linux-pm, linux-tegra

[-- Attachment #1: Type: text/plain, Size: 1910 bytes --]

On Fri, May 22, 2026 at 05:02:51PM +0100, Jon Hunter wrote:
> On multi-socket platforms each socket has its own BPMP that is
> registered with the kernel. For such platforms append the NUMA ID for
> each socket to the BPMP powergate name to ensure there is a unique name
> for each power-domain. Note that we only append the NUMA ID for
> powergates that return a valid name because an invalid name indicates
> that the powergate ID is not supported.
> 
> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
> ---
>  drivers/pmdomain/tegra/powergate-bpmp.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/pmdomain/tegra/powergate-bpmp.c b/drivers/pmdomain/tegra/powergate-bpmp.c
> index 8cde4f384846..1faaa92a5b02 100644
> --- a/drivers/pmdomain/tegra/powergate-bpmp.c
> +++ b/drivers/pmdomain/tegra/powergate-bpmp.c
> @@ -137,6 +137,11 @@ static char *tegra_bpmp_powergate_get_name(struct tegra_bpmp *bpmp,
>  	if (err < 0 || msg.rx.ret < 0)
>  		return NULL;
>  
> +	if (response.get_name.name[0] != '\0' &&
> +	    dev_to_node(bpmp->dev) != NUMA_NO_NODE)
> +		return kasprintf(GFP_KERNEL, "%s.%d", response.get_name.name,
> +				 dev_to_node(bpmp->dev));

I just remembered that for GPIO we decided to use %d- with the node ID
as a prefix, rather than .%d as a suffix. Maybe we should unify on that
naming scheme? I remember we were going back and forth over it and
ultimately decided on this because it was more distinct from other
naming schemes.

For GPIO in particular we have <port>.<pin> already for the pin names,
so adding another .%d for the NUMA ID would've made for really confusing
names. This doesn't apply for clocks, but it might still be good to
stick to that naming.

I admit that I haven't been paying very close attention to this, so we
might need to revisit any patches in flux that are adding multi-socket
support.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-05-29 15:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-22 16:02 [PATCH] pmdomain: tegra: Add support for multi-socket platforms Jon Hunter
2026-05-29 15:12 ` Thierry Reding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox