• Chris Feng's avatar
    PM: hibernate: Avoid missing wakeup events during hibernation · 0c4cae1b
    Chris Feng authored
    Wakeup events that occur in the hibernation process's
    hibernation_platform_enter() cannot wake up the system. Although the
    current hibernation framework will execute part of the recovery process
    after a wakeup event occurs, it ultimately performs a shutdown operation
    because the system does not check the return value of
    hibernation_platform_enter(). In short, if a wakeup event occurs before
    putting the system into the final low-power state, it will be missed.
    
    To solve this problem, check the return value of
    hibernation_platform_enter(). When it returns -EAGAIN or -EBUSY (indicate
    the occurrence of a wakeup event), execute the hibernation recovery
    process, discard the previously saved image, and ultimately return to the
    working state.
    Signed-off-by: default avatarChris Feng <chris.feng@mediatek.com>
    [ rjw: Rephrase the message printed when going back to the working state ]
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    0c4cae1b
hibernate.c 30.7 KB