* [PATCH 3/5] thermal/drivers/acpi: Use hot and critical ops
[not found] <20201210121514.25760-1-daniel.lezcano@linaro.org>
@ 2020-12-10 12:15 ` Daniel Lezcano
2020-12-17 6:28 ` Daniel Lezcano
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Lezcano @ 2020-12-10 12:15 UTC (permalink / raw)
To: daniel.lezcano, rui.zhang
Cc: kai.heng.feng, lukasz.luba, srinivas.pandruvada, linux-kernel,
linux-pm, Rafael J. Wysocki, Len Brown,
open list:ACPI THERMAL DRIVER
The acpi driver wants to do a netlink notification in case of a hot or
critical trip point. Implement the corresponding ops to be used for
the thermal zone and use them instead of the notify ops.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
drivers/acpi/thermal.c | 30 ++++++++++++++----------------
1 file changed, 14 insertions(+), 16 deletions(-)
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 12c0ece746f0..b5e4bc9e3282 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -677,27 +677,24 @@ static int thermal_get_trend(struct thermal_zone_device *thermal,
return 0;
}
-
-static int thermal_notify(struct thermal_zone_device *thermal, int trip,
- enum thermal_trip_type trip_type)
+static void acpi_thermal_zone_device_hot(struct thermal_zone_device *thermal)
{
- u8 type = 0;
struct acpi_thermal *tz = thermal->devdata;
- if (trip_type == THERMAL_TRIP_CRITICAL)
- type = ACPI_THERMAL_NOTIFY_CRITICAL;
- else if (trip_type == THERMAL_TRIP_HOT)
- type = ACPI_THERMAL_NOTIFY_HOT;
- else
- return 0;
-
acpi_bus_generate_netlink_event(tz->device->pnp.device_class,
- dev_name(&tz->device->dev), type, 1);
+ dev_name(&tz->device->dev),
+ ACPI_THERMAL_NOTIFY_HOT, 1);
+}
- if (trip_type == THERMAL_TRIP_CRITICAL && nocrt)
- return 1;
+static void acpi_thermal_zone_device_critical(struct thermal_zone_device *thermal)
+{
+ struct acpi_thermal *tz = thermal->devdata;
- return 0;
+ acpi_bus_generate_netlink_event(tz->device->pnp.device_class,
+ dev_name(&tz->device->dev),
+ ACPI_THERMAL_NOTIFY_CRITICAL, 1);
+
+ thermal_zone_device_critical(thermal);
}
static int acpi_thermal_cooling_device_cb(struct thermal_zone_device *thermal,
@@ -812,7 +809,8 @@ static struct thermal_zone_device_ops acpi_thermal_zone_ops = {
.get_trip_temp = thermal_get_trip_temp,
.get_crit_temp = thermal_get_crit_temp,
.get_trend = thermal_get_trend,
- .notify = thermal_notify,
+ .hot = acpi_thermal_zone_device_hot,
+ .critical = acpi_thermal_zone_device_critical,
};
static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 3/5] thermal/drivers/acpi: Use hot and critical ops
2020-12-10 12:15 ` [PATCH 3/5] thermal/drivers/acpi: Use hot and critical ops Daniel Lezcano
@ 2020-12-17 6:28 ` Daniel Lezcano
2020-12-17 11:38 ` Srinivas Pandruvada
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Lezcano @ 2020-12-17 6:28 UTC (permalink / raw)
To: rui.zhang
Cc: kai.heng.feng, lukasz.luba, srinivas.pandruvada, linux-kernel,
linux-pm, Rafael J. Wysocki, Len Brown,
open list:ACPI THERMAL DRIVER
On 10/12/2020 13:15, Daniel Lezcano wrote:
> The acpi driver wants to do a netlink notification in case of a hot or
> critical trip point. Implement the corresponding ops to be used for
> the thermal zone and use them instead of the notify ops.
>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Is there any comment on this patch ?
> ---
> drivers/acpi/thermal.c | 30 ++++++++++++++----------------
> 1 file changed, 14 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
> index 12c0ece746f0..b5e4bc9e3282 100644
> --- a/drivers/acpi/thermal.c
> +++ b/drivers/acpi/thermal.c
> @@ -677,27 +677,24 @@ static int thermal_get_trend(struct thermal_zone_device *thermal,
> return 0;
> }
>
> -
> -static int thermal_notify(struct thermal_zone_device *thermal, int trip,
> - enum thermal_trip_type trip_type)
> +static void acpi_thermal_zone_device_hot(struct thermal_zone_device *thermal)
> {
> - u8 type = 0;
> struct acpi_thermal *tz = thermal->devdata;
>
> - if (trip_type == THERMAL_TRIP_CRITICAL)
> - type = ACPI_THERMAL_NOTIFY_CRITICAL;
> - else if (trip_type == THERMAL_TRIP_HOT)
> - type = ACPI_THERMAL_NOTIFY_HOT;
> - else
> - return 0;
> -
> acpi_bus_generate_netlink_event(tz->device->pnp.device_class,
> - dev_name(&tz->device->dev), type, 1);
> + dev_name(&tz->device->dev),
> + ACPI_THERMAL_NOTIFY_HOT, 1);
> +}
>
> - if (trip_type == THERMAL_TRIP_CRITICAL && nocrt)
> - return 1;
> +static void acpi_thermal_zone_device_critical(struct thermal_zone_device *thermal)
> +{
> + struct acpi_thermal *tz = thermal->devdata;
>
> - return 0;
> + acpi_bus_generate_netlink_event(tz->device->pnp.device_class,
> + dev_name(&tz->device->dev),
> + ACPI_THERMAL_NOTIFY_CRITICAL, 1);
> +
> + thermal_zone_device_critical(thermal);
> }
>
> static int acpi_thermal_cooling_device_cb(struct thermal_zone_device *thermal,
> @@ -812,7 +809,8 @@ static struct thermal_zone_device_ops acpi_thermal_zone_ops = {
> .get_trip_temp = thermal_get_trip_temp,
> .get_crit_temp = thermal_get_crit_temp,
> .get_trend = thermal_get_trend,
> - .notify = thermal_notify,
> + .hot = acpi_thermal_zone_device_hot,
> + .critical = acpi_thermal_zone_device_critical,
> };
>
> static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)
>
--
<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
* Re: [PATCH 3/5] thermal/drivers/acpi: Use hot and critical ops
2020-12-17 6:28 ` Daniel Lezcano
@ 2020-12-17 11:38 ` Srinivas Pandruvada
2020-12-17 13:10 ` Daniel Lezcano
0 siblings, 1 reply; 4+ messages in thread
From: Srinivas Pandruvada @ 2020-12-17 11:38 UTC (permalink / raw)
To: Daniel Lezcano, rui.zhang
Cc: kai.heng.feng, lukasz.luba, linux-kernel, linux-pm,
Rafael J. Wysocki, Len Brown, open list:ACPI THERMAL DRIVER
On Thu, 2020-12-17 at 07:28 +0100, Daniel Lezcano wrote:
> On 10/12/2020 13:15, Daniel Lezcano wrote:
> > The acpi driver wants to do a netlink notification in case of a hot
> > or
> > critical trip point. Implement the corresponding ops to be used for
> > the thermal zone and use them instead of the notify ops.
> >
> > Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
>
> Is there any comment on this patch ?
Looks good to me.
Thanks,
Srinivas
>
> > ---
> > drivers/acpi/thermal.c | 30 ++++++++++++++----------------
> > 1 file changed, 14 insertions(+), 16 deletions(-)
> >
> > diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
> > index 12c0ece746f0..b5e4bc9e3282 100644
> > --- a/drivers/acpi/thermal.c
> > +++ b/drivers/acpi/thermal.c
> > @@ -677,27 +677,24 @@ static int thermal_get_trend(struct
> > thermal_zone_device *thermal,
> > return 0;
> > }
> >
> > -
> > -static int thermal_notify(struct thermal_zone_device *thermal, int
> > trip,
> > - enum thermal_trip_type trip_type)
> > +static void acpi_thermal_zone_device_hot(struct
> > thermal_zone_device *thermal)
> > {
> > - u8 type = 0;
> > struct acpi_thermal *tz = thermal->devdata;
> >
> > - if (trip_type == THERMAL_TRIP_CRITICAL)
> > - type = ACPI_THERMAL_NOTIFY_CRITICAL;
> > - else if (trip_type == THERMAL_TRIP_HOT)
> > - type = ACPI_THERMAL_NOTIFY_HOT;
> > - else
> > - return 0;
> > -
> > acpi_bus_generate_netlink_event(tz->device-
> > >pnp.device_class,
> > - dev_name(&tz->device->dev),
> > type, 1);
> > + dev_name(&tz->device->dev),
> > + ACPI_THERMAL_NOTIFY_HOT,
> > 1);
> > +}
> >
> > - if (trip_type == THERMAL_TRIP_CRITICAL && nocrt)
> > - return 1;
> > +static void acpi_thermal_zone_device_critical(struct
> > thermal_zone_device *thermal)
> > +{
> > + struct acpi_thermal *tz = thermal->devdata;
> >
> > - return 0;
> > + acpi_bus_generate_netlink_event(tz->device-
> > >pnp.device_class,
> > + dev_name(&tz->device->dev),
> > + ACPI_THERMAL_NOTIFY_CRITICA
> > L, 1);
> > +
> > + thermal_zone_device_critical(thermal);
> > }
> >
> > static int acpi_thermal_cooling_device_cb(struct
> > thermal_zone_device *thermal,
> > @@ -812,7 +809,8 @@ static struct thermal_zone_device_ops
> > acpi_thermal_zone_ops = {
> > .get_trip_temp = thermal_get_trip_temp,
> > .get_crit_temp = thermal_get_crit_temp,
> > .get_trend = thermal_get_trend,
> > - .notify = thermal_notify,
> > + .hot = acpi_thermal_zone_device_hot,
> > + .critical = acpi_thermal_zone_device_critical,
> > };
> >
> > static int acpi_thermal_register_thermal_zone(struct acpi_thermal
> > *tz)
> >
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 3/5] thermal/drivers/acpi: Use hot and critical ops
2020-12-17 11:38 ` Srinivas Pandruvada
@ 2020-12-17 13:10 ` Daniel Lezcano
0 siblings, 0 replies; 4+ messages in thread
From: Daniel Lezcano @ 2020-12-17 13:10 UTC (permalink / raw)
To: Srinivas Pandruvada, rui.zhang
Cc: kai.heng.feng, lukasz.luba, linux-kernel, linux-pm,
Rafael J. Wysocki, Len Brown, open list:ACPI THERMAL DRIVER
On 17/12/2020 12:38, Srinivas Pandruvada wrote:
> On Thu, 2020-12-17 at 07:28 +0100, Daniel Lezcano wrote:
>> On 10/12/2020 13:15, Daniel Lezcano wrote:
>>> The acpi driver wants to do a netlink notification in case of a hot
>>> or
>>> critical trip point. Implement the corresponding ops to be used for
>>> the thermal zone and use them instead of the notify ops.
>>>
>>> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
>>
>> Is there any comment on this patch ?
>
> Looks good to me.
Thanks for reviewing
--
<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:[~2020-12-17 13:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20201210121514.25760-1-daniel.lezcano@linaro.org>
2020-12-10 12:15 ` [PATCH 3/5] thermal/drivers/acpi: Use hot and critical ops Daniel Lezcano
2020-12-17 6:28 ` Daniel Lezcano
2020-12-17 11:38 ` Srinivas Pandruvada
2020-12-17 13:10 ` Daniel Lezcano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).