diff options
author | Dmitry Torokhov <dtor_core@ameritech.net> | 2005-11-20 00:56:43 -0500 |
---|---|---|
committer | Dmitry Torokhov <dtor_core@ameritech.net> | 2005-11-20 00:56:43 -0500 |
commit | 9e50afd0cb3ff9ee152dbcf8601f5fb7eba5cff8 (patch) | |
tree | f3b2a72384a1b59ea38b201bbf2f35c306941b4b /drivers/input/serio/serio.c | |
parent | bd0ef2356cd85d39387be36fdf1f83a40075057f (diff) |
Input: make serio and gameport more swsusp friendly
kseriod and kgameportd used to process all pending events before
checking for freeze condition. This may cause swsusp to time out
while stopping tasks when resuming. Switch to process events one
by one to check freeze status more often.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/serio/serio.c')
-rw-r--r-- | drivers/input/serio/serio.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c index edd15db17715..fbb69ef6a77b 100644 --- a/drivers/input/serio/serio.c +++ b/drivers/input/serio/serio.c | |||
@@ -269,14 +269,20 @@ static struct serio_event *serio_get_event(void) | |||
269 | return event; | 269 | return event; |
270 | } | 270 | } |
271 | 271 | ||
272 | static void serio_handle_events(void) | 272 | static void serio_handle_event(void) |
273 | { | 273 | { |
274 | struct serio_event *event; | 274 | struct serio_event *event; |
275 | struct serio_driver *serio_drv; | 275 | struct serio_driver *serio_drv; |
276 | 276 | ||
277 | down(&serio_sem); | 277 | down(&serio_sem); |
278 | 278 | ||
279 | while ((event = serio_get_event())) { | 279 | /* |
280 | * Note that we handle only one event here to give swsusp | ||
281 | * a chance to freeze kseriod thread. Serio events should | ||
282 | * be pretty rare so we are not concerned about taking | ||
283 | * performance hit. | ||
284 | */ | ||
285 | if ((event = serio_get_event())) { | ||
280 | 286 | ||
281 | switch (event->type) { | 287 | switch (event->type) { |
282 | case SERIO_REGISTER_PORT: | 288 | case SERIO_REGISTER_PORT: |
@@ -368,7 +374,7 @@ static struct serio *serio_get_pending_child(struct serio *parent) | |||
368 | static int serio_thread(void *nothing) | 374 | static int serio_thread(void *nothing) |
369 | { | 375 | { |
370 | do { | 376 | do { |
371 | serio_handle_events(); | 377 | serio_handle_event(); |
372 | wait_event_interruptible(serio_wait, | 378 | wait_event_interruptible(serio_wait, |
373 | kthread_should_stop() || !list_empty(&serio_event_list)); | 379 | kthread_should_stop() || !list_empty(&serio_event_list)); |
374 | try_to_freeze(); | 380 | try_to_freeze(); |