All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND] thermal/drivers/netlink: Add the temperature when crossing a trip point
@ 2021-10-01 22:33 Daniel Lezcano
  2021-10-05 15:20 ` Rafael J. Wysocki
  2021-10-18 11:46 ` [thermal: thermal/next] " thermal-bot for Daniel Lezcano
  0 siblings, 2 replies; 4+ messages in thread
From: Daniel Lezcano @ 2021-10-01 22:33 UTC (permalink / raw)
  To: rafael
  Cc: srinivas.pandruvada, daniel.lezcano, rui.zhang, rkumbako,
	linux-pm, linux-kernel, linux-api, Amit Kucheria

The slope of the temperature increase or decrease can be high and when
the temperature crosses the trip point, there could be a significant
difference between the trip temperature and the measured temperatures.

That forces the userspace to read the temperature back right after
receiving a trip violation notification.

In order to be efficient, give the temperature which resulted in the
trip violation.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
 drivers/thermal/thermal_core.c    |  6 ++++--
 drivers/thermal/thermal_netlink.c | 11 ++++++-----
 drivers/thermal/thermal_netlink.h |  8 ++++----
 3 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 51374f4e1cca..9e243d9f929e 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -375,10 +375,12 @@ static void handle_thermal_trip(struct thermal_zone_device *tz, int trip)
 	if (tz->last_temperature != THERMAL_TEMP_INVALID) {
 		if (tz->last_temperature < trip_temp &&
 		    tz->temperature >= trip_temp)
-			thermal_notify_tz_trip_up(tz->id, trip);
+			thermal_notify_tz_trip_up(tz->id, trip,
+						  tz->temperature);
 		if (tz->last_temperature >= trip_temp &&
 		    tz->temperature < (trip_temp - hyst))
-			thermal_notify_tz_trip_down(tz->id, trip);
+			thermal_notify_tz_trip_down(tz->id, trip,
+						    tz->temperature);
 	}
 
 	if (type == THERMAL_TRIP_CRITICAL || type == THERMAL_TRIP_HOT)
diff --git a/drivers/thermal/thermal_netlink.c b/drivers/thermal/thermal_netlink.c
index 1234dbe95895..a16dd4d5d710 100644
--- a/drivers/thermal/thermal_netlink.c
+++ b/drivers/thermal/thermal_netlink.c
@@ -121,7 +121,8 @@ static int thermal_genl_event_tz(struct param *p)
 static int thermal_genl_event_tz_trip_up(struct param *p)
 {
 	if (nla_put_u32(p->msg, THERMAL_GENL_ATTR_TZ_ID, p->tz_id) ||
-	    nla_put_u32(p->msg, THERMAL_GENL_ATTR_TZ_TRIP_ID, p->trip_id))
+	    nla_put_u32(p->msg, THERMAL_GENL_ATTR_TZ_TRIP_ID, p->trip_id) ||
+	    nla_put_u32(p->msg, THERMAL_GENL_ATTR_TZ_TEMP, p->temp))
 		return -EMSGSIZE;
 
 	return 0;
@@ -285,16 +286,16 @@ int thermal_notify_tz_disable(int tz_id)
 	return thermal_genl_send_event(THERMAL_GENL_EVENT_TZ_DISABLE, &p);
 }
 
-int thermal_notify_tz_trip_down(int tz_id, int trip_id)
+int thermal_notify_tz_trip_down(int tz_id, int trip_id, int temp)
 {
-	struct param p = { .tz_id = tz_id, .trip_id = trip_id };
+	struct param p = { .tz_id = tz_id, .trip_id = trip_id, .temp = temp };
 
 	return thermal_genl_send_event(THERMAL_GENL_EVENT_TZ_TRIP_DOWN, &p);
 }
 
-int thermal_notify_tz_trip_up(int tz_id, int trip_id)
+int thermal_notify_tz_trip_up(int tz_id, int trip_id, int temp)
 {
-	struct param p = { .tz_id = tz_id, .trip_id = trip_id };
+	struct param p = { .tz_id = tz_id, .trip_id = trip_id, .temp = temp };
 
 	return thermal_genl_send_event(THERMAL_GENL_EVENT_TZ_TRIP_UP, &p);
 }
diff --git a/drivers/thermal/thermal_netlink.h b/drivers/thermal/thermal_netlink.h
index 828d1dddfa98..e554f76291f4 100644
--- a/drivers/thermal/thermal_netlink.h
+++ b/drivers/thermal/thermal_netlink.h
@@ -11,8 +11,8 @@ int thermal_notify_tz_create(int tz_id, const char *name);
 int thermal_notify_tz_delete(int tz_id);
 int thermal_notify_tz_enable(int tz_id);
 int thermal_notify_tz_disable(int tz_id);
-int thermal_notify_tz_trip_down(int tz_id, int id);
-int thermal_notify_tz_trip_up(int tz_id, int id);
+int thermal_notify_tz_trip_down(int tz_id, int id, int temp);
+int thermal_notify_tz_trip_up(int tz_id, int id, int temp);
 int thermal_notify_tz_trip_delete(int tz_id, int id);
 int thermal_notify_tz_trip_add(int tz_id, int id, int type,
 			       int temp, int hyst);
@@ -49,12 +49,12 @@ static inline int thermal_notify_tz_disable(int tz_id)
 	return 0;
 }
 
-static inline int thermal_notify_tz_trip_down(int tz_id, int id)
+static inline int thermal_notify_tz_trip_down(int tz_id, int id, int temp)
 {
 	return 0;
 }
 
-static inline int thermal_notify_tz_trip_up(int tz_id, int id)
+static inline int thermal_notify_tz_trip_up(int tz_id, int id, int temp)
 {
 	return 0;
 }
-- 
2.25.1


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

* Re: [PATCH RESEND] thermal/drivers/netlink: Add the temperature when crossing a trip point
  2021-10-01 22:33 [PATCH RESEND] thermal/drivers/netlink: Add the temperature when crossing a trip point Daniel Lezcano
