public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Input: uinput - Allow uinput_request to be interrupted
Date: Sun, 17 Feb 2019 22:46:29 -0800	[thread overview]
Message-ID: <20190218064629.GB242714@dtor-ws> (raw)
In-Reply-To: <20190218004305.339758-1-marcos.souza.org@gmail.com>

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

       reply	other threads:[~2019-02-18  6:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190218004305.339758-1-marcos.souza.org@gmail.com>
2019-02-18  6:46 ` Dmitry Torokhov [this message]
2019-02-18 14:21 ` [PATCH] Input: uinput - Allow uinput_request to be interrupted Rodrigo Rivas Costa
2019-02-18 20:15   ` Dmitry Torokhov
2019-02-21 11:11     ` Marcos Paulo de Souza

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190218064629.GB242714@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcos.souza.org@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox