···217217 }218218219219 if (state)220220- pm_wakeup_hard_event(&device->dev);220220+ pm_wakeup_event(&device->dev, 0);221221222222 ret = blocking_notifier_call_chain(&acpi_lid_notifier, state, device);223223 if (ret == NOTIFY_DONE)···402402 } else {403403 int keycode;404404405405- pm_wakeup_hard_event(&device->dev);405405+ pm_wakeup_event(&device->dev, 0);406406 if (button->suspended)407407 break;408408···534534 lid_device = device;535535 }536536537537- device_init_wakeup(&device->dev, true);538537 printk(KERN_INFO PREFIX "%s [%s]\n", name, acpi_device_bid(device));539538 return 0;540539
+1-2
drivers/acpi/device_pm.c
···2424#include <linux/pm_qos.h>2525#include <linux/pm_domain.h>2626#include <linux/pm_runtime.h>2727-#include <linux/suspend.h>28272928#include "internal.h"3029···399400 mutex_lock(&acpi_pm_notifier_lock);400401401402 if (adev->wakeup.flags.notifier_present) {402402- pm_wakeup_ws_event(adev->wakeup.ws, 0, true);403403+ __pm_wakeup_event(adev->wakeup.ws, 0);403404 if (adev->wakeup.context.work.func)404405 queue_pm_work(&adev->wakeup.context.work);405406 }
-28
drivers/acpi/sleep.c
···663663 acpi_os_wait_events_complete();664664 if (acpi_sci_irq_valid())665665 enable_irq_wake(acpi_sci_irq);666666-667666 return 0;668668-}669669-670670-static void acpi_freeze_wake(void)671671-{672672- /*673673- * If IRQD_WAKEUP_ARMED is not set for the SCI at this point, it means674674- * that the SCI has triggered while suspended, so cancel the wakeup in675675- * case it has not been a wakeup event (the GPEs will be checked later).676676- */677677- if (acpi_sci_irq_valid() &&678678- !irqd_is_wakeup_armed(irq_get_irq_data(acpi_sci_irq)))679679- pm_system_cancel_wakeup();680680-}681681-682682-static void acpi_freeze_sync(void)683683-{684684- /*685685- * Process all pending events in case there are any wakeup ones.686686- *687687- * The EC driver uses the system workqueue, so that one needs to be688688- * flushed too.689689- */690690- acpi_os_wait_events_complete();691691- flush_scheduled_work();692667}693668694669static void acpi_freeze_restore(void)···671696 acpi_disable_wakeup_devices(ACPI_STATE_S0);672697 if (acpi_sci_irq_valid())673698 disable_irq_wake(acpi_sci_irq);674674-675699 acpi_enable_all_runtime_gpes();676700}677701···682708static const struct platform_freeze_ops acpi_freeze_ops = {683709 .begin = acpi_freeze_begin,684710 .prepare = acpi_freeze_prepare,685685- .wake = acpi_freeze_wake,686686- .sync = acpi_freeze_sync,687711 .restore = acpi_freeze_restore,688712 .end = acpi_freeze_end,689713};
···2828/* First wakeup IRQ seen by the kernel in the last cycle. */2929unsigned int pm_wakeup_irq __read_mostly;30303131-/* If greater than 0 and the system is suspending, terminate the suspend. */3232-static atomic_t pm_abort_suspend __read_mostly;3131+/* If set and the system is suspending, terminate the suspend. */3232+static bool pm_abort_suspend __read_mostly;33333434/*3535 * Combined counters of registered wakeup events and wakeup events in progress.···855855 pm_print_active_wakeup_sources();856856 }857857858858- return ret || atomic_read(&pm_abort_suspend) > 0;858858+ return ret || pm_abort_suspend;859859}860860861861void pm_system_wakeup(void)862862{863863- atomic_inc(&pm_abort_suspend);863863+ pm_abort_suspend = true;864864 freeze_wake();865865}866866EXPORT_SYMBOL_GPL(pm_system_wakeup);867867868868-void pm_system_cancel_wakeup(void)868868+void pm_wakeup_clear(void)869869{870870- atomic_dec(&pm_abort_suspend);871871-}872872-873873-void pm_wakeup_clear(bool reset)874874-{870870+ pm_abort_suspend = false;875871 pm_wakeup_irq = 0;876876- if (reset)877877- atomic_set(&pm_abort_suspend, 0);878872}879873880874void pm_system_irq_wakeup(unsigned int irq_number)