From mboxrd@z Thu Jan 1 00:00:00 1970 From: Johan Hovold Subject: Re: [PATCH v5 1/4] mfd: add support for Diolan DLN-2 devices Date: Thu, 25 Sep 2014 12:30:11 +0200 Message-ID: <20140925103011.GA32124@localhost> References: <1411158165-25794-1-git-send-email-octavian.purdila@intel.com> <1411158165-25794-2-git-send-email-octavian.purdila@intel.com> <20140924104809.GA16198@localhost> <20140924135444.GD16198@localhost> <20140924150749.GG16198@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Octavian Purdila Cc: Johan Hovold , Greg Kroah-Hartman , Linus Walleij , Alexandre Courbot , wsa@the-dreams.de, Samuel Ortiz , Lee Jones , Arnd Bergmann , Daniel Baluta , Laurentiu Palcu , linux-usb@vger.kernel.org, lkml , "linux-gpio@vger.kernel.org" , linux-i2c@vger.kernel.org List-Id: linux-gpio@vger.kernel.org On Thu, Sep 25, 2014 at 01:25:24PM +0300, Octavian Purdila wrote: > Johan, I think we don't really need the spinlock, the disconnect flag > and an atomic counter should work. Do you see any issues with that? No, you need to test and increment atomically so the lock is needed. Consider what could happen if you get a disconnect after testing but before incrementing. Johan