lkml.org 
[lkml]   [2019]   [Feb]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Input: uinput - Allow uinput_request to be interrupted
Hi Marcos,

On Sun, Feb 17, 2019 at 09:42:52PM -0300, Marcos Paulo de Souza wrote:
> Commit 8e009118a45a ("Input: uinput - allow FF requests to time out")
> sets a timeout of 30 seconds to wait for force feedback interaction with
> userspace, but also made it impossible to interrupt the event handling of
> uinput code.

No, the original code was using wait_for_completion() and therefore did
not allow interrupting FF requests either. I'll apply the patch, but
will drop the "Fixes" reference.

Thanks.

> Make it interrutible by changing from
> wait_for_completion_timeout to wait_for_completion_interruptible_timeout.
>
> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=193741
>
> Fixes: 8e009118a45a ("Input: uinput - allow FF requests to time out")
> Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
> ---
> drivers/input/misc/uinput.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c
> index 26ec603fe220..b7bdf332ef4c 100644
> --- a/drivers/input/misc/uinput.c
> +++ b/drivers/input/misc/uinput.c
> @@ -191,7 +191,8 @@ static int uinput_request_submit(struct uinput_device *udev,
> if (retval)
> goto out;
>
> - if (!wait_for_completion_timeout(&request->done, 30 * HZ)) {
> + if (!wait_for_completion_interruptible_timeout(&request->done,
> + 30 * HZ)) {
> retval = -ETIMEDOUT;
> goto out;
> }
> --
> 2.16.4
>

--
Dmitry

\
 
 \ /
  Last update: 2019-02-18 07:46    [W:0.038 / U:0.616 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site