]> git.karo-electronics.de Git - karo-tx-linux.git/commit
epoll: Add a flag, EPOLLWAKEUP, to prevent suspend while epoll events are ready
authorArve Hjønnevåg <arve@android.com>
Sun, 29 Apr 2012 20:53:56 +0000 (22:53 +0200)
committerRafael J. Wysocki <rjw@sisk.pl>
Sun, 29 Apr 2012 20:53:56 +0000 (22:53 +0200)
commit82317aa9ee2c8ef95e70f5acce23e33da16f8160
tree42985a1b7aed7cc83a3e3eb661cefe8939c3408c
parent6c9d216bbc3d1c939aa9fd77d0357b5d671b9dcc
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.

The current implementation uses an extra wakeup_source when
ep_scan_ready_list runs. This can cause problems if a single thread
is polling on wakeup events and frequent non-wakeup events (events
usually arrive during thread freezing) using the same epoll file.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
fs/eventpoll.c
include/linux/capability.h
include/linux/eventpoll.h