public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] hwmon: (coretemp) Delete tjmax debug message
@ 2023-03-30 10:33 Zhang Rui
  2023-03-30 10:33 ` [PATCH v2 2/2] hwmon: (coretemp) Delete an obsolete comment Zhang Rui
  2023-04-07 16:00 ` [PATCH v2 1/2] hwmon: (coretemp) Delete tjmax debug message Guenter Roeck
  0 siblings, 2 replies; 4+ messages in thread
From: Zhang Rui @ 2023-03-30 10:33 UTC (permalink / raw)
  To: jdelvare, linux; +Cc: linux-hwmon, peter.ganzhorn, linux-kernel

After commit c0c67f8761ce ("hwmon: (coretemp) Add support for dynamic
tjmax"), tjmax value is retrieved from MSR every time the temperature is
read.
This means that, with debug message enabled, the tjmax debug message is
printed out for every single temperature read for any CPU. This spams
the syslog.

Ideally, as tjmax is package scope unique, the debug message should show
once when tjmax is changed for one package. But this requires inventing
some new per-package data in the coretemp driver, and this is overkill.

To keep the code simple, delete the tjmax debug message.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
---
 drivers/hwmon/coretemp.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
index 30d77f451937..fe3d4d0dcbed 100644
--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
@@ -286,10 +286,8 @@ static int get_tjmax(struct temp_data *tdata, struct device *dev)
 		 * If the TjMax is not plausible, an assumption
 		 * will be used
 		 */
-		if (val) {
-			dev_dbg(dev, "TjMax is %d degrees C\n", val);
+		if (val)
 			return val * 1000;
-		}
 	}
 
 	if (force_tjmax) {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2 2/2] hwmon: (coretemp) Delete an obsolete comment
  2023-03-30 10:33 [PATCH v2 1/2] hwmon: (coretemp) Delete tjmax debug message Zhang Rui
@ 2023-03-30 10:33 ` Zhang Rui
  2023-04-07 16:01   ` Guenter Roeck
  2023-04-07 16:00 ` [PATCH v2 1/2] hwmon: (coretemp) Delete tjmax debug message Guenter Roeck
  1 sibling, 1 reply; 4+ messages in thread
From: Zhang Rui @ 2023-03-30 10:33 UTC (permalink / raw)
  To: jdelvare, linux; +Cc: linux-hwmon, peter.ganzhorn, linux-kernel

The refinement of tjmax value retrieved from MSR_IA32_TEMPERATURE_TARGET
has been changed for several times.

Now, the raw value from MSR is used without refinement. Thus remove the
obsolete comment.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
---
 drivers/hwmon/coretemp.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
index fe3d4d0dcbed..eba94f68585a 100644
--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
@@ -282,10 +282,6 @@ static int get_tjmax(struct temp_data *tdata, struct device *dev)
 			dev_warn(dev, "Unable to read TjMax from CPU %u\n", tdata->cpu);
 	} else {
 		val = (eax >> 16) & 0xff;
-		/*
-		 * If the TjMax is not plausible, an assumption
-		 * will be used
-		 */
 		if (val)
 			return val * 1000;
 	}
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 1/2] hwmon: (coretemp) Delete tjmax debug message
  2023-03-30 10:33 [PATCH v2 1/2] hwmon: (coretemp) Delete tjmax debug message Zhang Rui
  2023-03-30 10:33 ` [PATCH v2 2/2] hwmon: (coretemp) Delete an obsolete comment Zhang Rui
@ 2023-04-07 16:00 ` Guenter Roeck
  1 sibling, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2023-04-07 16:00 UTC (permalink / raw)
  To: Zhang Rui; +Cc: jdelvare, linux-hwmon, peter.ganzhorn, linux-kernel

On Thu, Mar 30, 2023 at 06:33:45PM +0800, Zhang Rui wrote:
> After commit c0c67f8761ce ("hwmon: (coretemp) Add support for dynamic
> tjmax"), tjmax value is retrieved from MSR every time the temperature is
> read.
> This means that, with debug message enabled, the tjmax debug message is
> printed out for every single temperature read for any CPU. This spams
> the syslog.
> 
> Ideally, as tjmax is package scope unique, the debug message should show
> once when tjmax is changed for one package. But this requires inventing
> some new per-package data in the coretemp driver, and this is overkill.
> 
> To keep the code simple, delete the tjmax debug message.
> 
> Signed-off-by: Zhang Rui <rui.zhang@intel.com>

Applied.

Thanks,
Guenter

> ---
>  drivers/hwmon/coretemp.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
> index 30d77f451937..fe3d4d0dcbed 100644
> --- a/drivers/hwmon/coretemp.c
> +++ b/drivers/hwmon/coretemp.c
> @@ -286,10 +286,8 @@ static int get_tjmax(struct temp_data *tdata, struct device *dev)
>  		 * If the TjMax is not plausible, an assumption
>  		 * will be used
>  		 */
> -		if (val) {
> -			dev_dbg(dev, "TjMax is %d degrees C\n", val);
> +		if (val)
>  			return val * 1000;
> -		}
>  	}
>  
>  	if (force_tjmax) {

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 2/2] hwmon: (coretemp) Delete an obsolete comment
  2023-03-30 10:33 ` [PATCH v2 2/2] hwmon: (coretemp) Delete an obsolete comment Zhang Rui
@ 2023-04-07 16:01   ` Guenter Roeck
  0 siblings, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2023-04-07 16:01 UTC (permalink / raw)
  To: Zhang Rui; +Cc: jdelvare, linux-hwmon, peter.ganzhorn, linux-kernel

On Thu, Mar 30, 2023 at 06:33:46PM +0800, Zhang Rui wrote:
> The refinement of tjmax value retrieved from MSR_IA32_TEMPERATURE_TARGET
> has been changed for several times.
> 
> Now, the raw value from MSR is used without refinement. Thus remove the
> obsolete comment.
> 
> Signed-off-by: Zhang Rui <rui.zhang@intel.com>

Applied.

Thanks,
Guenter

> ---
>  drivers/hwmon/coretemp.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
> index fe3d4d0dcbed..eba94f68585a 100644
> --- a/drivers/hwmon/coretemp.c
> +++ b/drivers/hwmon/coretemp.c
> @@ -282,10 +282,6 @@ static int get_tjmax(struct temp_data *tdata, struct device *dev)
>  			dev_warn(dev, "Unable to read TjMax from CPU %u\n", tdata->cpu);
>  	} else {
>  		val = (eax >> 16) & 0xff;
> -		/*
> -		 * If the TjMax is not plausible, an assumption
> -		 * will be used
> -		 */
>  		if (val)
>  			return val * 1000;
>  	}

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-04-07 16:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-30 10:33 [PATCH v2 1/2] hwmon: (coretemp) Delete tjmax debug message Zhang Rui
2023-03-30 10:33 ` [PATCH v2 2/2] hwmon: (coretemp) Delete an obsolete comment Zhang Rui
2023-04-07 16:01   ` Guenter Roeck
2023-04-07 16:00 ` [PATCH v2 1/2] hwmon: (coretemp) Delete tjmax debug message Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox