Re: [PATCH] Input: uinput - fix circular locking dependency with ff-core
From: Dmitry Torokhov
Date: Wed Mar 11 2026 - 13:50:52 EST
On Wed, Mar 11, 2026 at 10:47:25PM +0500, mikhail.v.gavrilov@xxxxxxxxx wrote:
> On Sun, 2026-03-01 at 03:36 +0500, Mikhail Gavrilov wrote:
> > A lockdep circular locking dependency warning can be triggered
> > reproducibly when using a force-feedback gamepad with uinput (for
> > example, playing ELDEN RING under Wine with a Flydigi Vader 5
> > controller):
> >
> > ff->mutex -> udev->mutex -> input_mutex -> dev->mutex -> ff->mutex
> >
> > The cycle is caused by four lock acquisition paths:
> >
> > 1. ff upload: input_ff_upload() holds ff->mutex and calls
> > uinput_dev_upload_effect() -> uinput_request_submit() ->
> > uinput_request_send(), which acquires udev->mutex.
> >
> > 2. device create: uinput_ioctl_handler() holds udev->mutex and calls
> > uinput_create_device() -> input_register_device(), which acquires
> > input_mutex.
> >
> > 3. device register: input_register_device() holds input_mutex and
> > calls kbd_connect() -> input_register_handle(), which acquires
> > dev->mutex.
> >
> > 4. evdev release: evdev_release() calls input_flush_device() under
> > dev->mutex, which calls input_ff_flush() acquiring ff->mutex.
> >
> >
> >
> Hi Dmitry,
>
> Friendly ping on this patch. It fixes a reproducible lockdep circular
> dependency warning in uinput with force-feedback gamepads under
> Wine/Proton, tested on 7.0-rc1.
>
> I realize I should have included:
>
> Fixes: ff462551235d ("Input: uinput - switch to the new FF
> interface")
> Cc: stable@xxxxxxxxxxxxxxx
>
> Should I resend as v2 with these tags, or can you add them when
> applying?
Sorry I need a bit more time to evaluate the patch. I think what you
proposed makes sense, just give me a couple more days.
If there are no changes needed I can add necessary tags on my end.
Thanks.
--
Dmitry