All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Francesco Dolcini <francesco.dolcini@toradex.com>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	l.stach@pengutronix.de, linux-pm@vger.kernel.org
Cc: "Rafael J . Wysocki" <rafael@kernel.org>,
	Fabio Estevam <festevam@gmail.com>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Amit Kucheria <amitk@kernel.org>,
	Jon Nettleton <jon@solid-run.com>,
	NXP Linux Team <linux-imx@nxp.com>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Shawn Guo <shawnguo@kernel.org>,
	Tim Harvey <tharvey@gateworks.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v1] thermal: imx: Make trip point offset configurable
Date: Mon, 16 May 2022 21:06:10 +0200	[thread overview]
Message-ID: <92ae0fd5-f827-ae3c-bbef-d551c9fa5b76@pengutronix.de> (raw)
In-Reply-To: <20220516190001.147919-1-francesco.dolcini@toradex.com>

On 16.05.22 21:00, Francesco Dolcini wrote:
> Currently the imx thermal driver has a hardcoded critical temperature
> value offset of 5 Celsius degrees from the actual SoC maximum
> temperature.
> 
> This affects applications and systems designed to be working on this close
> to the limit, but yet valid, temperature range.
> 
> Given that there is no single value that will fit all the use cases make
> the critical trip point offset from the max temperature configurable
> using a newly added trip_offset module parameter, passive trip point is
> set to 5 Celsius degrees less than the critical. By default the
> system behaves exactly as before.
> 
> Link: https://lore.kernel.org/all/20220420091300.179753-1-francesco.dolcini@toradex.com/
> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> ---
>  drivers/thermal/imx_thermal.c | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c
> index 16663373b682..42d1f8a3eccb 100644
> --- a/drivers/thermal/imx_thermal.c
> +++ b/drivers/thermal/imx_thermal.c
> @@ -86,6 +86,10 @@ enum imx_thermal_trip {
>  #define TEMPMON_IMX6SX			2
>  #define TEMPMON_IMX7D			3
>  
> +static int trip_offset = 5;
> +module_param(trip_offset, int, 0444);

Is this being r--r--r-- intended?

> +MODULE_PARM_DESC(trip_offset, "Critical trip point offset from CPU max temp in Celsius degrees (default 5)");
> +
>  struct thermal_soc_data {
>  	u32 version;
>  
> @@ -504,11 +508,11 @@ static void imx_init_temp_grade(struct platform_device *pdev, u32 ocotp_mem0)
>  	}
>  
>  	/*
> -	 * Set the critical trip point at 5 °C under max
> -	 * Set the passive trip point at 10 °C under max (changeable via sysfs)
> +	 * Set the critical trip point at 5 °C under max (changeable via module param)
> +	 * Set the passive trip point at 5 °C under critical (changeable via sysfs)
>  	 */
> -	data->temp_critical = data->temp_max - (1000 * 5);
> -	data->temp_passive = data->temp_max - (1000 * 10);
> +	data->temp_critical = data->temp_max - (1000 * trip_offset);
> +	data->temp_passive = data->temp_critical - (1000 * 5);
>  }
>  
>  static int imx_init_from_tempmon_data(struct platform_device *pdev)


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

WARNING: multiple messages have this Message-ID (diff)
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Francesco Dolcini <francesco.dolcini@toradex.com>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	l.stach@pengutronix.de, linux-pm@vger.kernel.org
Cc: "Rafael J . Wysocki" <rafael@kernel.org>,
	Fabio Estevam <festevam@gmail.com>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Amit Kucheria <amitk@kernel.org>,
	Jon Nettleton <jon@solid-run.com>,
	NXP Linux Team <linux-imx@nxp.com>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Shawn Guo <shawnguo@kernel.org>,
	Tim Harvey <tharvey@gateworks.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v1] thermal: imx: Make trip point offset configurable
Date: Mon, 16 May 2022 21:06:10 +0200	[thread overview]
Message-ID: <92ae0fd5-f827-ae3c-bbef-d551c9fa5b76@pengutronix.de> (raw)
In-Reply-To: <20220516190001.147919-1-francesco.dolcini@toradex.com>

On 16.05.22 21:00, Francesco Dolcini wrote:
> Currently the imx thermal driver has a hardcoded critical temperature
> value offset of 5 Celsius degrees from the actual SoC maximum
> temperature.
> 
> This affects applications and systems designed to be working on this close
> to the limit, but yet valid, temperature range.
> 
> Given that there is no single value that will fit all the use cases make
> the critical trip point offset from the max temperature configurable
> using a newly added trip_offset module parameter, passive trip point is
> set to 5 Celsius degrees less than the critical. By default the
> system behaves exactly as before.
> 
> Link: https://lore.kernel.org/all/20220420091300.179753-1-francesco.dolcini@toradex.com/
> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> ---
>  drivers/thermal/imx_thermal.c | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c
> index 16663373b682..42d1f8a3eccb 100644
> --- a/drivers/thermal/imx_thermal.c
> +++ b/drivers/thermal/imx_thermal.c
> @@ -86,6 +86,10 @@ enum imx_thermal_trip {
>  #define TEMPMON_IMX6SX			2
>  #define TEMPMON_IMX7D			3
>  
> +static int trip_offset = 5;
> +module_param(trip_offset, int, 0444);

Is this being r--r--r-- intended?

> +MODULE_PARM_DESC(trip_offset, "Critical trip point offset from CPU max temp in Celsius degrees (default 5)");
> +
>  struct thermal_soc_data {
>  	u32 version;
>  
> @@ -504,11 +508,11 @@ static void imx_init_temp_grade(struct platform_device *pdev, u32 ocotp_mem0)
>  	}
>  
>  	/*
> -	 * Set the critical trip point at 5 °C under max
> -	 * Set the passive trip point at 10 °C under max (changeable via sysfs)
> +	 * Set the critical trip point at 5 °C under max (changeable via module param)
> +	 * Set the passive trip point at 5 °C under critical (changeable via sysfs)
>  	 */
> -	data->temp_critical = data->temp_max - (1000 * 5);
> -	data->temp_passive = data->temp_max - (1000 * 10);
> +	data->temp_critical = data->temp_max - (1000 * trip_offset);
> +	data->temp_passive = data->temp_critical - (1000 * 5);
>  }
>  
>  static int imx_init_from_tempmon_data(struct platform_device *pdev)


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-05-16 19:06 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-16 19:00 [PATCH v1] thermal: imx: Make trip point offset configurable Francesco Dolcini
2022-05-16 19:00 ` Francesco Dolcini
2022-05-16 19:06 ` Ahmad Fatoum [this message]
2022-05-16 19:06   ` Ahmad Fatoum
2022-05-16 19:16   ` Francesco Dolcini
2022-05-16 19:16     ` Francesco Dolcini
2022-05-17  4:36     ` Ahmad Fatoum
2022-05-17  4:36       ` Ahmad Fatoum
2022-05-17 15:29 ` Francesco Dolcini
2022-05-17 15:29   ` Francesco Dolcini
2022-05-18  8:55 ` Marco Felsch
2022-05-18  8:55   ` Marco Felsch
2022-05-18  9:49   ` Francesco Dolcini
2022-05-18  9:49     ` Francesco Dolcini
2022-05-18 10:10     ` Daniel Lezcano
2022-05-18 10:10       ` Daniel Lezcano
2022-05-23 14:35       ` Francesco Dolcini
2022-05-23 14:35         ` Francesco Dolcini
2022-05-24  8:35         ` Marco Felsch
2022-05-24  8:35           ` Marco Felsch
2022-05-24 10:07           ` Francesco Dolcini
2022-05-24 10:07             ` Francesco Dolcini
2022-05-24 13:17             ` Daniel Lezcano
2022-05-24 13:17               ` Daniel Lezcano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=92ae0fd5-f827-ae3c-bbef-d551c9fa5b76@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=amitk@kernel.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=festevam@gmail.com \
    --cc=francesco.dolcini@toradex.com \
    --cc=jon@solid-run.com \
    --cc=kernel@pengutronix.de \
    --cc=l.stach@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=tharvey@gateworks.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.