Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752820AbdFMKJb (ORCPT ); Tue, 13 Jun 2017 06:09:31 -0400 Received: from mail-ua0-f173.google.com ([209.85.217.173]:35278 "EHLO mail-ua0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752008AbdFMKJa (ORCPT ); Tue, 13 Jun 2017 06:09:30 -0400 MIME-Version: 1.0 In-Reply-To: <20170613095618.GB29589@mail.corp.redhat.com> References: <1497345926-3262-1-git-send-email-binoy.jayan@linaro.org> <20170613095618.GB29589@mail.corp.redhat.com> From: Binoy Jayan Date: Tue, 13 Jun 2017 15:39:28 +0530 Message-ID: Subject: Re: [PATCH v2] HID: Replace semaphore driver_lock with mutex To: Benjamin Tissoires Cc: Arnd Bergmann , linux-input@vger.kernel.org, Linux Kernel Mailing List , Rajendra , Mark Brown , Jiri Kosina , David Herrmann , Andrew de los Reyes Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1231 Lines: 33 Hi, On 13 June 2017 at 15:26, Benjamin Tissoires wrote: >> Looks good to me, but I see you didn't include David and Andrew on >> Cc, it would be good for at least one of them to provide an Ack as well. > > Please also CC linux-input@ Will do that. > (one more nitpick below too) > A little bit below, there is: > bool io_started; /* Protected by driver_lock. If IO has started */ > > You should probably remove the mention to driver_lock here. Will remove the reference too. >> > - 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). Thank you for noticing that, initially I missed it as I thought 'io_started' somehow influences the increment of the semaphore, but its anyway used only in hid-core.c Thanks, Binoy