[v4,0/3] Thermal ACPI APIs for generic trip points

Message ID 20230110151745.2546131-1-daniel.lezcano@linaro.org
Headers
Series Thermal ACPI APIs for generic trip points |

Message

Daniel Lezcano Jan. 10, 2023, 3:17 p.m. UTC
  Recently sent as a RFC, the thermal ACPI for generic trip points is a set of
functions to fill the generic trip points structure which will become the
standard structure for the thermal framework and its users.

Different Intel drivers and the ACPI thermal driver are using the ACPI tables to
get the thermal zone information. As those are getting the same information,
providing this set of ACPI function with the generic trip points will
consolidate the code.

Also, the Intel PCH and the Intel 34xx drivers are converted to use the generic
trip points relying on the ACPI generic trip point parsing functions.

These changes have been tested on a Thinkpad Lenovo x280 with the PCH and
INT34xx drivers. No regression have been observed, the trip points remain the
same for what is described on this system.

Changelog:
 - V4:
   - Fixed Kconfig option dependency, select THERMAL_ACPI if ACPI is set
     only for the PCH driver

 - V3:
   - Took into account Rafael's comments
   - Used a silence option THERMAL_ACPI in order to stay consistent
     with THERMAL_OF. It is up to the API user to select the option.

 - V2:
   - Fix the thermal ACPI patch where the thermal_acpi.c was not included in
     the series
   - Provide a couple of users of this API which could have been tested on a
     real system

Daniel Lezcano (3):
  thermal/acpi: Add ACPI trip point routines
  thermal/drivers/intel: Use generic trip points for intel_pch
  thermal/drivers/intel: Use generic trip points int340x

 drivers/thermal/Kconfig                       |   4 +
 drivers/thermal/Makefile                      |   1 +
 drivers/thermal/intel/Kconfig                 |   1 +
 drivers/thermal/intel/int340x_thermal/Kconfig |   1 +
 .../int340x_thermal/int340x_thermal_zone.c    | 177 ++++-----------
 .../int340x_thermal/int340x_thermal_zone.h    |  10 +-
 drivers/thermal/intel/intel_pch_thermal.c     |  88 ++------
 drivers/thermal/thermal_acpi.c                | 211 ++++++++++++++++++
 include/linux/thermal.h                       |   8 +
 9 files changed, 287 insertions(+), 214 deletions(-)
 create mode 100644 drivers/thermal/thermal_acpi.c
  

Comments

Daniel Lezcano Jan. 11, 2023, 11:52 a.m. UTC | #1
Can I consider these changes ok for thermal/bleeding-edge ?


On 10/01/2023 16:17, Daniel Lezcano wrote:
> Recently sent as a RFC, the thermal ACPI for generic trip points is a set of
> functions to fill the generic trip points structure which will become the
> standard structure for the thermal framework and its users.
> 
> Different Intel drivers and the ACPI thermal driver are using the ACPI tables to
> get the thermal zone information. As those are getting the same information,
> providing this set of ACPI function with the generic trip points will
> consolidate the code.
> 
> Also, the Intel PCH and the Intel 34xx drivers are converted to use the generic
> trip points relying on the ACPI generic trip point parsing functions.
> 
> These changes have been tested on a Thinkpad Lenovo x280 with the PCH and
> INT34xx drivers. No regression have been observed, the trip points remain the
> same for what is described on this system.
> 
> Changelog:
>   - V4:
>     - Fixed Kconfig option dependency, select THERMAL_ACPI if ACPI is set
>       only for the PCH driver
> 
>   - V3:
>     - Took into account Rafael's comments
>     - Used a silence option THERMAL_ACPI in order to stay consistent
>       with THERMAL_OF. It is up to the API user to select the option.
> 
>   - V2:
>     - Fix the thermal ACPI patch where the thermal_acpi.c was not included in
>       the series
>     - Provide a couple of users of this API which could have been tested on a
>       real system
> 
> Daniel Lezcano (3):
>    thermal/acpi: Add ACPI trip point routines
>    thermal/drivers/intel: Use generic trip points for intel_pch
>    thermal/drivers/intel: Use generic trip points int340x
> 
>   drivers/thermal/Kconfig                       |   4 +
>   drivers/thermal/Makefile                      |   1 +
>   drivers/thermal/intel/Kconfig                 |   1 +
>   drivers/thermal/intel/int340x_thermal/Kconfig |   1 +
>   .../int340x_thermal/int340x_thermal_zone.c    | 177 ++++-----------
>   .../int340x_thermal/int340x_thermal_zone.h    |  10 +-
>   drivers/thermal/intel/intel_pch_thermal.c     |  88 ++------
>   drivers/thermal/thermal_acpi.c                | 211 ++++++++++++++++++
>   include/linux/thermal.h                       |   8 +
>   9 files changed, 287 insertions(+), 214 deletions(-)
>   create mode 100644 drivers/thermal/thermal_acpi.c
>
  
Zhang, Rui Jan. 11, 2023, 2:49 p.m. UTC | #2
On Wed, 2023-01-11 at 12:52 +0100, Daniel Lezcano wrote:
> Can I consider these changes ok for thermal/bleeding-edge ?
> 
> 
Hi, Daniel,

In general, the patch looks good to me.
But can you give me more time so that I can test them on my test box by
this week?

thanks,
rui

> On 10/01/2023 16:17, Daniel Lezcano wrote:
> > Recently sent as a RFC, the thermal ACPI for generic trip points is
> > a set of
> > functions to fill the generic trip points structure which will
> > become the
> > standard structure for the thermal framework and its users.
> > 
> > Different Intel drivers and the ACPI thermal driver are using the
> > ACPI tables to
> > get the thermal zone information. As those are getting the same
> > information,
> > providing this set of ACPI function with the generic trip points
> > will
> > consolidate the code.
> > 
> > Also, the Intel PCH and the Intel 34xx drivers are converted to use
> > the generic
> > trip points relying on the ACPI generic trip point parsing
> > functions.
> > 
> > These changes have been tested on a Thinkpad Lenovo x280 with the
> > PCH and
> > INT34xx drivers. No regression have been observed, the trip points
> > remain the
> > same for what is described on this system.
> > 
> > Changelog:
> >   - V4:
> >     - Fixed Kconfig option dependency, select THERMAL_ACPI if ACPI
> > is set
> >       only for the PCH driver
> > 
> >   - V3:
> >     - Took into account Rafael's comments
> >     - Used a silence option THERMAL_ACPI in order to stay
> > consistent
> >       with THERMAL_OF. It is up to the API user to select the
> > option.
> > 
> >   - V2:
> >     - Fix the thermal ACPI patch where the thermal_acpi.c was not
> > included in
> >       the series
> >     - Provide a couple of users of this API which could have been
> > tested on a
> >       real system
> > 
> > Daniel Lezcano (3):
> >    thermal/acpi: Add ACPI trip point routines
> >    thermal/drivers/intel: Use generic trip points for intel_pch
> >    thermal/drivers/intel: Use generic trip points int340x
> > 
> >   drivers/thermal/Kconfig                       |   4 +
> >   drivers/thermal/Makefile                      |   1 +
> >   drivers/thermal/intel/Kconfig                 |   1 +
> >   drivers/thermal/intel/int340x_thermal/Kconfig |   1 +
> >   .../int340x_thermal/int340x_thermal_zone.c    | 177 ++++---------
> > --
> >   .../int340x_thermal/int340x_thermal_zone.h    |  10 +-
> >   drivers/thermal/intel/intel_pch_thermal.c     |  88 ++------
> >   drivers/thermal/thermal_acpi.c                | 211
> > ++++++++++++++++++
> >   include/linux/thermal.h                       |   8 +
> >   9 files changed, 287 insertions(+), 214 deletions(-)
> >   create mode 100644 drivers/thermal/thermal_acpi.c
> >
  
Daniel Lezcano Jan. 11, 2023, 3:01 p.m. UTC | #3
On 11/01/2023 15:49, Zhang, Rui wrote:
> On Wed, 2023-01-11 at 12:52 +0100, Daniel Lezcano wrote:
>> Can I consider these changes ok for thermal/bleeding-edge ?
>>
>>
> Hi, Daniel,
> 
> In general, the patch looks good to me.
> But can you give me more time so that I can test them on my test box by
> this week?

