From: Jiri Kosina <jikos@kernel.org>
To: Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>,
"Pierre-Loup A. Griffais" <pgriffais@valvesoftware.com>,
lkml <linux-kernel@vger.kernel.org>,
linux-input <linux-input@vger.kernel.org>,
Simon Gene Gottlieb <simon@gottliebtfreitag.de>
Subject: Re: [PATCH] HID: steam: fix deadlock with input devices.
Date: Mon, 18 Mar 2019 14:44:54 +0100 (CET) [thread overview]
Message-ID: <nycvar.YFH.7.76.1903181444420.19912@cbobk.fhfr.pm> (raw)
In-Reply-To: <20190315190910.4602-1-rodrigorivascosta@gmail.com>
On Fri, 15 Mar 2019, Rodrigo Rivas Costa wrote:
> When using this driver with the wireless dongle and some usermode
> program that monitors every input device (acpid, for example), while
> another usermode client opens and closes the low-level device
> repeadedly, the system eventually deadlocks.
>
> The reason is that steam_input_register_device() must not be called with
> the mutex held, because the input subsystem has its own synchronization
> that clashes with this one: it is possible that steam_input_open() is
> called before input_register_device() returns, and since
> steam_input_open() needs to lock the mutex, it deadlocks.
>
> However we must hold the mutex when calling any function that sends
> commands to the controller. If not, random commands end up falling fail.
>
> Reported-by: Simon Gene Gottlieb <simon@gottliebtfreitag.de>
> Signed-off-by: Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
> Tested-by: Simon Gene Gottlieb <simon@gottliebtfreitag.de>
Applied to for-5.1/upstream-fixes, thanks.
--
Jiri Kosina
SUSE Labs
prev parent reply other threads:[~2019-03-18 13:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-15 19:09 [PATCH] HID: steam: fix deadlock with input devices Rodrigo Rivas Costa
2019-03-18 13:44 ` Jiri Kosina [this message]
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=nycvar.YFH.7.76.1903181444420.19912@cbobk.fhfr.pm \
--to=jikos@kernel.org \
--cc=benjamin.tissoires@redhat.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pgriffais@valvesoftware.com \
--cc=rodrigorivascosta@gmail.com \
--cc=simon@gottliebtfreitag.de \
/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;
as well as URLs for NNTP newsgroup(s).