public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Kai-Heng Feng <kai.heng.feng@canonical.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
	Linux PM <linux-pm@vger.kernel.org>
Subject: Re: How to get "wake up reason" for Suspend-to-Idle
Date: Wed, 17 Aug 2022 13:30:14 +0300	[thread overview]
Message-ID: <YvzDNgBgMiMrfc1M@black.fi.intel.com> (raw)
In-Reply-To: <CAAd53p6VowO3WJt4mUJtxJenL8qbxtPFtXGjgiMkckX71bPrfw@mail.gmail.com>

Hi,

On Wed, Aug 17, 2022 at 03:08:18PM +0800, Kai-Heng Feng wrote:
> We are seeing laptops wake up when Thunderbolt dock gets plugged, or
> even wake up on AC plugging.
> 
> On Windows these events are logged with "Wakeup Reason", and if the
> wakeup event is from unplugging AC, the system will be put to suspend
> again.
> 
> So I wonder if it's possible to get the "Wakeup Reason" under Linux?
> 
> '/sys/power/wakeup_count' seems to be insufficient for this purpose.

I don't know if there is a way but unfortunately several systems (or
their firmware) are expecting Windows style "dark resume" so they pretty
much wake up each time something gets plugged or even unplugged to these
ports. Linux does not have similar mechanism at the moment but I think
at least if you have lid closed it will eventually go back to s2idle.

  reply	other threads:[~2022-08-17 10:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-17  7:08 How to get "wake up reason" for Suspend-to-Idle Kai-Heng Feng
2022-08-17 10:30 ` Mika Westerberg [this message]
2022-08-17 12:53   ` Kai-Heng Feng
2022-08-17 13:35     ` Mika Westerberg
2022-08-17 14:36       ` 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=YvzDNgBgMiMrfc1M@black.fi.intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=kai.heng.feng@canonical.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    /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