]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
Revert "Merge branch 'stable/processor-passthru.v5.rebased' into uek2-merge"
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Mon, 27 Feb 2012 01:02:45 +0000 (20:02 -0500)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Mon, 27 Feb 2012 01:02:45 +0000 (20:02 -0500)
This reverts commit 7a1bf3f7980152408ccf3cf9d2c0fc0816a0afd8, reversing
changes made to 4b91467d57da88ca97d6a96f40d1157ca7fdd034.

The CPU freq approach is better.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
drivers/xen/processor-passthru.c

index 49748f09a50eac444de2bb6c7471d7a3e686fefb..e4dff423f55711f4dd570189efeb10f224eed3cf 100644 (file)
@@ -19,7 +19,6 @@
 
 #include <linux/cpumask.h>
 #include <linux/cpufreq.h>
-#include <linux/freezer.h>
 #include <linux/kernel.h>
 #include <linux/kthread.h>
 #include <linux/init.h>
@@ -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;
 }