Skip to content

Commit

Permalink
Input: polled device - do not start polling if interval is zero
Browse files Browse the repository at this point in the history
If the poll interval is set to 0 via new sysfs entry and device is
opened after that, polling is started with interval 0. This causes
huge CPU load. Same happens if the rate was 0 when the device was
closed and then reopened.

Signed-off-by: Samu Onkalo <samu.p.onkalo@nokia.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
  • Loading branch information
Samu Onkalo authored and Dmitry Torokhov committed Nov 23, 2009
1 parent 381f3f1 commit 11bb4cc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/input/input-polldev.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ static int input_open_polled_device(struct input_dev *input)
if (dev->open)
dev->open(dev);

queue_delayed_work(polldev_wq, &dev->work, 0);
/* Only start polling if polling is enabled */
if (dev->poll_interval > 0)
queue_delayed_work(polldev_wq, &dev->work, 0);

return 0;
}
Expand Down

0 comments on commit 11bb4cc

Please sign in to comment.