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) |