2020-07-27 23:11:11

by Daniel Lezcano

[permalink] [raw]
Subject: [PATCH] thermal: core: Add thermal zone enable/disable notification

Now the calls to enable/disable a thermal zone are centralized in a
call to a function, we can add in these the corresponding netlink
notifications.

Signed-off-by: Daniel Lezcano <[email protected]>
---
drivers/thermal/thermal_core.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 9748fbb9a3a1..72bf159bcecc 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -509,6 +509,11 @@ static int thermal_zone_device_set_mode(struct thermal_zone_device *tz,

thermal_zone_device_update(tz, THERMAL_EVENT_UNSPECIFIED);

+ if (mode == THERMAL_DEVICE_ENABLED)
+ thermal_notify_tz_enable(tz->id);
+ else
+ thermal_notify_tz_disable(tz->id);
+
return ret;
}

--
2.17.1


2020-07-28 07:49:39

by Zhang, Rui

[permalink] [raw]
Subject: Re: [PATCH] thermal: core: Add thermal zone enable/disable notification

On Tue, 2020-07-28 at 01:10 +0200, Daniel Lezcano wrote:
> Now the calls to enable/disable a thermal zone are centralized in a
> call to a function, we can add in these the corresponding netlink
> notifications.
>
> Signed-off-by: Daniel Lezcano <[email protected]>

Acked-by: Zhang Rui <[email protected]>
> ---
> drivers/thermal/thermal_core.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/thermal/thermal_core.c
> b/drivers/thermal/thermal_core.c
> index 9748fbb9a3a1..72bf159bcecc 100644
> --- a/drivers/thermal/thermal_core.c
> +++ b/drivers/thermal/thermal_core.c
> @@ -509,6 +509,11 @@ static int thermal_zone_device_set_mode(struct
> thermal_zone_device *tz,
>
> thermal_zone_device_update(tz, THERMAL_EVENT_UNSPECIFIED);
>
> + if (mode == THERMAL_DEVICE_ENABLED)
> + thermal_notify_tz_enable(tz->id);
> + else
> + thermal_notify_tz_disable(tz->id);
> +
> return ret;
> }
>

2020-07-29 05:37:37

by Amit Kucheria

[permalink] [raw]
Subject: Re: [PATCH] thermal: core: Add thermal zone enable/disable notification

On Tue, Jul 28, 2020 at 4:40 AM Daniel Lezcano
<[email protected]> wrote:
>
> Now the calls to enable/disable a thermal zone are centralized in a
> call to a function, we can add in these the corresponding netlink
> notifications.
>
> Signed-off-by: Daniel Lezcano <[email protected]>

Reviewed-by: Amit Kucheria <[email protected]>

> ---
> drivers/thermal/thermal_core.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
> index 9748fbb9a3a1..72bf159bcecc 100644
> --- a/drivers/thermal/thermal_core.c
> +++ b/drivers/thermal/thermal_core.c
> @@ -509,6 +509,11 @@ static int thermal_zone_device_set_mode(struct thermal_zone_device *tz,
>
> thermal_zone_device_update(tz, THERMAL_EVENT_UNSPECIFIED);
>
> + if (mode == THERMAL_DEVICE_ENABLED)
> + thermal_notify_tz_enable(tz->id);
> + else
> + thermal_notify_tz_disable(tz->id);
> +
> return ret;
> }
>
> --
> 2.17.1
>

2020-07-29 08:41:14

by Daniel Lezcano

[permalink] [raw]
Subject: Re: [PATCH] thermal: core: Add thermal zone enable/disable notification

On 29/07/2020 07:36, Amit Kucheria wrote:
> On Tue, Jul 28, 2020 at 4:40 AM Daniel Lezcano
> <[email protected]> wrote:
>>
>> Now the calls to enable/disable a thermal zone are centralized in a
>> call to a function, we can add in these the corresponding netlink
>> notifications.
>>
>> Signed-off-by: Daniel Lezcano <[email protected]>
>
> Reviewed-by: Amit Kucheria <[email protected]>

I've applied the changes, thanks for the review.


--
<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