From e42837bcd35b75bb59ae5d3e62f87be1aeeb05c3 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Thu, 18 Oct 2007 03:04:45 -0700 Subject: freezer: introduce freezer-friendly waiting macros Introduce freezer-friendly wrappers around wait_event_interruptible() and wait_event_interruptible_timeout(), originally defined in , to be used in freezable kernel threads. Make some of the freezable kernel threads use them. This is necessary for the freezer to stop sending signals to kernel threads, which is implemented in the next patch. Signed-off-by: Rafael J. Wysocki Acked-by: Pavel Machek Cc: Nigel Cunningham Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/input/gameport/gameport.c | 3 +-- drivers/input/serio/serio.c | 3 +-- drivers/input/touchscreen/ucb1400_ts.c | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) (limited to 'drivers/input') diff --git a/drivers/input/gameport/gameport.c b/drivers/input/gameport/gameport.c index 20896d5..ec1b6cf 100644 --- a/drivers/input/gameport/gameport.c +++ b/drivers/input/gameport/gameport.c @@ -448,9 +448,8 @@ static int gameport_thread(void *nothing) set_freezable(); do { gameport_handle_event(); - wait_event_interruptible(gameport_wait, + wait_event_freezable(gameport_wait, kthread_should_stop() || !list_empty(&gameport_event_list)); - try_to_freeze(); } while (!kthread_should_stop()); printk(KERN_DEBUG "gameport: kgameportd exiting\n"); diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c index b3bc15a..7f52938 100644 --- a/drivers/input/serio/serio.c +++ b/drivers/input/serio/serio.c @@ -387,9 +387,8 @@ static int serio_thread(void *nothing) set_freezable(); do { serio_handle_event(); - wait_event_interruptible(serio_wait, + wait_event_freezable(serio_wait, kthread_should_stop() || !list_empty(&serio_event_list)); - try_to_freeze(); } while (!kthread_should_stop()); printk(KERN_DEBUG "serio: kseriod exiting\n"); diff --git a/drivers/input/touchscreen/ucb1400_ts.c b/drivers/input/touchscreen/ucb1400_ts.c index 86aed64..89373b0 100644 --- a/drivers/input/touchscreen/ucb1400_ts.c +++ b/drivers/input/touchscreen/ucb1400_ts.c @@ -333,10 +333,9 @@ static int ucb1400_ts_thread(void *_ucb) timeout = msecs_to_jiffies(10); } - wait_event_interruptible_timeout(ucb->ts_wait, + wait_event_freezable_timeout(ucb->ts_wait, ucb->irq_pending || ucb->ts_restart || kthread_should_stop(), timeout); - try_to_freeze(); } /* Send the "pen off" if we are stopping with the pen still active */ -- cgit v1.1