From d696e467d97b748cab14eb1b9910bf45f2044033 Mon Sep 17 00:00:00 2001 From: Konrad Rzeszutek Wilk Date: Sun, 26 Feb 2012 20:02:45 -0500 Subject: [PATCH] Revert "Merge branch 'stable/processor-passthru.v5.rebased' into uek2-merge" This reverts commit 7a1bf3f7980152408ccf3cf9d2c0fc0816a0afd8, reversing changes made to 4b91467d57da88ca97d6a96f40d1157ca7fdd034. The CPU freq approach is better. Signed-off-by: Konrad Rzeszutek Wilk --- drivers/xen/processor-passthru.c | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/drivers/xen/processor-passthru.c b/drivers/xen/processor-passthru.c index 49748f09a50e..e4dff423f557 100644 --- a/drivers/xen/processor-passthru.c +++ b/drivers/xen/processor-passthru.c @@ -19,7 +19,6 @@ #include #include -#include #include #include #include @@ -386,21 +385,30 @@ err_out: * and CPUfreq drivers to load up and parse the Pxx and Cxx information * before we attempt to read it. */ +static void xen_processor_timeout(unsigned long arg) +{ + wake_up_process((struct task_struct *)arg); +} static int xen_processor_thread_func(void *dummy) { + struct timer_list timer; int err = 0; - unsigned long t = POLL_TIMER; - - set_freezable(); - for (;;) { - long timeout = schedule_timeout_interruptible(t); - if (timeout == -ERESTARTSYS || kthread_should_stop()) + setup_deferrable_timer_on_stack(&timer, xen_processor_timeout, + (unsigned long)current); + do { + __set_current_state(TASK_INTERRUPTIBLE); + mod_timer(&timer, jiffies + POLL_TIMER); + schedule(); + err = xen_processor_check(); + if (err != -EBUSY) break; - try_to_freeze(); - if (xen_processor_check() != -EBUSY) - t = MAX_SCHEDULE_TIMEOUT; - } + } while (!kthread_should_stop()); + + if (err) + pr_err(DRV_NAME ": Failed to upload data (%d)!\n", err); + del_timer_sync(&timer); + destroy_timer_on_stack(&timer); return 0; } -- 2.50.1