epoll: Add a flag, EPOLLWAKEUP, to prevent suspend while epoll events are ready
When an epoll_event, that has the EPOLLWAKEUP flag set, is ready, a wakeup_source will be active to prevent suspend. This can be used to handle wakeup events from a driver that support poll, e.g. input, if that driver wakes up the waitqueue passed to epoll before allowing suspend. Signed-off-by: Arve Hjønnevåg <arve@android.com> Reviewed-by: NeilBrown <neilb@suse.de> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Andy Whitcroft <apw@canonical.com>
This commit is contained in:
committed by
Andy Whitcroft
parent
e857130bbe
commit
815745edaa
@@ -360,8 +360,11 @@ struct cpu_vfs_cap_data {
|
||||
|
||||
#define CAP_WAKE_ALARM 35
|
||||
|
||||
/* Allow preventing system suspends while epoll events are pending */
|
||||
|
||||
#define CAP_LAST_CAP CAP_WAKE_ALARM
|
||||
#define CAP_EPOLLWAKEUP 36
|
||||
|
||||
#define CAP_LAST_CAP CAP_EPOLLWAKEUP
|
||||
|
||||
#define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user