Ah, yes, definitively. If you have a test box for these changes that is 
awesome.

Do you have a suggestion for a x86 platform to test quark_dts, 
processor_thermal_device_pci and intel_soc_dts_iosf ?
  
Zhang, Rui Jan. 12, 2023, 2:13 a.m. UTC | #4
Hi, Daniel,

On Wed, 2023-01-11 at 16:01 +0100, Daniel Lezcano wrote:
> On 11/01/2023 15:49, Zhang, Rui wrote:
> > On Wed, 2023-01-11 at 12:52 +0100, Daniel Lezcano wrote:
> > > Can I consider these changes ok for thermal/bleeding-edge ?
> > > 
> > > 
> > Hi, Daniel,
> > 
> > In general, the patch looks good to me.
> > But can you give me more time so that I can test them on my test
> > box by
> > this week?
> 
> Ah, yes, definitively. If you have a test box for these changes that
> is 
> awesome.

Yeah. I have one to test both drivers.

> 
> Do you have a suggestion for a x86 platform to test quark_dts, 
> processor_thermal_device_pci and intel_soc_dts_iosf ?

intel_soc_dts_iosf is for Baytrail platform. Both Baytrail and Quark
are nearly 10 years old, and I don't have any of them.

For processor_thermal_device_pci, it should be available on Alderlake
platforms. And I have an internal platform which I can help test the
patches.

thanks,
rui
  
Zhang, Rui Jan. 13, 2023, 11:46 a.m. UTC | #5
Hi, Daniel,

Thanks for the patch series.

I got several "trailing whitespace" warnings when applying the patches,
and there are also some other checkpatch.pl warnings.

Besides that, I only have one comment about patch 3/3, and I have
replied to that thread.

thanks,
rui

On Tue, 2023-01-10 at 16:17 +0100, Daniel Lezcano wrote:
> Recently sent as a RFC, the thermal ACPI for generic trip points is a
> set of
> functions to fill the generic trip points structure which will become
> the
> standard structure for the thermal framework and its users.
> 
> Different Intel drivers and the ACPI thermal driver are using the
> ACPI tables to
> get the thermal zone information. As those are getting the same
> information,
> providing this set of ACPI function with the generic trip points will
> consolidate the code.
> 
> Also, the Intel PCH and the Intel 34xx drivers are converted to use
> the generic
> trip points relying on the ACPI generic trip point parsing functions.
> 
> These changes have been tested on a Thinkpad Lenovo x280 with the PCH
> and
> INT34xx drivers. No regression have been observed, the trip points
> remain the
> same for what is described on this system.
> 
> Changelog:
>  - V4:
>    - Fixed Kconfig option dependency, select THERMAL_ACPI if ACPI is
> set
>      only for the PCH driver
> 
>  - V3:
>    - Took into account Rafael's comments
>    - Used a silence option THERMAL_ACPI in order to stay consistent
>      with THERMAL_OF. It is up to the API user to select the option.
> 
>  - V2:
>    - Fix the thermal ACPI patch where the thermal_acpi.c was not
> included in
>      the series
>    - Provide a couple of users of this API which could have been
> tested on a
>      real system
> 
> Daniel Lezcano (3):
>   thermal/acpi: Add ACPI trip point routines
>   thermal/drivers/intel: Use generic trip points for intel_pch
>   thermal/drivers/intel: Use generic trip points int340x
> 
>  drivers/thermal/Kconfig                       |   4 +
>  drivers/thermal/Makefile                      |   1 +
>  drivers/thermal/intel/Kconfig                 |   1 +
>  drivers/thermal/intel/int340x_thermal/Kconfig |   1 +
>  .../int340x_thermal/int340x_thermal_zone.c    | 177 ++++-----------
>  .../int340x_thermal/int340x_thermal_zone.h    |  10 +-
>  drivers/thermal/intel/intel_pch_thermal.c     |  88 ++------
>  drivers/thermal/thermal_acpi.c                | 211
> ++++++++++++++++++
>  include/linux/thermal.h                       |   8 +
>  9 files changed, 287 insertions(+), 214 deletions(-)
>  create mode 100644 drivers/thermal/thermal_acpi.c
>