[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANq1E4Two8-Qk5q=OFunE-mfuHvopY1Hm=7CrVZUaHJzBPUPyQ@mail.gmail.com>
Date: Tue, 13 Jun 2017 17:43:52 +0200
From: David Herrmann <dh.herrmann@...il.com>
To: Benjamin Tissoires <benjamin.tissoires@...hat.com>
Cc: Arnd Bergmann <arnd@...db.de>,
Binoy Jayan <binoy.jayan@...aro.org>,
"open list:HID CORE LAYER" <linux-input@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Rajendra <rnayak@...eaurora.org>,
Mark Brown <broonie@...nel.org>,
Jiri Kosina <jikos@...nel.org>,
David Herrmann <dh.herrmann@...glemail.com>,
Andrew de los Reyes <adlr@...omium.org>
Subject: Re: [PATCH v2] HID: Replace semaphore driver_lock with mutex
Hi
On Tue, Jun 13, 2017 at 11:56 AM, Benjamin Tissoires
<benjamin.tissoires@...hat.com> wrote:
>> > - struct semaphore driver_lock; /* protects the current driver, except during input */
>> > + struct mutex driver_lock; /* protects the current driver, except during input */
>> > struct semaphore driver_input_lock; /* protects the current driver */
>
> Unless I am mistaken, this one could also be converted to a mutex (in a
> separate patch, of course).
The mutex code clearly states mutex_trylock() must not be used in
interrupt context (see kernel/locking/mutex.c), hence we used a
semaphore here. Unless the mutex code is changed to allow this, we
cannot switch away from semaphores.
Otherwise, this patch (given Benjamin's comments are addressed) looks good:
Reviewed-by: David Herrmann <dh.herrmann@...il.com>
Thanks
David
Powered by blists - more mailing lists