mbox series

[v2,0/4] One more step to the thermal zone structure encapsulation

Message ID 20230707203731.848188-1-daniel.lezcano@linaro.org (mailing list archive)
Headers show
Series One more step to the thermal zone structure encapsulation | expand

Message

Daniel Lezcano July 7, 2023, 8:37 p.m. UTC
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(-)

Comments

Daniel Lezcano July 13, 2023, 9:33 a.m. UTC | #1
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
Rafael J. Wysocki July 13, 2023, 11:30 a.m. UTC | #2
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
Daniel Lezcano July 13, 2023, 12:24 p.m. UTC | #3
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?
Rafael J. Wysocki July 13, 2023, 1:02 p.m. UTC | #4
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.
Daniel Lezcano July 13, 2023, 2:15 p.m. UTC | #5
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