}
#ifdef CONFIG_PM_SLEEP
- ----static bool acpi_ec_query_flushed(struct acpi_ec *ec)
----{
---- bool flushed;
---- unsigned long flags;
----
---- spin_lock_irqsave(&ec->lock, flags);
---- flushed = !ec->nr_pending_queries;
---- spin_unlock_irqrestore(&ec->lock, flags);
---- return flushed;
----}
----
----static void __acpi_ec_flush_event(struct acpi_ec *ec)
+ ++++static void __acpi_ec_flush_work(void)
{
- bool flushed;
- unsigned long flags;
-
- spin_lock_irqsave(&ec->lock, flags);
- flushed = !ec->nr_pending_queries;
- spin_unlock_irqrestore(&ec->lock, flags);
- return flushed;
- }
-
- static void __acpi_ec_flush_event(struct acpi_ec *ec)
- {
- ---- /*
- ---- * When ec_freeze_events is true, we need to flush events in
- ---- * the proper position before entering the noirq stage.
- ---- */
- ---- wait_event(ec->wait, acpi_ec_query_flushed(ec));
- ---- if (ec_query_wq)
- ---- flush_workqueue(ec_query_wq);
+ ++++ flush_scheduled_work(); /* flush ec->work */
+ ++++ flush_workqueue(ec_query_wq); /* flush queries */
}
static void acpi_ec_disable_event(struct acpi_ec *ec)