The patch titled
     input: polled device timer rounding
has been added to the -mm tree.  Its filename is
     input-polled-device-timer-rounding.patch

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: input: polled device timer rounding
From: Stephen Hemminger <[EMAIL PROTECTED]>

Fix the timer rounding on input polled device.  Rounding doesn't matter for
the first tick, but we want succeeding ticks to be aligned on second boundary
if poll interval is large enough.

The old code did a timer roundoff of the initial setting, not the rearming. 
Since the timer routine will take some time, it will eventually wander from
one jiffie to another, causing greater wakeups increasing power consumption.

It is not an issue at the moment because there are few users of the input
polled device, and those that do use polling less than one second.  But the
apanel driver uses a 1 sec poll interval, because they are really crappy
buttons (not really keys), and the value is sticky till read.

Also: cancel_rearming_delayed_workqueue is marked as obsolete
in workqueue.h so use cancel_delayed_work_sync.

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>
Cc: Dmitry Torokhov <[EMAIL PROTECTED]>
Cc: Arjan van de Ven <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/input/input-polldev.c |   12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff -puN drivers/input/input-polldev.c~input-polled-device-timer-rounding 
drivers/input/input-polldev.c
--- a/drivers/input/input-polldev.c~input-polled-device-timer-rounding
+++ a/drivers/input/input-polldev.c
@@ -60,17 +60,17 @@ static void input_polled_device_work(str
 {
        struct input_polled_dev *dev =
                container_of(work, struct input_polled_dev, work.work);
+       unsigned long ticks = msecs_to_jiffies(dev->poll_interval);
 
        dev->poll(dev);
        queue_delayed_work(polldev_wq, &dev->work,
-                          msecs_to_jiffies(dev->poll_interval));
+                          ticks >= HZ ? round_jiffies(ticks) : ticks);
 }
 
 static int input_open_polled_device(struct input_dev *input)
 {
        struct input_polled_dev *dev = input->private;
        int error;
-       unsigned long ticks;
 
        error = input_polldev_start_workqueue();
        if (error)
@@ -79,10 +79,8 @@ static int input_open_polled_device(stru
        if (dev->flush)
                dev->flush(dev);
 
-       ticks = msecs_to_jiffies(dev->poll_interval);
-       if (ticks >= HZ)
-               ticks = round_jiffies(ticks);
-       queue_delayed_work(polldev_wq, &dev->work, ticks);
+       queue_delayed_work(polldev_wq, &dev->work,
+                          msecs_to_jiffies(dev->poll_interval));
 
        return 0;
 }
@@ -91,7 +89,7 @@ static void input_close_polled_device(st
 {
        struct input_polled_dev *dev = input->private;
 
-       cancel_rearming_delayed_workqueue(polldev_wq, &dev->work);
+       cancel_delayed_work_sync(&dev->work);
        input_polldev_stop_workqueue();
 }
 
_

Patches currently in -mm which might be from [EMAIL PROTECTED] are

origin.patch
fujitsu-application-panel-driver.patch
fujitsu-application-panel-driver-space-savings.patch
input-polled-device-timer-rounding.patch
git-net.patch
git-wireless.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to