From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Linux ACPI <linux-acpi@vger.kernel.org>
Cc: Zhang Rui <rui.zhang@intel.com>,
Linux PM <linux-pm@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Erik Schmauss <erik.schmauss@intel.com>,
Bob Moore <robert.moore@intel.com>,
"Wang, Wendy" <wendy.wang@intel.com>
Subject: [PATCH 2/2] ACPI: EC: Dispatch the EC GPE directly on s2idle wake
Date: Wed, 16 May 2018 14:13:21 +0200 [thread overview]
Message-ID: <3221007.8CUDle5b3u@aspire.rjw.lan> (raw)
In-Reply-To: <2406722.gU2bUHd7bl@aspire.rjw.lan>
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
On platforms where the Low Power S0 Idle _DSM interface is used,
on wakeup from suspend-to-idle, when it is known that the ACPI SCI
has triggered while suspended, dispatch the EC GPE in order to catch
all EC events that may have triggered the wakeup before carrying out
the noirq phase of device resume.
That is needed to handle power button wakeup on some platforms where
the EC goes into a low-power mode during suspend-to-idle and while in
that mode it will discard events after a timeout. If that timeout is
shorter than the time it takes to complete the noirq resume of
devices, looking for EC events after the latter is too late.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reported-by: Zhang Rui <rui.zhang@intel.com>
Tested-by: Wendy Wang <wendy.wang@intel.com>
---
drivers/acpi/ec.c | 6 ++++++
drivers/acpi/internal.h | 1 +
drivers/acpi/sleep.c | 7 +++++++
3 files changed, 14 insertions(+)
Index: linux-pm/drivers/acpi/ec.c
===================================================================
--- linux-pm.orig/drivers/acpi/ec.c
+++ linux-pm/drivers/acpi/ec.c
@@ -1034,6 +1034,12 @@ void acpi_ec_unblock_transactions(void)
acpi_ec_start(first_ec, true);
}
+void acpi_ec_dispatch_gpe(void)
+{
+ if (first_ec)
+ acpi_dispatch_gpe(NULL, first_ec->gpe);
+}
+
/* --------------------------------------------------------------------------
Event Management
-------------------------------------------------------------------------- */
Index: linux-pm/drivers/acpi/internal.h
===================================================================
--- linux-pm.orig/drivers/acpi/internal.h
+++ linux-pm/drivers/acpi/internal.h
@@ -188,6 +188,7 @@ int acpi_ec_ecdt_probe(void);
int acpi_ec_dsdt_probe(void);
void acpi_ec_block_transactions(void);
void acpi_ec_unblock_transactions(void);
+void acpi_ec_dispatch_gpe(void);
int acpi_ec_add_query_handler(struct acpi_ec *ec, u8 query_bit,
acpi_handle handle, acpi_ec_query_func func,
void *data);
Index: linux-pm/drivers/acpi/sleep.c
===================================================================
--- linux-pm.orig/drivers/acpi/sleep.c
+++ linux-pm/drivers/acpi/sleep.c
@@ -989,6 +989,13 @@ static void acpi_s2idle_wake(void)
!irqd_is_wakeup_armed(irq_get_irq_data(acpi_sci_irq))) {
pm_system_cancel_wakeup();
s2idle_wakeup = true;
+ /*
+ * On some platforms with the LPS0 _DSM device noirq resume
+ * takes too much time for EC wakeup events to survive, so look
+ * for them now.
+ */
+ if (lps0_device_handle)
+ acpi_ec_dispatch_gpe();
}
}
next prev parent reply other threads:[~2018-05-16 12:13 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-16 12:10 [PATCH 0/2] ACPI / PM: Dispatch EC GPE early on s2idle resume if LPS0 _DSM is used Rafael J. Wysocki
2018-05-16 12:12 ` [PATCH 1/2] ACPICA: Introduce acpi_dispatch_gpe() Rafael J. Wysocki
2018-05-16 19:18 ` Moore, Robert
2018-05-16 21:03 ` Rafael J. Wysocki
2018-05-16 12:13 ` Rafael J. Wysocki [this message]
2018-05-18 6:10 ` [PATCH 2/2] ACPI: EC: Dispatch the EC GPE directly on s2idle wake kbuild test robot
2018-05-25 6:49 ` Ulf Hansson
2018-05-25 8:08 ` Rafael J. Wysocki
2018-05-25 8:48 ` Rafael J. Wysocki
2018-05-25 9:24 ` Ulf Hansson
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=3221007.8CUDle5b3u@aspire.rjw.lan \
--to=rjw@rjwysocki.net \
--cc=erik.schmauss@intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=robert.moore@intel.com \
--cc=rui.zhang@intel.com \
--cc=wendy.wang@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