Thread (43 messages) 43 messages, 4 authors, 2011-06-18

Re: [PATCH v4 11/18] input: Add initial support for TWL6040 vibrator

flat view

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2011-06-13 21:20:47
Also in: alsa-devel, linux-omap, lkml

On Mon, Jun 13, 2011 at 12:51:16PM +0300, Péter Ujfalusi wrote:
On Sunday 12 June 2011 01:18:54 Dmitry Torokhov wrote:
quoted
quoted
+static int twl6040_vibra_open(struct input_dev *input)
+{
+     struct vibra_info *info = input_get_drvdata(input);
+
+     info->workqueue = create_singlethread_workqueue("vibra");
+     if (info->workqueue == NULL) {
+             dev_err(&input->dev, "couldn't create workqueue\n");
+             return -ENOMEM;
+     }
Why do we need to create a separate workqueue? With arrival of CWQ
it looks like we should be able to use one of the system-wide
workqueues for this.
The reason for this is to ensure that we have the lowest latency as possible 
in most case. In the embedded devices we use the vibra for tactile type of 
feedbacks as well, where few tens of ms delay can be felt.
Even if you create a dedicated workqueue with CWQ it will still be using
shared pool of threads so I do not think that latency will be affected
by using system-wide workqueue. I might be mistaken though, Tejun will
correct me if I am wrong...

Thanks.

-- 
Dmitry
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help