• Srivatsa S. Bhat's avatar
    PM / Sleep: Make [un]lock_system_sleep() generic · 9b6fc5dc
    Srivatsa S. Bhat authored
    The [un]lock_system_sleep() APIs were originally introduced to mutually
    exclude memory hotplug and hibernation.
    
    Directly using mutex_lock(&pm_mutex) to achieve mutual exclusion with
    suspend or hibernation code can lead to freezing failures. However, the
    APIs [un]lock_system_sleep() can be safely used to achieve the same,
    without causing freezing failures.
    
    So, since it would be beneficial to modify all the existing users of
    mutex_lock(&pm_mutex) (in all parts of the kernel), so that they use these
    safe APIs intead, make these APIs generic by removing the restriction that
    they work only when CONFIG_HIBERNATE_CALLBACKS is set. Moreover, that
    restriction didn't buy us anything anyway.
    Suggested-by: default avatarTejun Heo <tj@kernel.org>
    Signed-off-by: default avatarSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
    Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
    9b6fc5dc
suspend.h 14.7 KB