mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] powercap/drivers/dtpm: Fix root node initialization
@ 2021-02-24 18:30 Daniel Lezcano
  2021-02-24 18:30 ` [PATCH 2/2] powercap/drivers/dtpm: Add the experimental label to the option description Daniel Lezcano
  2021-03-01 16:45 ` [PATCH 1/2] powercap/drivers/dtpm: Fix root node initialization Rafael J. Wysocki
  0 siblings, 2 replies; 4+ messages in thread
From: Daniel Lezcano @ 2021-02-24 18:30 UTC (permalink / raw)
  To: rafael, daniel.lezcano; +Cc: linux-kernel, linux-pm

The root node is not set to NULL when the dtpm root node is
removed. Consequently, it is not possible to create a new root as it
is already set.

Set the root node to NULL when the last node is removed.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/powercap/dtpm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/powercap/dtpm.c b/drivers/powercap/dtpm.c
index 5a51cd34a7e8..c2185ec5f887 100644
--- a/drivers/powercap/dtpm.c
+++ b/drivers/powercap/dtpm.c
@@ -207,6 +207,9 @@ int dtpm_release_zone(struct powercap_zone *pcz)
 	if (dtpm->ops)
 		dtpm->ops->release(dtpm);
 
+	if (root == dtpm)
+		root = NULL;
+
 	kfree(dtpm);
 
 	return 0;
-- 
2.17.1


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

* [PATCH 2/2] powercap/drivers/dtpm: Add the experimental label to the option description
  2021-02-24 18:30 [PATCH 1/2] powercap/drivers/dtpm: Fix root node initialization Daniel Lezcano
@ 2021-02-24 18:30 ` Daniel Lezcano
  2021-03-01 16:45 ` [PATCH 1/2] powercap/drivers/dtpm: Fix root node initialization Rafael J. Wysocki
  1 sibling, 0 replies; 4+ messages in thread
From: Daniel Lezcano @ 2021-02-24 18:30 UTC (permalink / raw)
  To: rafael, daniel.lezcano; +Cc: linux-kernel, linux-pm

The DTPM framework will evolve in the next cycles. Let's add a
temporary EXPERIMENTAL tag to the option so users will be aware the
API may change over time.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/powercap/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/powercap/Kconfig b/drivers/powercap/Kconfig
index 20b4325c6161..8242e8c5ed77 100644
--- a/drivers/powercap/Kconfig
+++ b/drivers/powercap/Kconfig
@@ -45,7 +45,7 @@ config IDLE_INJECT
 	  on a per CPU basis.
 
 config DTPM
-	bool "Power capping for Dynamic Thermal Power Management"
+	bool "Power capping for Dynamic Thermal Power Management (EXPERIMENTAL)"
 	help
 	  This enables support for the power capping for the dynamic
 	  thermal power management userspace engine.
-- 
2.17.1


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

* Re: [PATCH 1/2] powercap/drivers/dtpm: Fix root node initialization
  2021-02-24 18:30 [PATCH 1/2] powercap/drivers/dtpm: Fix root node initialization Daniel Lezcano
  2021-02-24 18:30 ` [PATCH 2/2] powercap/drivers/dtpm: Add the experimental label to the option description Daniel Lezcano
@ 2021-03-01 16:45 ` Rafael J. Wysocki
  2021-03-01 18:15   ` Daniel Lezcano
  1 sibling, 1 reply; 4+ messages in thread
From: Rafael J. Wysocki @ 2021-03-01 16:45 UTC (permalink / raw)
  To: Daniel Lezcano; +Cc: Rafael J. Wysocki, Linux Kernel Mailing List, Linux PM

On Wed, Feb 24, 2021 at 7:30 PM Daniel Lezcano
<daniel.lezcano@linaro.org> wrote:
>
> The root node is not set to NULL when the dtpm root node is
> removed. Consequently, it is not possible to create a new root as it
> is already set.
>
> Set the root node to NULL when the last node is removed.
>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> ---
>  drivers/powercap/dtpm.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/powercap/dtpm.c b/drivers/powercap/dtpm.c
> index 5a51cd34a7e8..c2185ec5f887 100644
> --- a/drivers/powercap/dtpm.c
> +++ b/drivers/powercap/dtpm.c
> @@ -207,6 +207,9 @@ int dtpm_release_zone(struct powercap_zone *pcz)
>         if (dtpm->ops)
>                 dtpm->ops->release(dtpm);
>
> +       if (root == dtpm)
> +               root = NULL;
> +
>         kfree(dtpm);
>
>         return 0;
> --

Applied along with the [2/2[ as 5.12-rc material, thanks!

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

* Re: [PATCH 1/2] powercap/drivers/dtpm: Fix root node initialization
  2021-03-01 16:45 ` [PATCH 1/2] powercap/drivers/dtpm: Fix root node initialization Rafael J. Wysocki
@ 2021-03-01 18:15   ` Daniel Lezcano
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Lezcano @ 2021-03-01 18:15 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: Linux Kernel Mailing List, Linux PM

On 01/03/2021 17:45, Rafael J. Wysocki wrote:
> On Wed, Feb 24, 2021 at 7:30 PM Daniel Lezcano
> <daniel.lezcano@linaro.org> wrote:
>>
>> The root node is not set to NULL when the dtpm root node is
>> removed. Consequently, it is not possible to create a new root as it
>> is already set.
>>
>> Set the root node to NULL when the last node is removed.
>>
>> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
>> ---
>>  drivers/powercap/dtpm.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/powercap/dtpm.c b/drivers/powercap/dtpm.c
>> index 5a51cd34a7e8..c2185ec5f887 100644
>> --- a/drivers/powercap/dtpm.c
>> +++ b/drivers/powercap/dtpm.c
>> @@ -207,6 +207,9 @@ int dtpm_release_zone(struct powercap_zone *pcz)
>>         if (dtpm->ops)
>>                 dtpm->ops->release(dtpm);
>>
>> +       if (root == dtpm)
>> +               root = NULL;
>> +
>>         kfree(dtpm);
>>
>>         return 0;
>> --
> 
> Applied along with the [2/2[ as 5.12-rc material, thanks!

Thanks


-- 
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

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

end of thread, other threads:[~2021-03-01 23:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-24 18:30 [PATCH 1/2] powercap/drivers/dtpm: Fix root node initialization Daniel Lezcano
2021-02-24 18:30 ` [PATCH 2/2] powercap/drivers/dtpm: Add the experimental label to the option description Daniel Lezcano
2021-03-01 16:45 ` [PATCH 1/2] powercap/drivers/dtpm: Fix root node initialization Rafael J. Wysocki
2021-03-01 18:15   ` Daniel Lezcano

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®