Re: [PATCH 12/13] Input: Hold wake lock while event queue is not empty.

Pavel Machek
2009-02-05T09:08:04Z

On Wed 2009-02-04 18:50:25, Arve Hj??nnev??g wrote:
> Allows userspace code to process input events while
> the device appears to be asleep.

...

> @@ -55,6 +57,7 @@ static void evdev_pass_event(struct evdev_client *client,
> * Interrupts are disabled, just acquire the lock
> */
> spin_lock(&client->buffer_lock);
> + wake_lock_timeout(&client->wake_lock, 5 * HZ);
> client->buffer[client->head++] = *event;
> client->head &= EVDEV_BUFFER_SIZE - 1;
> spin_unlock(&client->buffer_lock);

...as long as userspace needs less than 5 seconds. Ugly hack.
Pavel

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html