aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/gameport
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor_core@ameritech.net>2005-11-20 00:56:43 -0500
committerDmitry Torokhov <dtor_core@ameritech.net>2005-11-20 00:56:43 -0500
commit9e50afd0cb3ff9ee152dbcf8601f5fb7eba5cff8 (patch)
treef3b2a72384a1b59ea38b201bbf2f35c306941b4b /drivers/input/gameport
parentbd0ef2356cd85d39387be36fdf1f83a40075057f (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/gameport')
-rw-r--r--drivers/input/gameport/gameport.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/input/gameport/gameport.c b/drivers/input/gameport/gameport.c
index 0506934244f0..caac6d63d46f 100644
--- a/drivers/input/gameport/gameport.c
+++ b/drivers/input/gameport/gameport.c
@@ -339,14 +339,20 @@ static struct gameport_event *gameport_get_event(void)
339 return event; 339 return event;
340} 340}
341 341
342static void gameport_handle_events(void) 342static void gameport_handle_event(void)
343{ 343{
344 struct gameport_event *event; 344 struct gameport_event *event;
345 struct gameport_driver *gameport_drv; 345 struct gameport_driver *gameport_drv;
346 346
347 down(&gameport_sem); 347 down(&gameport_sem);
348 348
349 while ((event = gameport_get_event())) { 349 /*
350 * Note that we handle only one event here to give swsusp
351 * a chance to freeze kgameportd thread. Gameport events
352 * should be pretty rare so we are not concerned about
353 * taking performance hit.
354 */
355 if ((event = gameport_get_event())) {
350 356
351 switch (event->type) { 357 switch (event->type) {
352 case GAMEPORT_REGISTER_PORT: 358 case GAMEPORT_REGISTER_PORT:
@@ -433,7 +439,7 @@ static struct gameport *gameport_get_pending_child(struct gameport *parent)
433static int gameport_thread(void *nothing) 439static int gameport_thread(void *nothing)
434{ 440{
435 do { 441 do {
436 gameport_handle_events(); 442 gameport_handle_event();
437 wait_event_interruptible(gameport_wait, 443 wait_event_interruptible(gameport_wait,
438 kthread_should_stop() || !list_empty(&gameport_event_list)); 444 kthread_should_stop() || !list_empty(&gameport_event_list));
439 try_to_freeze(); 445 try_to_freeze();