linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kai-Heng Feng <kai.heng.feng@canonical.com>
To: rjw@rjwysocki.net
Cc: Kai-Heng Feng <kai.heng.feng@canonical.com>,
	Len Brown <lenb@kernel.org>,
	linux-acpi@vger.kernel.org (open list:ACPI),
	linux-kernel@vger.kernel.org (open list)
Subject: [PATCH] ACPI: PM: s2idle: Invoke _PTS for s2idle
Date: Mon, 19 Apr 2021 17:07:50 +0800	[thread overview]
Message-ID: <20210419090750.1272562-1-kai.heng.feng@canonical.com> (raw)

HP EliteBook 840 G8 reboots on s2idle resume, and HP EliteBook 845 G8
wakes up immediately on s2idle. Both are caused by the XMM7360 WWAN PCI
card.

There's a WWAN specific method to really turn off the WWAN via EC:
    Method (_PTS, 1, NotSerialized)  // _PTS: Prepare To Sleep
    {
    ...
        If (CondRefOf (\_SB.PCI0.GP12.PTS))
        {
            \_SB.PCI0.GP12.PTS (Arg0)
        }
    ...
    }

    Scope (_SB.PCI0.GP12)
    {
    ...
        Method (PTS, 1, Serialized)
        {
            If (^^LPCB.EC0.ECRG)
            {
                If ((PDID == 0xFFFF))
                {
                    Return (Zero)
                }

                POFF ()
                SGIO (WWBR, One)
                Sleep (0x1E)
                Acquire (^^LPCB.EC0.ECMX, 0xFFFF)
                ^^LPCB.EC0.WWP = One
                Release (^^LPCB.EC0.ECMX)
                Sleep (0x01F4)
            }

            Return (Zero)
        }
    ...
    }

So let's also invok _PTS for s2idle.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
---
 drivers/acpi/sleep.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
index 09fd13757b65..7e84b4b09919 100644
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -698,6 +698,7 @@ int acpi_s2idle_prepare(void)
 	}
 
 	acpi_enable_wakeup_devices(ACPI_STATE_S0);
+	acpi_enter_sleep_state_prep(ACPI_STATE_S0);
 
 	/* Change the configuration of GPEs to avoid spurious wakeup. */
 	acpi_enable_all_wakeup_gpes();
-- 
2.30.2


             reply	other threads:[~2021-04-19  9:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-19  9:07 Kai-Heng Feng [this message]
2021-04-19 11:34 ` [PATCH] ACPI: PM: s2idle: Invoke _PTS for s2idle Rafael J. Wysocki
2021-04-19 12:17   ` Kai-Heng Feng

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=20210419090750.1272562-1-kai.heng.feng@canonical.com \
    --to=kai.heng.feng@canonical.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    /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;
as well as URLs for NNTP newsgroup(s).