• Rafael J. Wysocki's avatar
    PM: s2idle: ACPI: Fix wakeup interrupts handling · cb1f65c1
    Rafael J. Wysocki authored
    After commit e3728b50 ("ACPI: PM: s2idle: Avoid possible race
    related to the EC GPE") wakeup interrupts occurring immediately after
    the one discarded by acpi_s2idle_wake() may be missed.  Moreover, if
    the SCI triggers again immediately after the rearming in
    acpi_s2idle_wake(), that wakeup may be missed too.
    
    The problem is that pm_system_irq_wakeup() only calls pm_system_wakeup()
    when pm_wakeup_irq is 0, but that's not the case any more after the
    interrupt causing acpi_s2idle_wake() to run until pm_wakeup_irq is
    cleared by the pm_wakeup_clear() call in s2idle_loop().  However,
    there may be wakeup interrupts occurring in that time frame and if
    that happens, they will be missed.
    
    To address that issue first move the clearing of pm_wakeup_irq to
    the point at which it is known that the interrupt causing
    acpi_s2idle_wake() to tun will be discarded, before rearming the SCI
    for wakeup.  Moreover, because that only reduces the size of the
    time window in which t...
    cb1f65c1
sleep.c 26 KB