From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752840AbaIYKcv (ORCPT ); Thu, 25 Sep 2014 06:32:51 -0400 Received: from mail-lb0-f178.google.com ([209.85.217.178]:34113 "EHLO mail-lb0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752501AbaIYKcr (ORCPT ); Thu, 25 Sep 2014 06:32:47 -0400 X-Google-Original-Sender: Date: Thu, 25 Sep 2014 12:30:11 +0200 From: Johan Hovold 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 Subject: Re: [PATCH v5 1/4] mfd: add support for Diolan DLN-2 devices 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 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.22 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@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