public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Zhang, Rui" <rui.zhang@intel.com>
To: "pmenzel@molgen.mpg.de" <pmenzel@molgen.mpg.de>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>
Cc: "hdegoede@redhat.com" <hdegoede@redhat.com>,
	"Brown, Len" <len.brown@intel.com>,
	"Wysocki, Rafael J" <rafael.j.wysocki@intel.com>,
	"mike@mjones.io" <mike@mjones.io>
Subject: Re: Dell XPS 13 9360 (Kaby Lake): Power button LED stays sporadically trying to S0ix suspend
Date: Wed, 29 May 2024 15:21:38 +0000	[thread overview]
Message-ID: <2c0eae5ed4c60289d4fa09ec5a8251d0d7314256.camel@intel.com> (raw)
In-Reply-To: <83326c68-e1f9-43b3-8cc4-6cf88cfbdbfa@molgen.mpg.de>

Hi, Paul,

Thanks for reporting this.

The problem is that, the system may fail to enter S0ix if it is
suspended with high temperature.
So a delay loop in the driver suspend code is introduced to allow the
system to cool down, ef63b043ac86 ("thermal: intel: pch: fix S0ix
failure due to PCH temperature above threshold"). And then enhanced by
this commit 92923028e979 ("thermal: intel: pch: enhance overheat
handling")

> 
> The difference is:
> 
> 1.  LED stays on:
> 
>          intel_pch_thermal 0000:00:14.2: Wakeup event detected, abort
> cooling

     [ 2918.091771] ACPI: EC: interrupt blocked
     [ 2956.317686] intel_pch_thermal 0000:00:14.2: Wakeup event
detected, abort cooling

so the system doesn't go to a safe temperature after 40+ seconds, and a
wakeup event is fired and s2idle is aborted.

> 
> 2.  LED turns off:
> 
>          intel_pch_thermal 0000:00:14.2: CPU-PCH is cool [44C]
> 
     [ 7977.637987] ACPI: EC: interrupt blocked
     [ 7977.641470] intel_pch_thermal 0000:00:14.2: CPU-PCH is cool
[44C]

In this case, system is not overheat and we suspend immediately.

> Does intel_pch_thermal prevent the system from S0ix suspending, so
> the 
> LED stays on until the device is cooled down?

yes, because we are still in driver .suspend_noirq() callbacks at this
time. And we have to block suspend, or else the system can only reach
PCx after suspended.

>  If so, could this be 
> better logged, so users know, what is going on.

hmmm, any suggestions?
or how about the change below?

Thanks,
rui

---
 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..91a6149df350 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_info(&ptd->pdev->dev,
+			"CPU-PCH overheats [%dC], S0ix might fail.
Start cooling...\n",
+			pch_cur_temp);
+
 	/*
 	 * If current PCH temperature is higher than configured PCH
threshold
 	 * value, run some delay loop with sleep to let the current
temperature
-- 
2.34.1




  reply	other threads:[~2024-05-29 15:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-29  9:55 Dell XPS 13 9360 (Kaby Lake): Power button LED stays sporadically trying to S0ix suspend Paul Menzel
2024-05-29 15:21 ` Zhang, Rui [this message]
2024-05-30  8:37   ` Paul Menzel
2024-05-30 15:20     ` Zhang, Rui

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=2c0eae5ed4c60289d4fa09ec5a8251d0d7314256.camel@intel.com \
    --to=rui.zhang@intel.com \
    --cc=hdegoede@redhat.com \
    --cc=len.brown@intel.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=mike@mjones.io \
    --cc=pmenzel@molgen.mpg.de \
    --cc=rafael.j.wysocki@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox