Re: [PATCH] Input: uinput - fix circular locking dependency with ff-core

From: Mikhail Gavrilov

Date: Mon Mar 23 2026 - 01:17:25 EST


On Mon, Mar 23, 2026 at 7:47 AM Dmitry Torokhov
<dmitry.torokhov@xxxxxxxxx> wrote:
>
> Thank you for the patch, it looks solid, however I wonder if creating a
> separate "state_lock" spinlock would not be better than reusing
> requests_lock?

Hi Dmitry,

Thank you for the review.

A separate spinlock would certainly be cleaner from a naming
perspective. One thing I'd like to note though: the current
approach of reusing requests_lock has the benefit of atomically
checking state and queueing the event in uinput_request_send(),
and atomically changing state and flushing requests in
uinput_destroy_device(). With a separate state_lock these become
two independent locks, so the ordering between them would need to
be defined.

That said, if you prefer the cleaner separation I'm happy to make
the change. Please let me know.

--
Best Regards,
Mike Gavrilov.