diff mbox series

thermal: intel: intel_pch: Improve cooling log

Message ID 20240530151704.282453-1-rui.zhang@intel.com
State New
Headers show
Series thermal: intel: intel_pch: Improve cooling log | expand

Commit Message

Zhang Rui May 30, 2024, 3:17 p.m. UTC
The intel_pch_thermal cooling mechanism currently only provides one of
the following final conclusions:
1. intel_pch_thermal 0000:00:12.0: CPU-PCH is cool [48C]
2. intel_pch_thermal 0000:00:12.0: CPU-PCH is cool [49C] after 30700 ms delay
3. intel_pch_thermal 0000:00:12.0: CPU-PCH is hot [60C] after 60000 ms delay. S0ix might fail
4. intel_pch_thermal 0000:00:12.0: Wakeup event detected, abort cooling

This does not provide sufficient context about what is happening,
especially for case 4.

Add one line log to indicate when PCH overheats and the cooling delay
has started.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
---
 drivers/thermal/intel/intel_pch_thermal.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Rafael J. Wysocki June 7, 2024, 7:26 p.m. UTC | #1
On Thu, May 30, 2024 at 5:17 PM Zhang Rui <rui.zhang@intel.com> wrote:
>
> The intel_pch_thermal cooling mechanism currently only provides one of
> the following final conclusions:
> 1. intel_pch_thermal 0000:00:12.0: CPU-PCH is cool [48C]
> 2. intel_pch_thermal 0000:00:12.0: CPU-PCH is cool [49C] after 30700 ms delay
> 3. intel_pch_thermal 0000:00:12.0: CPU-PCH is hot [60C] after 60000 ms delay. S0ix might fail
> 4. intel_pch_thermal 0000:00:12.0: Wakeup event detected, abort cooling
>
> This does not provide sufficient context about what is happening,
> especially for case 4.
>
> Add one line log to indicate when PCH overheats and the cooling delay
> has started.
>
> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
> ---
>  drivers/thermal/intel/intel_pch_thermal.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/drivers/thermal/intel/intel_pch_thermal.c b/drivers/thermal/intel/intel_pch_thermal.c
> index f5be2c389351..fc326985796c 100644
> --- a/drivers/thermal/intel/intel_pch_thermal.c
> +++ b/drivers/thermal/intel/intel_pch_thermal.c
> @@ -298,6 +298,11 @@ static int intel_pch_thermal_suspend_noirq(struct device *device)
>         /* Get the PCH current temperature value */
>         pch_cur_temp = GET_PCH_TEMP(WPT_TEMP_TSR & readw(ptd->hw_base + WPT_TEMP));
>
> +       if (pch_cur_temp >= pch_thr_temp)
> +               dev_warn(&ptd->pdev->dev,
> +                       "CPU-PCH current temp [%dC] higher than the threshold temp [%dC], S0ix might fail. Start cooling...\n",
> +                       pch_cur_temp, pch_thr_temp);
> +
>         /*
>          * If current PCH temperature is higher than configured PCH threshold
>          * value, run some delay loop with sleep to let the current temperature
> --

Applied as 6.11 material, thanks!
diff mbox series

Patch

diff --git a/drivers/thermal/intel/intel_pch_thermal.c b/drivers/thermal/intel/intel_pch_thermal.c
index f5be2c389351..fc326985796c 100644
--- a/drivers/thermal/intel/intel_pch_thermal.c
+++ b/drivers/thermal/intel/intel_pch_thermal.c
@@ -298,6 +298,11 @@  static int intel_pch_thermal_suspend_noirq(struct device *device)
 	/* Get the PCH current temperature value */
 	pch_cur_temp = GET_PCH_TEMP(WPT_TEMP_TSR & readw(ptd->hw_base + WPT_TEMP));
 
+	if (pch_cur_temp >= pch_thr_temp)
+		dev_warn(&ptd->pdev->dev,
+			"CPU-PCH current temp [%dC] higher than the threshold temp [%dC], S0ix might fail. Start cooling...\n",
+			pch_cur_temp, pch_thr_temp);
+
 	/*
 	 * If current PCH temperature is higher than configured PCH threshold
 	 * value, run some delay loop with sleep to let the current temperature