Seeking does not make sense for uinput so let's use nonseekable_open
to mark the device non-seekable.
Signed-off-by: Dmitry Torokhov <[email protected]>
Commit 8702965848 pushed down the BKL
into uinput open function. However, there's nothing that needs locking
in there.
Signed-off-by: Thadeu Lima de Souza Cascardo <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
The destruction of a input device in uinput is triggered by an ioctl().
If a process tries to destroy an input device while other is uploading a
force feedback effect by evdev to the same device, they'll deadlock.
This patch fixes the problem by flushing all pending FF uploads before
destroying the device and preventing new uploads during this operation.
[[email protected]: fix logic that ensures we don't submit new requests
to the device that is being destroyed.]
Signed-off-by: Aristeu Rozanski <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Currently, evdev has working 32bit compatibility and uinput does not. uinput
needs the input_event code that evdev uses, so let's refactor it so it can
be shared.
[[email protected]: add fix for force feedback compat issues]
Signed-off-by: Philip Langdale <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
uinput.h relies on structures found in input.h, so pull in the header
Signed-off-by: Mike Frysinger <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Many struct file_operations in the kernel can be "const". Marking them const
moves these to the .rodata section, which avoids false sharing with potential
dirty data. In addition it'll catch accidental writes at compile time to
these shared resources.
Signed-off-by: Arjan van de Ven <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
The userspace interface of the force feedback part is changed and
documentation in uinput.h is updated accordingly. MODULE_VERSION
is also incremented to reflect the revision.
Signed-off-by: Anssi Hannula <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
If thread that submitted FF request gets interrupted somehow it
will release request structure and ioctl handler will work with
freed memory. TO prevent that from happening switch to using
wait_for_completion instead of wait_for_completion_interruptible.
Signed-off-by: Dmitry Torokhov <[email protected]>
Only signal completion after marking request slot as free, otherwise other
processor can free request structure before we finish using it.
Signed-off-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
uinput_alloc_device() is supposed to return the number of bytes read,
the value is returned to uinput_write() and from there to userspace. If
EV_ABS is set then it returns the value from uinput_validate_absbits()
instead, which is zero when everything is ok instead of the count.
Signed-off-by: Ian Campbell <[email protected]>
Acked-by: Aristeu Rozanski <[email protected]>
Signed-off-by: Vojtech Pavlik <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.
Let it rip!