@ 2021-10-05 15:20 ` Rafael J. Wysocki
  2021-10-06 12:20   ` Daniel Lezcano
  2021-10-18 11:46 ` [thermal: thermal/next] " thermal-bot for Daniel Lezcano
  1 sibling, 1 reply; 4+ messages in thread
From: Rafael J. Wysocki @ 2021-10-05 15:20 UTC (permalink / raw)
  To: Daniel Lezcano
  Cc: Rafael J. Wysocki, Srinivas Pandruvada, Zhang, Rui, rkumbako,
	Linux PM, Linux Kernel Mailing List, Linux API, Amit Kucheria

On Sat, Oct 2, 2021 at 12:33 AM Daniel Lezcano
<daniel.lezcano@linaro.org> wrote:
>
> The slope of the temperature increase or decrease can be high and when
> the temperature crosses the trip point, there could be a significant
> difference between the trip temperature and the measured temperatures.
>
> That forces the userspace to read the temperature back right after
> receiving a trip violation notification.
>
> In order to be efficient, give the temperature which resulted in the
> trip violation.
>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

This looks fine to me too.

> ---
>  drivers/thermal/thermal_core.c    |  6 ++++--
>  drivers/thermal/thermal_netlink.c | 11 ++++++-----
>  drivers/thermal/thermal_netlink.h |  8 ++++----
>  3 files changed, 14 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
> index 51374f4e1cca..9e243d9f929e 100644
> --- a/drivers/thermal/thermal_core.c
> +++ b/drivers/thermal/thermal_core.c
> @@ -375,10 +375,12 @@ static void handle_thermal_trip(struct thermal_zone_device *tz, int trip)
>         if (tz->last_temperature != THERMAL_TEMP_INVALID) {
>                 if (tz->last_temperature < trip_temp &&
>                     tz->temperature >= trip_temp)
> -                       thermal_notify_tz_trip_up(tz->id, trip);
> +                       thermal_notify_tz_trip_up(tz->id, trip,
> +                                                 tz->temperature);
>                 if (tz->last_temperature >= trip_temp &&
>                     tz->temperature < (trip_temp - hyst))
> -                       thermal_notify_tz_trip_down(tz->id, trip);
> +                       thermal_notify_tz_trip_down(tz->id, trip,
> +                                                   tz->temperature);

While at it, I'm not sure if all of the additional line breaks due to
the line length limit are really necessary.  The code would be easier
to follow without them IMV.

>         }
>
>         if (type == THERMAL_TRIP_CRITICAL || type == THERMAL_TRIP_HOT)
> diff --git a/drivers/thermal/thermal_netlink.c b/drivers/thermal/thermal_netlink.c
> index 1234dbe95895..a16dd4d5d710 100644
> --- a/drivers/thermal/thermal_netlink.c
> +++ b/drivers/thermal/thermal_netlink.c
> @@ -121,7 +121,8 @@ static int thermal_genl_event_tz(struct param *p)
>  static int thermal_genl_event_tz_trip_up(struct param *p)
>  {
>         if (nla_put_u32(p->msg, THERMAL_GENL_ATTR_TZ_ID, p->tz_id) ||
> -           nla_put_u32(p->msg, THERMAL_GENL_ATTR_TZ_TRIP_ID, p->trip_id))
> +           nla_put_u32(p->msg, THERMAL_GENL_ATTR_TZ_TRIP_ID, p->trip_id) ||
> +           nla_put_u32(p->msg, THERMAL_GENL_ATTR_TZ_TEMP, p->temp))
>                 return -EMSGSIZE;
>
>         return 0;
> @@ -285,16 +286,16 @@ int thermal_notify_tz_disable(int tz_id)
>         return thermal_genl_send_event(THERMAL_GENL_EVENT_TZ_DISABLE, &p);
>  }
>
> -int thermal_notify_tz_trip_down(int tz_id, int trip_id)
> +int thermal_notify_tz_trip_down(int tz_id, int trip_id, int temp)
>  {
> -       struct param p = { .tz_id = tz_id, .trip_id = trip_id };
> +       struct param p = { .tz_id = tz_id, .trip_id = trip_id, .temp = temp };
>
>         return thermal_genl_send_event(THERMAL_GENL_EVENT_TZ_TRIP_DOWN, &p);
>  }
>
> -int thermal_notify_tz_trip_up(int tz_id, int trip_id)
> +int thermal_notify_tz_trip_up(int tz_id, int trip_id, int temp)
>  {
> -       struct param p = { .tz_id = tz_id, .trip_id = trip_id };
> +       struct param p = { .tz_id = tz_id, .trip_id = trip_id, .temp = temp };
>
>         return thermal_genl_send_event(THERMAL_GENL_EVENT_TZ_TRIP_UP, &p);
>  }
> diff --git a/drivers/thermal/thermal_netlink.h b/drivers/thermal/thermal_netlink.h
> index 828d1dddfa98..e554f76291f4 100644
> --- a/drivers/thermal/thermal_netlink.h
> +++ b/drivers/thermal/thermal_netlink.h
> @@ -11,8 +11,8 @@ int thermal_notify_tz_create(int tz_id, const char *name);
>  int thermal_notify_tz_delete(int tz_id);
>  int thermal_notify_tz_enable(int tz_id);
>  int thermal_notify_tz_disable(int tz_id);
> -int thermal_notify_tz_trip_down(int tz_id, int id);
> -int thermal_notify_tz_trip_up(int tz_id, int id);
> +int thermal_notify_tz_trip_down(int tz_id, int id, int temp);
> +int thermal_notify_tz_trip_up(int tz_id, int id, int temp);
>  int thermal_notify_tz_trip_delete(int tz_id, int id);
>  int thermal_notify_tz_trip_add(int tz_id, int id, int type,
>                                int temp, int hyst);
> @@ -49,12 +49,12 @@ static inline int thermal_notify_tz_disable(int tz_id)
>         return 0;
>  }
>
> -static inline int thermal_notify_tz_trip_down(int tz_id, int id)
> +static inline int thermal_notify_tz_trip_down(int tz_id, int id, int temp)
>  {
>         return 0;
>  }
>
> -static inline int thermal_notify_tz_trip_up(int tz_id, int id)
> +static inline int thermal_notify_tz_trip_up(int tz_id, int id, int temp)
>  {
>         return 0;
>  }
> --
> 2.25.1
>

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

* Re: [PATCH RESEND] thermal/drivers/netlink: Add the temperature when crossing a trip point
  2021-10-05 15:20 ` Rafael J. Wysocki
@ 2021-10-06 12:20   ` Daniel Lezcano
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Lezcano @ 2021-10-06 12:20 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Srinivas Pandruvada, Zhang, Rui, rkumbako, Linux PM,
	Linux Kernel Mailing List, Linux API, Amit Kucheria

On 05/10/2021 17:20, Rafael J. Wysocki wrote:
> On Sat, Oct 2, 2021 at 12:33 AM Daniel Lezcano
> <daniel.lezcano@linaro.org> wrote:
>>
>> The slope of the temperature increase or decrease can be high and when
>> the temperature crosses the trip point, there could be a significant
>> difference between the trip temperature and the measured temperatures.
>>
>> That forces the userspace to read the temperature back right after
>> receiving a trip violation notification.
>>
>> In order to be efficient, give the temperature which resulted in the
>> trip violation.
>>
>> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
>> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> 
> This looks fine to me too.
> 
>> ---
>>  drivers/thermal/thermal_core.c    |  6 ++++--
>>  drivers/thermal/thermal_netlink.c | 11 ++++++-----
>>  drivers/thermal/thermal_netlink.h |  8 ++++----
>>  3 files changed, 14 insertions(+), 11 deletions(-)
>>
>> diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
>> index 51374f4e1cca..9e243d9f929e 100644
>> --- a/drivers/thermal/thermal_core.c
>> +++ b/drivers/thermal/thermal_core.c
>> @@ -375,10 +375,12 @@ static void handle_thermal_trip(struct thermal_zone_device *tz, int trip)
>>         if (tz->last_temperature != THERMAL_TEMP_INVALID) {
>>                 if (tz->last_temperature < trip_temp &&
>>                     tz->temperature >= trip_temp)
>> -                       thermal_notify_tz_trip_up(tz->id, trip);
>> +                       thermal_notify_tz_trip_up(tz->id, trip,
>> +                                                 tz->temperature);
>>                 if (tz->last_temperature >= trip_temp &&
>>                     tz->temperature < (trip_temp - hyst))
>> -                       thermal_notify_tz_trip_down(tz->id, trip);
>> +                       thermal_notify_tz_trip_down(tz->id, trip,
>> +                                                   tz->temperature);
> 
> While at it, I'm not sure if all of the additional line breaks due to
> the line length limit are really necessary.  The code would be easier
> to follow without them IMV.

Ok let me write another patch to wrap those into a single function and
reduce the indentation.

>>         }
>>
>>         if (type == THERMAL_TRIP_CRITICAL || type == THERMAL_TRIP_HOT)
>> diff --git a/drivers/thermal/thermal_netlink.c b/drivers/thermal/thermal_netlink.c
>> index 1234dbe95895..a16dd4d5d710 100644
>> --- a/drivers/thermal/thermal_netlink.c
>> +++ b/drivers/thermal/thermal_netlink.c
>> @@ -121,7 +121,8 @@ static int thermal_genl_event_tz(struct param *p)
>>  static int thermal_genl_event_tz_trip_up(struct param *p)
>>  {
>>         if (nla_put_u32(p->msg, THERMAL_GENL_ATTR_TZ_ID, p->tz_id) ||
>> -           nla_put_u32(p->msg, THERMAL_GENL_ATTR_TZ_TRIP_ID, p->trip_id))
>> +           nla_put_u32(p->msg, THERMAL_GENL_ATTR_TZ_TRIP_ID, p->trip_id) ||
>> +           nla_put_u32(p->msg, THERMAL_GENL_ATTR_TZ_TEMP, p->temp))
>>                 return -EMSGSIZE;
>>
>>         return 0;
>> @@ -285,16 +286,16 @@ int thermal_notify_tz_disable(int tz_id)
>>         return thermal_genl_send_event(THERMAL_GENL_EVENT_TZ_DISABLE, &p);
>>  }
>>
>> -int thermal_notify_tz_trip_down(int tz_id, int trip_id)
>> +int thermal_notify_tz_trip_down(int tz_id, int trip_id, int temp)
>>  {
>> -       struct param p = { .tz_id = tz_id, .trip_id = trip_id };
>> +       struct param p = { .tz_id = tz_id, .trip_id = trip_id, .temp = temp };
>>
>>         return thermal_genl_send_event(THERMAL_GENL_EVENT_TZ_TRIP_DOWN, &p);
>>  }
>>
>> -int thermal_notify_tz_trip_up(int tz_id, int trip_id)
>> +int thermal_notify_tz_trip_up(int tz_id, int trip_id, int temp)
>>  {
>> -       struct param p = { .tz_id = tz_id, .trip_id = trip_id };
>> +       struct param p = { .tz_id = tz_id, .trip_id = trip_id, .temp = temp };
>>
>>         return thermal_genl_send_event(THERMAL_GENL_EVENT_TZ_TRIP_UP, &p);
>>  }
>> diff --git a/drivers/thermal/thermal_netlink.h b/drivers/thermal/thermal_netlink.h
>> index 828d1dddfa98..e554f76291f4 100644
>> --- a/drivers/thermal/thermal_netlink.h
>> +++ b/drivers/thermal/thermal_netlink.h
>> @@ -11,8 +11,8 @@ int thermal_notify_tz_create(int tz_id, const char *name);
>>  int thermal_notify_tz_delete(int tz_id);
>>  int thermal_notify_tz_enable(int tz_id);
>>  int thermal_notify_tz_disable(int tz_id);
>> -int thermal_notify_tz_trip_down(int tz_id, int id);
>> -int thermal_notify_tz_trip_up(int tz_id, int id);
>> +int thermal_notify_tz_trip_down(int tz_id, int id, int temp);
>> +int thermal_notify_tz_trip_up(int tz_id, int id, int temp);
>>  int thermal_notify_tz_trip_delete(int tz_id, int id);
>>  int thermal_notify_tz_trip_add(int tz_id, int id, int type,
>>                                int temp, int hyst);
>> @@ -49,12 +49,12 @@ static inline int thermal_notify_tz_disable(int tz_id)
>>         return 0;
>>  }
>>
>> -static inline int thermal_notify_tz_trip_down(int tz_id, int id)
>> +static inline int thermal_notify_tz_trip_down(int tz_id, int id, int temp)
>>  {
>>         return 0;
>>  }
>>
>> -static inline int thermal_notify_tz_trip_up(int tz_id, int id)
>> +static inline int thermal_notify_tz_trip_up(int tz_id, int id, int temp)
>>  {
>>         return 0;
>>  }
>> --
>> 2.25.1
>>


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

* [thermal: thermal/next] thermal/drivers/netlink: Add the temperature when crossing a trip point
  2021-10-01 22:33 [PATCH RESEND] thermal/drivers/netlink: Add the temperature when crossing a trip point Daniel Lezcano
  2021-10-05 15:20 ` Rafael J. Wysocki
@ 2021-10-18 11:46 ` thermal-bot for Daniel Lezcano
  1 sibling, 0 replies; 4+ messages in thread
From: thermal-bot for Daniel Lezcano @ 2021-10-18 11:46 UTC (permalink / raw)
  To: linux-pm
  Cc: Daniel Lezcano, Srinivas Pandruvada, Rafael J. Wysocki, rui.zhang, amitk

The following commit has been merged into the thermal/next branch of thermal:

Commit-ID:     fc656fa14da7865774b4251afa88ffcf22bf02d2
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git//fc656fa14da7865774b4251afa88ffcf22bf02d2
Author:        Daniel Lezcano <daniel.lezcano@linaro.org>
AuthorDate:    Sat, 02 Oct 2021 00:33:23 +02:00
Committer:     Daniel Lezcano <daniel.lezcano@linaro.org>
CommitterDate: Thu, 07 Oct 2021 15:41:38 +02:00

thermal/drivers/netlink: Add the temperature when crossing a trip point

The slope of the temperature increase or decrease can be high and when
the temperature crosses the trip point, there could be a significant
difference between the trip temperature and the measured temperatures.

That forces the userspace to read the temperature back right after
receiving a trip violation notification.

In order to be efficient, give the temperature which resulted in the
trip violation.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Link: https://lore.kernel.org/r/20211001223323.1836640-1-daniel.lezcano@linaro.org
---
 drivers/thermal/thermal_core.c    |  6 ++++--
 drivers/thermal/thermal_netlink.c | 11 ++++++-----
 drivers/thermal/thermal_netlink.h |  8 ++++----
 3 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 51374f4..9e243d9 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -375,10 +375,12 @@ static void handle_thermal_trip(struct thermal_zone_device *tz, int trip)
 	if (tz->last_temperature != THERMAL_TEMP_INVALID) {
 		if (tz->last_temperature < trip_temp &&
 		    tz->temperature >= trip_temp)
-			thermal_notify_tz_trip_up(tz->id, trip);
+			thermal_notify_tz_trip_up(tz->id, trip,
+						  tz->temperature);
 		if (tz->last_temperature >= trip_temp &&
 		    tz->temperature < (trip_temp - hyst))
-			thermal_notify_tz_trip_down(tz->id, trip);
+			thermal_notify_tz_trip_down(tz->id, trip,
+						    tz->temperature);
 	}
 
 	if (type == THERMAL_TRIP_CRITICAL || type == THERMAL_TRIP_HOT)
diff --git a/drivers/thermal/thermal_netlink.c b/drivers/thermal/thermal_netlink.c
index 1234dbe..a16dd4d 100644
--- a/drivers/thermal/thermal_netlink.c
+++ b/drivers/thermal/thermal_netlink.c
@@ -121,7 +121,8 @@ static int thermal_genl_event_tz(struct param *p)
 static int thermal_genl_event_tz_trip_up(struct param *p)
 {
 	if (nla_put_u32(p->msg, THERMAL_GENL_ATTR_TZ_ID, p->tz_id) ||
-	    nla_put_u32(p->msg, THERMAL_GENL_ATTR_TZ_TRIP_ID, p->trip_id))
+	    nla_put_u32(p->msg, THERMAL_GENL_ATTR_TZ_TRIP_ID, p->trip_id) ||
+	    nla_put_u32(p->msg, THERMAL_GENL_ATTR_TZ_TEMP, p->temp))
 		return -EMSGSIZE;
 
 	return 0;
@@ -285,16 +286,16 @@ int thermal_notify_tz_disable(int tz_id)
 	return thermal_genl_send_event(THERMAL_GENL_EVENT_TZ_DISABLE, &p);
 }
 
-int thermal_notify_tz_trip_down(int tz_id, int trip_id)
+int thermal_notify_tz_trip_down(int tz_id, int trip_id, int temp)
 {
-	struct param p = { .tz_id = tz_id, .trip_id = trip_id };
+	struct param p = { .tz_id = tz_id, .trip_id = trip_id, .temp = temp };
 
 	return thermal_genl_send_event(THERMAL_GENL_EVENT_TZ_TRIP_DOWN, &p);
 }
 
-int thermal_notify_tz_trip_up(int tz_id, int trip_id)
+int thermal_notify_tz_trip_up(int tz_id, int trip_id, int temp)
 {
-	struct param p = { .tz_id = tz_id, .trip_id = trip_id };
+	struct param p = { .tz_id = tz_id, .trip_id = trip_id, .temp = temp };
 
 	return thermal_genl_send_event(THERMAL_GENL_EVENT_TZ_TRIP_UP, &p);
 }
diff --git a/drivers/thermal/thermal_netlink.h b/drivers/thermal/thermal_netlink.h
index 828d1dd..e554f76 100644
--- a/drivers/thermal/thermal_netlink.h
+++ b/drivers/thermal/thermal_netlink.h
@@ -11,8 +11,8 @@ int thermal_notify_tz_create(int tz_id, const char *name);
 int thermal_notify_tz_delete(int tz_id);
 int thermal_notify_tz_enable(int tz_id);
 int thermal_notify_tz_disable(int tz_id);
-int thermal_notify_tz_trip_down(int tz_id, int id);
-int thermal_notify_tz_trip_up(int tz_id, int id);
+int thermal_notify_tz_trip_down(int tz_id, int id, int temp);
+int thermal_notify_tz_trip_up(int tz_id, int id, int temp);
 int thermal_notify_tz_trip_delete(int tz_id, int id);
 int thermal_notify_tz_trip_add(int tz_id, int id, int type,
 			       int temp, int hyst);
@@ -49,12 +49,12 @@ static inline int thermal_notify_tz_disable(int tz_id)
 	return 0;
 }
 
-static inline int thermal_notify_tz_trip_down(int tz_id, int id)
+static inline int thermal_notify_tz_trip_down(int tz_id, int id, int temp)
 {
 	return 0;
 }
 
-static inline int thermal_notify_tz_trip_up(int tz_id, int id)
+static inline int thermal_notify_tz_trip_up(int tz_id, int id, int temp)
 {
 	return 0;
 }

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

end of thread, other threads:[~2021-10-18 11:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-01 22:33 [PATCH RESEND] thermal/drivers/netlink: Add the temperature when crossing a trip point Daniel Lezcano
2021-10-05 15:20 ` Rafael J. Wysocki
2021-10-06 12:20   ` Daniel Lezcano
2021-10-18 11:46 ` [thermal: thermal/next] " thermal-bot for Daniel Lezcano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.