View | Details | Raw Unified | Return to bug 206413 | Differences between
and this patch

Collapse All | Expand All

(-)linux-pm/drivers/acpi/sleep.c (-14 / +32 lines)
Lines 987-1007 static void acpi_s2idle_sync(void) Link Here
987
	acpi_os_wait_events_complete(); /* synchronize Notify handling */
987
	acpi_os_wait_events_complete(); /* synchronize Notify handling */
988
}
988
}
989
989
990
static void acpi_s2idle_wake(void)
990
static bool acpi_s2idle_wake(void)
991
{
991
{
992
	/*
992
	if (!acpi_sci_irq_valid())
993
	 * If IRQD_WAKEUP_ARMED is set for the SCI at this point, the SCI has
993
		return pm_wakeup_pending();
994
	 * not triggered while suspended, so bail out.
994
995
	 */
995
	while (pm_wakeup_pending()) {
996
	if (!acpi_sci_irq_valid() ||
996
		/*
997
	    irqd_is_wakeup_armed(irq_get_irq_data(acpi_sci_irq)))
997
		 * If IRQD_WAKEUP_ARMED is set for the SCI at this point, the
998
		return;
998
		 * SCI has not triggered while suspended, so bail out (the
999
999
		 * wakeup is pending anyway and the SCI is not the source of
1000
	/*
1000
		 * it).
1001
	 * If there are EC events to process, the wakeup may be a spurious one
1001
		 */
1002
	 * coming from the EC.
1002
		if (irqd_is_wakeup_armed(irq_get_irq_data(acpi_sci_irq)))
1003
	 */
1003
			return true;
1004
	if (acpi_ec_dispatch_gpe()) {
1004
1005
		/*
1006
		 * If there are no EC events to process, the wakeup is regarded
1007
		 * as a genuine one.
1008
		 */
1009
		if (!acpi_ec_dispatch_gpe())
1010
			return true;
1011
1005
		/*
1012
		/*
1006
		 * Cancel the wakeup and process all pending events in case
1013
		 * Cancel the wakeup and process all pending events in case
1007
		 * there are any wakeup ones in there.
1014
		 * there are any wakeup ones in there.
Lines 1014-1021 static void acpi_s2idle_wake(void) Link Here
1014
1021
1015
		acpi_s2idle_sync();
1022
		acpi_s2idle_sync();
1016
1023
1024
		/*
1025
		 * The SCI is in the "suspended" state now and it cannot produce
1026
		 * new wakeup events till the rearming below, so if any of them
1027
		 * are pending here, they must be resulting from the processing
1028
		 * of EC events above or coming from somewhere else.
1029
		 */
1030
		if (pm_wakeup_pending())
1031
			return true;
1032
1017
		rearm_wake_irq(acpi_sci_irq);
1033
		rearm_wake_irq(acpi_sci_irq);
1018
	}
1034
	}
1035
1036
	return false;
1019
}
1037
}
1020
1038
1021
static void acpi_s2idle_restore_early(void)
1039
static void acpi_s2idle_restore_early(void)
(-)linux-pm/include/linux/suspend.h (-1 / +1 lines)
Lines 191-197 struct platform_s2idle_ops { Link Here
191
	int (*begin)(void);
191
	int (*begin)(void);
192
	int (*prepare)(void);
192
	int (*prepare)(void);
193
	int (*prepare_late)(void);
193
	int (*prepare_late)(void);
194
	void (*wake)(void);
194
	bool (*wake)(void);
195
	void (*restore_early)(void);
195
	void (*restore_early)(void);
196
	void (*restore)(void);
196
	void (*restore)(void);
197
	void (*end)(void);
197
	void (*end)(void);
(-)linux-pm/kernel/power/suspend.c (-4 / +5 lines)
Lines 131-141 static void s2idle_loop(void) Link Here
131
	 * to avoid them upfront.
131
	 * to avoid them upfront.
132
	 */
132
	 */
133
	for (;;) {
133
	for (;;) {
134
		if (s2idle_ops && s2idle_ops->wake)
134
		if (s2idle_ops && s2idle_ops->wake) {
135
			s2idle_ops->wake();
135
			if (s2idle_ops->wake())
136
136
				break;
137
		if (pm_wakeup_pending())
137
		} else if (pm_wakeup_pending()) {
138
			break;
138
			break;
139
		}
139
140
140
		pm_wakeup_clear(false);
141
		pm_wakeup_clear(false);
141
142

Return to bug 206413