* [PATCH v2 0/4] One more step to the thermal zone structure encapsulation
@ 2023-07-07 20:37 Daniel Lezcano
2023-07-07 20:37 ` [PATCH v2 1/4] thermal/core: Hardening the self-encapsulation Daniel Lezcano
` (4 more replies)
0 siblings, 5 replies; 10+ messages in thread
From: Daniel Lezcano @ 2023-07-07 20:37 UTC (permalink / raw)
To: daniel.lezcano, rafael
Cc: linux-pm, thierry.reding, linux-kernel, srinivas.pandruvada
The series provides more changes to self-encapsulate the thermal zone device
structure in order to protect wild accesses to the thermal zone device
internals, especially the trip points and the locks.
The first patch adds a macro to warn at compilation time if the
thermal_core.h is included in a file not belonging to the thermal core
code. One warning will happen with the nvidia drivers but this is in
the way to be solved.
The second patch reorders the headers inclusion in the core code.
The next patches makes the int340x drivers to use the thermal trip
update above and the different accessors for thermal zone structure.
Daniel Lezcano (4):
thermal/core: Hardening the self-encapsulation
thermal/core: Reorder the headers inclusion
thermal/drivers/int3400: Use thermal zone device wrappers
thermal/drivers/int340x: Do not check the thermal zone state
drivers/thermal/gov_bang_bang.c | 1 +
drivers/thermal/gov_fair_share.c | 1 +
drivers/thermal/gov_power_allocator.c | 7 +--
drivers/thermal/gov_step_wise.c | 1 +
drivers/thermal/gov_user_space.c | 1 +
.../intel/int340x_thermal/int3400_thermal.c | 44 +++++++++----------
drivers/thermal/thermal_acpi.c | 1 +
drivers/thermal/thermal_core.c | 7 +--
drivers/thermal/thermal_core.h | 4 ++
drivers/thermal/thermal_helpers.c | 1 +
drivers/thermal/thermal_hwmon.c | 1 +
drivers/thermal/thermal_netlink.c | 1 +
drivers/thermal/thermal_of.c | 1 +
drivers/thermal/thermal_sysfs.c | 1 +
drivers/thermal/thermal_trip.c | 1 +
15 files changed, 45 insertions(+), 28 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v2 1/4] thermal/core: Hardening the self-encapsulation
2023-07-07 20:37 [PATCH v2 0/4] One more step to the thermal zone structure encapsulation Daniel Lezcano
@ 2023-07-07 20:37 ` Daniel Lezcano
2023-07-07 20:37 ` [PATCH v2 2/4] thermal/core: Reorder the headers inclusion Daniel Lezcano
` (3 subsequent siblings)
4 siblings, 0 replies; 10+ messages in thread
From: Daniel Lezcano @ 2023-07-07 20:37 UTC (permalink / raw)
To: daniel.lezcano, rafael
Cc: linux-pm, thierry.reding, linux-kernel, srinivas.pandruvada,
Amit Kucheria, Zhang Rui, Lukasz Luba
The thermal private header has leaked all around the drivers which
interacted with the core internals. The thermal zone structure which
was part of the exported header led also to a leakage of the fields
into the different drivers, making very difficult to improve the core
code without having to change the drivers.
Now we fixed how the thermal drivers were interacting with the thermal
zones (actually fixed how they should not interact). The thermal zone
structure has been moved to the private thermal core header. This
header has been removed from the different drivers and must belong to
the core code only. In order to prevent this private header to be
included again in the drivers, make explicit only the core code can
include this header by defining a THERMAL_CORE_SUBSYS macro. The
private header will contain a check against this macro.
The Tegra SoCtherm driver needs to access thermal_core.h to have the
get_thermal_instance() function definition. It is the only one
remaining driver which need to access the thermal_core.h header, so
the check will emit a warning at compilation time.
Thierry Reding is reworking the driver to get rid of this function [1]
and thus when the changes will be merged, the compilation warning will
be converted to a compilation error, closing definitively the door to
the drivers willing to play with the thermal zone device internals.
No functional changes intended.
[1] https://lore.kernel.org/all/20230414125721.1043589-1-thierry.reding@gmail.com/
Cc: Thierry Reding <thierry.reding@gmail.com>
Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
drivers/thermal/gov_bang_bang.c | 1 +
drivers/thermal/gov_fair_share.c | 1 +
drivers/thermal/gov_power_allocator.c | 1 +
drivers/thermal/gov_step_wise.c | 1 +
drivers/thermal/gov_user_space.c | 1 +
drivers/thermal/thermal_acpi.c | 1 +
drivers/thermal/thermal_core.c | 1 +
drivers/thermal/thermal_core.h | 4 ++++
drivers/thermal/thermal_helpers.c | 1 +
drivers/thermal/thermal_hwmon.c | 1 +
drivers/thermal/thermal_netlink.c | 1 +
drivers/thermal/thermal_of.c | 1 +
drivers/thermal/thermal_sysfs.c | 1 +
drivers/thermal/thermal_trip.c | 1 +
14 files changed, 17 insertions(+)
diff --git a/drivers/thermal/gov_bang_bang.c b/drivers/thermal/gov_bang_bang.c
index 1b121066521f..752c627075ba 100644
--- a/drivers/thermal/gov_bang_bang.c
+++ b/drivers/thermal/gov_bang_bang.c
@@ -11,6 +11,7 @@
#include <linux/thermal.h>
+#define THERMAL_CORE_SUBSYS
#include "thermal_core.h"
static int thermal_zone_trip_update(struct thermal_zone_device *tz, int trip_id)
diff --git a/drivers/thermal/gov_fair_share.c b/drivers/thermal/gov_fair_share.c
index 03c2daeb6ee8..108cb5074594 100644
--- a/drivers/thermal/gov_fair_share.c
+++ b/drivers/thermal/gov_fair_share.c
@@ -13,6 +13,7 @@
#include <linux/thermal.h>
#include "thermal_trace.h"
+#define THERMAL_CORE_SUBSYS
#include "thermal_core.h"
/**
diff --git a/drivers/thermal/gov_power_allocator.c b/drivers/thermal/gov_power_allocator.c
index 8642f1096b91..d1c6ad92e5b4 100644
--- a/drivers/thermal/gov_power_allocator.c
+++ b/drivers/thermal/gov_power_allocator.c
@@ -14,6 +14,7 @@
#define CREATE_TRACE_POINTS
#include "thermal_trace_ipa.h"
+#define THERMAL_CORE_SUBSYS
#include "thermal_core.h"
#define INVALID_TRIP -1
diff --git a/drivers/thermal/gov_step_wise.c b/drivers/thermal/gov_step_wise.c
index 1050fb4d94c2..1c844004afe5 100644
--- a/drivers/thermal/gov_step_wise.c
+++ b/drivers/thermal/gov_step_wise.c
@@ -14,6 +14,7 @@
#include <linux/minmax.h>
#include "thermal_trace.h"
+#define THERMAL_CORE_SUBSYS
#include "thermal_core.h"
/*
diff --git a/drivers/thermal/gov_user_space.c b/drivers/thermal/gov_user_space.c
index 8bc1c22aaf03..8883c9ca930f 100644
--- a/drivers/thermal/gov_user_space.c
+++ b/drivers/thermal/gov_user_space.c
@@ -13,6 +13,7 @@
#include <linux/slab.h>
#include <linux/thermal.h>
+#define THERMAL_CORE_SUBSYS
#include "thermal_core.h"
static int user_space_bind(struct thermal_zone_device *tz)
diff --git a/drivers/thermal/thermal_acpi.c b/drivers/thermal/thermal_acpi.c
index 0e5698818f69..556c9f0cc40d 100644
--- a/drivers/thermal/thermal_acpi.c
+++ b/drivers/thermal/thermal_acpi.c
@@ -9,6 +9,7 @@
#include <linux/acpi.h>
#include <linux/units.h>
+#define THERMAL_CORE_SUBSYS
#include "thermal_core.h"
/*
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 842f678c1c3e..6bca97e27d59 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -24,6 +24,7 @@
#define CREATE_TRACE_POINTS
#include "thermal_trace.h"
+#define THERMAL_CORE_SUBSYS
#include "thermal_core.h"
#include "thermal_hwmon.h"
diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h
index 17c1bbed734d..2f58eb9854ff 100644
--- a/drivers/thermal/thermal_core.h
+++ b/drivers/thermal/thermal_core.h
@@ -14,6 +14,10 @@
#include "thermal_netlink.h"
+#ifndef THERMAL_CORE_SUBSYS
+#warning This header can only be included by the thermal core code
+#endif
+
/* Default Thermal Governor */
#if defined(CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE)
#define DEFAULT_THERMAL_GOVERNOR "step_wise"
diff --git a/drivers/thermal/thermal_helpers.c b/drivers/thermal/thermal_helpers.c
index cfba0965a22d..164c4627949e 100644
--- a/drivers/thermal/thermal_helpers.c
+++ b/drivers/thermal/thermal_helpers.c
@@ -19,6 +19,7 @@
#include <linux/string.h>
#include <linux/sysfs.h>
+#define THERMAL_CORE_SUBSYS
#include "thermal_core.h"
#include "thermal_trace.h"
diff --git a/drivers/thermal/thermal_hwmon.c b/drivers/thermal/thermal_hwmon.c
index c3ae44659b81..ba2ae5be0c23 100644
--- a/drivers/thermal/thermal_hwmon.c
+++ b/drivers/thermal/thermal_hwmon.c
@@ -17,6 +17,7 @@
#include <linux/thermal.h>
#include "thermal_hwmon.h"
+#define THERMAL_CORE_SUBSYS
#include "thermal_core.h"
/* hwmon sys I/F */
diff --git a/drivers/thermal/thermal_netlink.c b/drivers/thermal/thermal_netlink.c
index 08bc46c3ec7b..f3ac6432bf5f 100644
--- a/drivers/thermal/thermal_netlink.c
+++ b/drivers/thermal/thermal_netlink.c
@@ -11,6 +11,7 @@
#include <net/genetlink.h>
#include <uapi/linux/thermal.h>
+#define THERMAL_CORE_SUBSYS
#include "thermal_core.h"
static const struct genl_multicast_group thermal_genl_mcgrps[] = {
diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c
index 6fb14e521197..0f2aca2d1dea 100644
--- a/drivers/thermal/thermal_of.c
+++ b/drivers/thermal/thermal_of.c
@@ -17,6 +17,7 @@
#include <linux/types.h>
#include <linux/string.h>
+#define THERMAL_CORE_SUBSYS
#include "thermal_core.h"
/*** functions parsing device tree nodes ***/
diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/thermal/thermal_sysfs.c
index 6c20c9f90a05..ccda2579ae82 100644
--- a/drivers/thermal/thermal_sysfs.c
+++ b/drivers/thermal/thermal_sysfs.c
@@ -19,6 +19,7 @@
#include <linux/string.h>
#include <linux/jiffies.h>
+#define THERMAL_CORE_SUBSYS
#include "thermal_core.h"
/* sys I/F for thermal zone */
diff --git a/drivers/thermal/thermal_trip.c b/drivers/thermal/thermal_trip.c
index 907f3a4d7bc8..61d927c35776 100644
--- a/drivers/thermal/thermal_trip.c
+++ b/drivers/thermal/thermal_trip.c
@@ -7,6 +7,7 @@
*
* Thermal trips handling
*/
+#define THERMAL_CORE_SUBSYS
#include "thermal_core.h"
int __for_each_thermal_trip(struct thermal_zone_device *tz,
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v2 2/4] thermal/core: Reorder the headers inclusion
2023-07-07 20:37 [PATCH v2 0/4] One more step to the thermal zone structure encapsulation Daniel Lezcano
2023-07-07 20:37 ` [PATCH v2 1/4] thermal/core: Hardening the self-encapsulation Daniel Lezcano
@ 2023-07-07 20:37 ` Daniel Lezcano
2023-07-07 20:37 ` [PATCH v2 3/4] thermal/drivers/int3400: Use thermal zone device wrappers Daniel Lezcano
` (2 subsequent siblings)
4 siblings, 0 replies; 10+ messages in thread
From: Daniel Lezcano @ 2023-07-07 20:37 UTC (permalink / raw)
To: daniel.lezcano, rafael
Cc: linux-pm, thierry.reding, linux-kernel, srinivas.pandruvada,
Lukasz Luba, Amit Kucheria, Zhang Rui
The next changes will move the thermal device structure inside the
thermal core code. Consequently, the traces must be included after
thermal_core.h as this one contains the thermal zone device structure
definition the traces need.
Reorder the inclusions.
No functional changes intended.
Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
drivers/thermal/gov_power_allocator.c | 6 +++---
drivers/thermal/thermal_core.c | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/thermal/gov_power_allocator.c b/drivers/thermal/gov_power_allocator.c
index d1c6ad92e5b4..6056ed15460b 100644
--- a/drivers/thermal/gov_power_allocator.c
+++ b/drivers/thermal/gov_power_allocator.c
@@ -11,12 +11,12 @@
#include <linux/slab.h>
#include <linux/thermal.h>
-#define CREATE_TRACE_POINTS
-#include "thermal_trace_ipa.h"
-
#define THERMAL_CORE_SUBSYS
#include "thermal_core.h"
+#define CREATE_TRACE_POINTS
+#include "thermal_trace_ipa.h"
+
#define INVALID_TRIP -1
#define FRAC_BITS 10
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 6bca97e27d59..afcd4197babd 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -21,13 +21,13 @@
#include <linux/of.h>
#include <linux/suspend.h>
-#define CREATE_TRACE_POINTS
-#include "thermal_trace.h"
-
#define THERMAL_CORE_SUBSYS
#include "thermal_core.h"
#include "thermal_hwmon.h"
+#define CREATE_TRACE_POINTS
+#include "thermal_trace.h"
+
static DEFINE_IDA(thermal_tz_ida);
static DEFINE_IDA(thermal_cdev_ida);
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v2 3/4] thermal/drivers/int3400: Use thermal zone device wrappers
2023-07-07 20:37 [PATCH v2 0/4] One more step to the thermal zone structure encapsulation Daniel Lezcano
2023-07-07 20:37 ` [PATCH v2 1/4] thermal/core: Hardening the self-encapsulation Daniel Lezcano
2023-07-07 20:37 ` [PATCH v2 2/4] thermal/core: Reorder the headers inclusion Daniel Lezcano
@ 2023-07-07 20:37 ` Daniel Lezcano
2023-07-07 20:37 ` [PATCH v2 4/4] thermal/drivers/int340x: Do not check the thermal zone state Daniel Lezcano
2023-07-13 9:33 ` [PATCH v2 0/4] One more step to the thermal zone structure encapsulation Daniel Lezcano
4 siblings, 0 replies; 10+ messages in thread
From: Daniel Lezcano @ 2023-07-07 20:37 UTC (permalink / raw)
To: daniel.lezcano, rafael
Cc: linux-pm, thierry.reding, linux-kernel, srinivas.pandruvada,
Amit Kucheria, Zhang Rui, Niklas Söderlund, Baolin Wang,
ye xingchen, Lee, Chun-Yi
Use the thermal core API to access the thermal zone "type" field
instead of directly using the structure field. While here, remove
access to the temperature field, as this driver is reporting fake
temperature, which can be replaced with INT3400_FAKE_TEMP. Also
replace hardcoded 20C with INT3400_FAKE_TEMP
Acked-by: srinivas pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
.../thermal/intel/int340x_thermal/int3400_thermal.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
index 5e1164226ada..72a6e28ded2e 100644
--- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
+++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
@@ -15,6 +15,7 @@
#define INT3400_THERMAL_TABLE_CHANGED 0x83
#define INT3400_ODVP_CHANGED 0x88
#define INT3400_KEEP_ALIVE 0xA0
+#define INT3400_FAKE_TEMP (20 * 1000) /* faked temp sensor with 20C */
enum int3400_thermal_uuid {
INT3400_THERMAL_ACTIVE = 0,
@@ -453,6 +454,7 @@ static void int3400_notify(acpi_handle handle,
void *data)
{
struct int3400_thermal_priv *priv = data;
+ struct device *dev;
char *thermal_prop[5];
int therm_event;
@@ -475,12 +477,14 @@ static void int3400_notify(acpi_handle handle,
return;
}
- thermal_prop[0] = kasprintf(GFP_KERNEL, "NAME=%s", priv->thermal->type);
- thermal_prop[1] = kasprintf(GFP_KERNEL, "TEMP=%d", priv->thermal->temperature);
+ dev = thermal_zone_device(priv->thermal);
+
+ thermal_prop[0] = kasprintf(GFP_KERNEL, "NAME=%s", thermal_zone_device_type(priv->thermal));
+ thermal_prop[1] = kasprintf(GFP_KERNEL, "TEMP=%d", INT3400_FAKE_TEMP);
thermal_prop[2] = kasprintf(GFP_KERNEL, "TRIP=");
thermal_prop[3] = kasprintf(GFP_KERNEL, "EVENT=%d", therm_event);
thermal_prop[4] = NULL;
- kobject_uevent_env(&priv->thermal->device.kobj, KOBJ_CHANGE, thermal_prop);
+ kobject_uevent_env(&dev->kobj, KOBJ_CHANGE, thermal_prop);
kfree(thermal_prop[0]);
kfree(thermal_prop[1]);
kfree(thermal_prop[2]);
@@ -490,7 +494,7 @@ static void int3400_notify(acpi_handle handle,
static int int3400_thermal_get_temp(struct thermal_zone_device *thermal,
int *temp)
{
- *temp = 20 * 1000; /* faked temp sensor with 20C */
+ *temp = INT3400_FAKE_TEMP;
return 0;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v2 4/4] thermal/drivers/int340x: Do not check the thermal zone state
2023-07-07 20:37 [PATCH v2 0/4] One more step to the thermal zone structure encapsulation Daniel Lezcano
` (2 preceding siblings ...)
2023-07-07 20:37 ` [PATCH v2 3/4] thermal/drivers/int3400: Use thermal zone device wrappers Daniel Lezcano
@ 2023-07-07 20:37 ` Daniel Lezcano
2023-07-13 9:33 ` [PATCH v2 0/4] One more step to the thermal zone structure encapsulation Daniel Lezcano
4 siblings, 0 replies; 10+ messages in thread
From: Daniel Lezcano @ 2023-07-07 20:37 UTC (permalink / raw)
To: daniel.lezcano, rafael
Cc: linux-pm, thierry.reding, linux-kernel, srinivas.pandruvada,
Amit Kucheria, Zhang Rui, Dhruva Gole, Heiko Stuebner,
Lee, Chun-Yi, ye xingchen
The driver is accessing the thermal zone state to ensure the state is
different from the one we want to set.
We don't want the driver to access the thermal zone device internals.
Actually, the thermal core code already checks if the thermal zone's
state is different before calling this function, thus this check is
duplicate.
Remove it.
Acked-by: srinivas pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
.../intel/int340x_thermal/int3400_thermal.c | 32 ++++++++-----------
1 file changed, 14 insertions(+), 18 deletions(-)
diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
index 72a6e28ded2e..c40b03d6c29f 100644
--- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
+++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
@@ -503,32 +503,28 @@ static int int3400_thermal_change_mode(struct thermal_zone_device *thermal,
{
struct int3400_thermal_priv *priv = thermal_zone_device_priv(thermal);
int result = 0;
+ int enabled;
if (!priv)
return -EINVAL;
- if (mode != thermal->mode) {
- int enabled;
+ enabled = mode == THERMAL_DEVICE_ENABLED;
- enabled = mode == THERMAL_DEVICE_ENABLED;
-
- if (priv->os_uuid_mask) {
- if (!enabled) {
- priv->os_uuid_mask = 0;
- result = set_os_uuid_mask(priv, priv->os_uuid_mask);
- }
- goto eval_odvp;
+ if (priv->os_uuid_mask) {
+ if (!enabled) {
+ priv->os_uuid_mask = 0;
+ result = set_os_uuid_mask(priv, priv->os_uuid_mask);
}
-
- if (priv->current_uuid_index < 0 ||
- priv->current_uuid_index >= INT3400_THERMAL_MAXIMUM_UUID)
- return -EINVAL;
-
- result = int3400_thermal_run_osc(priv->adev->handle,
- int3400_thermal_uuids[priv->current_uuid_index],
- &enabled);
+ goto eval_odvp;
}
+ if (priv->current_uuid_index < 0 ||
+ priv->current_uuid_index >= INT3400_THERMAL_MAXIMUM_UUID)
+ return -EINVAL;
+
+ result = int3400_thermal_run_osc(priv->adev->handle,
+ int3400_thermal_uuids[priv->current_uuid_index],
+ &enabled);
eval_odvp:
evaluate_odvp(priv);
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH v2 0/4] One more step to the thermal zone structure encapsulation
2023-07-07 20:37 [PATCH v2 0/4] One more step to the thermal zone structure encapsulation Daniel Lezcano
` (3 preceding siblings ...)
2023-07-07 20:37 ` [PATCH v2 4/4] thermal/drivers/int340x: Do not check the thermal zone state Daniel Lezcano
@ 2023-07-13 9:33 ` Daniel Lezcano
2023-07-13 11:30 ` Rafael J. Wysocki
4 siblings, 1 reply; 10+ messages in thread
From: Daniel Lezcano @ 2023-07-13 9:33 UTC (permalink / raw)
To: rafael; +Cc: linux-pm, thierry.reding, linux-kernel, srinivas.pandruvada
On 07/07/2023 22:37, Daniel Lezcano wrote:
> The series provides more changes to self-encapsulate the thermal zone device
> structure in order to protect wild accesses to the thermal zone device
> internals, especially the trip points and the locks.
>
> The first patch adds a macro to warn at compilation time if the
> thermal_core.h is included in a file not belonging to the thermal core
> code. One warning will happen with the nvidia drivers but this is in
> the way to be solved.
>
> The second patch reorders the headers inclusion in the core code.
>
> The next patches makes the int340x drivers to use the thermal trip
> update above and the different accessors for thermal zone structure.
>
> Daniel Lezcano (4):
> thermal/core: Hardening the self-encapsulation
> thermal/core: Reorder the headers inclusion
> thermal/drivers/int3400: Use thermal zone device wrappers
> thermal/drivers/int340x: Do not check the thermal zone state
>
> drivers/thermal/gov_bang_bang.c | 1 +
> drivers/thermal/gov_fair_share.c | 1 +
> drivers/thermal/gov_power_allocator.c | 7 +--
> drivers/thermal/gov_step_wise.c | 1 +
> drivers/thermal/gov_user_space.c | 1 +
> .../intel/int340x_thermal/int3400_thermal.c | 44 +++++++++----------
> drivers/thermal/thermal_acpi.c | 1 +
> drivers/thermal/thermal_core.c | 7 +--
> drivers/thermal/thermal_core.h | 4 ++
> drivers/thermal/thermal_helpers.c | 1 +
> drivers/thermal/thermal_hwmon.c | 1 +
> drivers/thermal/thermal_netlink.c | 1 +
> drivers/thermal/thermal_of.c | 1 +
> drivers/thermal/thermal_sysfs.c | 1 +
> drivers/thermal/thermal_trip.c | 1 +
> 15 files changed, 45 insertions(+), 28 deletions(-)
Applied
--
<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] 10+ messages in thread
* Re: [PATCH v2 0/4] One more step to the thermal zone structure encapsulation
2023-07-13 9:33 ` [PATCH v2 0/4] One more step to the thermal zone structure encapsulation Daniel Lezcano
@ 2023-07-13 11:30 ` Rafael J. Wysocki
2023-07-13 12:24 ` Daniel Lezcano
0 siblings, 1 reply; 10+ messages in thread
From: Rafael J. Wysocki @ 2023-07-13 11:30 UTC (permalink / raw)
To: Daniel Lezcano
Cc: rafael, linux-pm, thierry.reding, linux-kernel,
srinivas.pandruvada
On Thu, Jul 13, 2023 at 11:33 AM Daniel Lezcano
<daniel.lezcano@linaro.org> wrote:
>
> On 07/07/2023 22:37, Daniel Lezcano wrote:
> > The series provides more changes to self-encapsulate the thermal zone device
> > structure in order to protect wild accesses to the thermal zone device
> > internals, especially the trip points and the locks.
> >
> > The first patch adds a macro to warn at compilation time if the
> > thermal_core.h is included in a file not belonging to the thermal core
> > code. One warning will happen with the nvidia drivers but this is in
> > the way to be solved.
> >
> > The second patch reorders the headers inclusion in the core code.
> >
> > The next patches makes the int340x drivers to use the thermal trip
> > update above and the different accessors for thermal zone structure.
> >
> > Daniel Lezcano (4):
> > thermal/core: Hardening the self-encapsulation
> > thermal/core: Reorder the headers inclusion
> > thermal/drivers/int3400: Use thermal zone device wrappers
> > thermal/drivers/int340x: Do not check the thermal zone state
> >
> > drivers/thermal/gov_bang_bang.c | 1 +
> > drivers/thermal/gov_fair_share.c | 1 +
> > drivers/thermal/gov_power_allocator.c | 7 +--
> > drivers/thermal/gov_step_wise.c | 1 +
> > drivers/thermal/gov_user_space.c | 1 +
> > .../intel/int340x_thermal/int3400_thermal.c | 44 +++++++++----------
> > drivers/thermal/thermal_acpi.c | 1 +
> > drivers/thermal/thermal_core.c | 7 +--
> > drivers/thermal/thermal_core.h | 4 ++
> > drivers/thermal/thermal_helpers.c | 1 +
> > drivers/thermal/thermal_hwmon.c | 1 +
> > drivers/thermal/thermal_netlink.c | 1 +
> > drivers/thermal/thermal_of.c | 1 +
> > drivers/thermal/thermal_sysfs.c | 1 +
> > drivers/thermal/thermal_trip.c | 1 +
> > 15 files changed, 45 insertions(+), 28 deletions(-)
>
> Applied
OK
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 0/4] One more step to the thermal zone structure encapsulation
2023-07-13 11:30 ` Rafael J. Wysocki
@ 2023-07-13 12:24 ` Daniel Lezcano
2023-07-13 13:02 ` Rafael J. Wysocki
0 siblings, 1 reply; 10+ messages in thread
From: Daniel Lezcano @ 2023-07-13 12:24 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: linux-pm, thierry.reding, linux-kernel, srinivas.pandruvada
On 13/07/2023 13:30, Rafael J. Wysocki wrote:
> On Thu, Jul 13, 2023 at 11:33 AM Daniel Lezcano
> <daniel.lezcano@linaro.org> wrote:
>>
>> On 07/07/2023 22:37, Daniel Lezcano wrote:
>>> The series provides more changes to self-encapsulate the thermal zone device
>>> structure in order to protect wild accesses to the thermal zone device
>>> internals, especially the trip points and the locks.
>>>
>>> The first patch adds a macro to warn at compilation time if the
>>> thermal_core.h is included in a file not belonging to the thermal core
>>> code. One warning will happen with the nvidia drivers but this is in
>>> the way to be solved.
>>>
>>> The second patch reorders the headers inclusion in the core code.
>>>
>>> The next patches makes the int340x drivers to use the thermal trip
>>> update above and the different accessors for thermal zone structure.
>>>
>>> Daniel Lezcano (4):
>>> thermal/core: Hardening the self-encapsulation
>>> thermal/core: Reorder the headers inclusion
>>> thermal/drivers/int3400: Use thermal zone device wrappers
>>> thermal/drivers/int340x: Do not check the thermal zone state
>>>
>>> drivers/thermal/gov_bang_bang.c | 1 +
>>> drivers/thermal/gov_fair_share.c | 1 +
>>> drivers/thermal/gov_power_allocator.c | 7 +--
>>> drivers/thermal/gov_step_wise.c | 1 +
>>> drivers/thermal/gov_user_space.c | 1 +
>>> .../intel/int340x_thermal/int3400_thermal.c | 44 +++++++++----------
>>> drivers/thermal/thermal_acpi.c | 1 +
>>> drivers/thermal/thermal_core.c | 7 +--
>>> drivers/thermal/thermal_core.h | 4 ++
>>> drivers/thermal/thermal_helpers.c | 1 +
>>> drivers/thermal/thermal_hwmon.c | 1 +
>>> drivers/thermal/thermal_netlink.c | 1 +
>>> drivers/thermal/thermal_of.c | 1 +
>>> drivers/thermal/thermal_sysfs.c | 1 +
>>> drivers/thermal/thermal_trip.c | 1 +
>>> 15 files changed, 45 insertions(+), 28 deletions(-)
>>
>> Applied
Sorry, I did not think you may wanted pull them in.
I can drop them from the tree if you prefer?
--
<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] 10+ messages in thread
* Re: [PATCH v2 0/4] One more step to the thermal zone structure encapsulation
2023-07-13 12:24 ` Daniel Lezcano
@ 2023-07-13 13:02 ` Rafael J. Wysocki
2023-07-13 14:15 ` Daniel Lezcano
0 siblings, 1 reply; 10+ messages in thread
From: Rafael J. Wysocki @ 2023-07-13 13:02 UTC (permalink / raw)
To: Daniel Lezcano
Cc: Rafael J. Wysocki, linux-pm, thierry.reding, linux-kernel,
srinivas.pandruvada
On Thu, Jul 13, 2023 at 2:24 PM Daniel Lezcano
<daniel.lezcano@linaro.org> wrote:
>
> On 13/07/2023 13:30, Rafael J. Wysocki wrote:
> > On Thu, Jul 13, 2023 at 11:33 AM Daniel Lezcano
> > <daniel.lezcano@linaro.org> wrote:
> >>
> >> On 07/07/2023 22:37, Daniel Lezcano wrote:
> >>> The series provides more changes to self-encapsulate the thermal zone device
> >>> structure in order to protect wild accesses to the thermal zone device
> >>> internals, especially the trip points and the locks.
> >>>
> >>> The first patch adds a macro to warn at compilation time if the
> >>> thermal_core.h is included in a file not belonging to the thermal core
> >>> code. One warning will happen with the nvidia drivers but this is in
> >>> the way to be solved.
> >>>
> >>> The second patch reorders the headers inclusion in the core code.
> >>>
> >>> The next patches makes the int340x drivers to use the thermal trip
> >>> update above and the different accessors for thermal zone structure.
> >>>
> >>> Daniel Lezcano (4):
> >>> thermal/core: Hardening the self-encapsulation
> >>> thermal/core: Reorder the headers inclusion
> >>> thermal/drivers/int3400: Use thermal zone device wrappers
> >>> thermal/drivers/int340x: Do not check the thermal zone state
> >>>
> >>> drivers/thermal/gov_bang_bang.c | 1 +
> >>> drivers/thermal/gov_fair_share.c | 1 +
> >>> drivers/thermal/gov_power_allocator.c | 7 +--
> >>> drivers/thermal/gov_step_wise.c | 1 +
> >>> drivers/thermal/gov_user_space.c | 1 +
> >>> .../intel/int340x_thermal/int3400_thermal.c | 44 +++++++++----------
> >>> drivers/thermal/thermal_acpi.c | 1 +
> >>> drivers/thermal/thermal_core.c | 7 +--
> >>> drivers/thermal/thermal_core.h | 4 ++
> >>> drivers/thermal/thermal_helpers.c | 1 +
> >>> drivers/thermal/thermal_hwmon.c | 1 +
> >>> drivers/thermal/thermal_netlink.c | 1 +
> >>> drivers/thermal/thermal_of.c | 1 +
> >>> drivers/thermal/thermal_sysfs.c | 1 +
> >>> drivers/thermal/thermal_trip.c | 1 +
> >>> 15 files changed, 45 insertions(+), 28 deletions(-)
> >>
> >> Applied
>
> Sorry, I did not think you may wanted pull them in.
>
> I can drop them from the tree if you prefer?
Let me apply them directly.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 0/4] One more step to the thermal zone structure encapsulation
2023-07-13 13:02 ` Rafael J. Wysocki
@ 2023-07-13 14:15 ` Daniel Lezcano
0 siblings, 0 replies; 10+ messages in thread
From: Daniel Lezcano @ 2023-07-13 14:15 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: linux-pm, thierry.reding, linux-kernel, srinivas.pandruvada
On 13/07/2023 15:02, Rafael J. Wysocki wrote:
> On Thu, Jul 13, 2023 at 2:24 PM Daniel Lezcano
> <daniel.lezcano@linaro.org> wrote:
>>
>> On 13/07/2023 13:30, Rafael J. Wysocki wrote:
>>> On Thu, Jul 13, 2023 at 11:33 AM Daniel Lezcano
>>> <daniel.lezcano@linaro.org> wrote:
>>>>
>>>> On 07/07/2023 22:37, Daniel Lezcano wrote:
>>>>> The series provides more changes to self-encapsulate the thermal zone device
>>>>> structure in order to protect wild accesses to the thermal zone device
>>>>> internals, especially the trip points and the locks.
>>>>>
>>>>> The first patch adds a macro to warn at compilation time if the
>>>>> thermal_core.h is included in a file not belonging to the thermal core
>>>>> code. One warning will happen with the nvidia drivers but this is in
>>>>> the way to be solved.
>>>>>
>>>>> The second patch reorders the headers inclusion in the core code.
>>>>>
>>>>> The next patches makes the int340x drivers to use the thermal trip
>>>>> update above and the different accessors for thermal zone structure.
>>>>>
>>>>> Daniel Lezcano (4):
>>>>> thermal/core: Hardening the self-encapsulation
>>>>> thermal/core: Reorder the headers inclusion
>>>>> thermal/drivers/int3400: Use thermal zone device wrappers
>>>>> thermal/drivers/int340x: Do not check the thermal zone state
>>>>>
>>>>> drivers/thermal/gov_bang_bang.c | 1 +
>>>>> drivers/thermal/gov_fair_share.c | 1 +
>>>>> drivers/thermal/gov_power_allocator.c | 7 +--
>>>>> drivers/thermal/gov_step_wise.c | 1 +
>>>>> drivers/thermal/gov_user_space.c | 1 +
>>>>> .../intel/int340x_thermal/int3400_thermal.c | 44 +++++++++----------
>>>>> drivers/thermal/thermal_acpi.c | 1 +
>>>>> drivers/thermal/thermal_core.c | 7 +--
>>>>> drivers/thermal/thermal_core.h | 4 ++
>>>>> drivers/thermal/thermal_helpers.c | 1 +
>>>>> drivers/thermal/thermal_hwmon.c | 1 +
>>>>> drivers/thermal/thermal_netlink.c | 1 +
>>>>> drivers/thermal/thermal_of.c | 1 +
>>>>> drivers/thermal/thermal_sysfs.c | 1 +
>>>>> drivers/thermal/thermal_trip.c | 1 +
>>>>> 15 files changed, 45 insertions(+), 28 deletions(-)
>>>>
>>>> Applied
>>
>> Sorry, I did not think you may wanted pull them in.
>>
>> I can drop them from the tree if you prefer?
>
> Let me apply them directly.
Ok
--
<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] 10+ messages in thread
end of thread, other threads:[~2023-07-13 14:16 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-07 20:37 [PATCH v2 0/4] One more step to the thermal zone structure encapsulation Daniel Lezcano
2023-07-07 20:37 ` [PATCH v2 1/4] thermal/core: Hardening the self-encapsulation Daniel Lezcano
2023-07-07 20:37 ` [PATCH v2 2/4] thermal/core: Reorder the headers inclusion Daniel Lezcano
2023-07-07 20:37 ` [PATCH v2 3/4] thermal/drivers/int3400: Use thermal zone device wrappers Daniel Lezcano
2023-07-07 20:37 ` [PATCH v2 4/4] thermal/drivers/int340x: Do not check the thermal zone state Daniel Lezcano
2023-07-13 9:33 ` [PATCH v2 0/4] One more step to the thermal zone structure encapsulation Daniel Lezcano
2023-07-13 11:30 ` Rafael J. Wysocki
2023-07-13 12:24 ` Daniel Lezcano
2023-07-13 13:02 ` Rafael J. Wysocki
2023-07-13 14: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;
as well as URLs for NNTP newsgroup(s).