From e864dd8b794ba92b79f21fa0aba2575b854cfc96 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 27 Mar 2020 14:36:23 +0100 Subject: [PATCH] 5.4-stable patches added patches: acpi-pm-s2idle-rework-acpi-events-synchronization.patch --- ...e-rework-acpi-events-synchronization.patch | 80 +++++++++++++++++++ ...fix-busy-detection-by-enabling-mmc_c.patch | 9 +-- queue-5.4/series | 1 + 3 files changed, 83 insertions(+), 7 deletions(-) create mode 100644 queue-5.4/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 00000000000..bd4d5b63bb1 --- /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" +Date: Thu, 28 Nov 2019 23:50:40 +0100 +Subject: ACPI: PM: s2idle: Rework ACPI events synchronization + +From: Rafael J. Wysocki + +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 +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + 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 e1d839f5eef..ad39306f987 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 @@ Tested-By: Peter Geis Signed-off-by: Ulf Hansson Signed-off-by: Sasha Levin --- - 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 @@ index 403ac44a73782..a25c3a4d3f6cb 100644 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 92f2a7dff40..dba596563a3 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -3,3 +3,4 @@ mmc-core-respect-mmc_cap_need_rsp_busy-for-erase-tri.patch 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 -- 2.47.3