5.4-stable patches
added patches:
acpi-pm-s2idle-rework-acpi-events-synchronization.patch
diff --git a/queue-5.4/acpi-pm-s2idle-rework-acpi-events-synchronization.patch b/queue-5.4/acpi-pm-s2idle-rework-acpi-events-synchronization.patch
new file mode 100644
index 0000000..bd4d5b6
--- /dev/null
+++ b/queue-5.4/acpi-pm-s2idle-rework-acpi-events-synchronization.patch
@@ -0,0 +1,80 @@
+From 024aa8732acb7d2503eae43c3fe3504d0a8646d0 Mon Sep 17 00:00:00 2001
+From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
+Date: Thu, 28 Nov 2019 23:50:40 +0100
+Subject: ACPI: PM: s2idle: Rework ACPI events synchronization
+
+From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+
+commit 024aa8732acb7d2503eae43c3fe3504d0a8646d0 upstream.
+
+Note that the EC GPE processing need not be synchronized in
+acpi_s2idle_wake() after invoking acpi_ec_dispatch_gpe(), because
+that function checks the GPE status and dispatches its handler if
+need be and the SCI action handler is not going to run anyway at
+that point.
+
+Moreover, it is better to drain all of the pending ACPI events
+before restoring the working-state configuration of GPEs in
+acpi_s2idle_restore(), because those events are likely to be related
+to system wakeup, in which case they will not be relevant going
+forward.
+
+Rework the code to take these observations into account.
+
+Tested-by: Kenneth R. Crudup <kenny@panix.com>
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/acpi/sleep.c | 26 +++++++++++++++++++-------
+ 1 file changed, 19 insertions(+), 7 deletions(-)
+
+--- a/drivers/acpi/sleep.c
++++ b/drivers/acpi/sleep.c
+@@ -977,6 +977,16 @@ static int acpi_s2idle_prepare_late(void
+ return 0;
+ }
+
++static void acpi_s2idle_sync(void)
++{
++ /*
++ * The EC driver uses the system workqueue and an additional special
++ * one, so those need to be flushed too.
++ */
++ acpi_ec_flush_work();
++ acpi_os_wait_events_complete(); /* synchronize Notify handling */
++}
++
+ static bool acpi_s2idle_wake(void)
+ {
+ if (!acpi_sci_irq_valid())
+@@ -1021,13 +1031,8 @@ static bool acpi_s2idle_wake(void)
+ * should be missed by canceling the wakeup here.
+ */
+ pm_system_cancel_wakeup();
+- /*
+- * The EC driver uses the system workqueue and an additional
+- * special one, so those need to be flushed too.
+- */
+- acpi_os_wait_events_complete(); /* synchronize EC GPE processing */
+- acpi_ec_flush_work();
+- acpi_os_wait_events_complete(); /* synchronize Notify handling */
++
++ acpi_s2idle_sync();
+
+ /*
+ * The SCI is in the "suspended" state now and it cannot produce
+@@ -1055,6 +1060,13 @@ static void acpi_s2idle_restore_early(vo
+
+ static void acpi_s2idle_restore(void)
+ {
++ /*
++ * Drain pending events before restoring the working-state configuration
++ * of GPEs.
++ */
++ acpi_os_wait_events_complete(); /* synchronize GPE processing */
++ acpi_s2idle_sync();
++
+ s2idle_wakeup = false;
+
+ acpi_enable_all_runtime_gpes();
diff --git a/queue-5.4/mmc-sdhci-tegra-fix-busy-detection-by-enabling-mmc_c.patch b/queue-5.4/mmc-sdhci-tegra-fix-busy-detection-by-enabling-mmc_c.patch
index e1d839f..ad39306 100644
--- a/queue-5.4/mmc-sdhci-tegra-fix-busy-detection-by-enabling-mmc_c.patch
+++ b/queue-5.4/mmc-sdhci-tegra-fix-busy-detection-by-enabling-mmc_c.patch
@@ -25,14 +25,12 @@
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
- drivers/mmc/host/sdhci-tegra.c | 3 +++
+ drivers/mmc/host/sdhci-tegra.c | 3 +++
1 file changed, 3 insertions(+)
-diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
-index 403ac44a73782..a25c3a4d3f6cb 100644
--- a/drivers/mmc/host/sdhci-tegra.c
+++ b/drivers/mmc/host/sdhci-tegra.c
-@@ -1552,6 +1552,9 @@ static int sdhci_tegra_probe(struct platform_device *pdev)
+@@ -1552,6 +1552,9 @@ static int sdhci_tegra_probe(struct plat
if (tegra_host->soc_data->nvquirks & NVQUIRK_ENABLE_DDR50)
host->mmc->caps |= MMC_CAP_1_8V_DDR;
@@ -42,6 +40,3 @@
tegra_sdhci_parse_dt(host);
tegra_host->power_gpio = devm_gpiod_get_optional(&pdev->dev, "power",
---
-2.20.1
-
diff --git a/queue-5.4/series b/queue-5.4/series
index 92f2a7d..dba5965 100644
--- a/queue-5.4/series
+++ b/queue-5.4/series
@@ -3,3 +3,4 @@
mmc-core-respect-mmc_cap_need_rsp_busy-for-emmc-slee.patch
mmc-sdhci-omap-fix-busy-detection-by-enabling-mmc_ca.patch
mmc-sdhci-tegra-fix-busy-detection-by-enabling-mmc_c.patch
+acpi-pm-s2idle-rework-acpi-events-synchronization.patch