From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752273AbbARJsQ (ORCPT ); Sun, 18 Jan 2015 04:48:16 -0500 Received: from metis.ext.pengutronix.de ([92.198.50.35]:47551 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751734AbbARJsN (ORCPT ); Sun, 18 Jan 2015 04:48:13 -0500 Date: Sun, 18 Jan 2015 10:47:41 +0100 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: Arend van Spriel Cc: Ray Jui , Mark Rutland , devicetree@vger.kernel.org, Christian Daudt , Russell King , Scott Branden , Pawel Moll , Ian Campbell , Wolfram Sang , Florian Fainelli , Matt Porter , linux-kernel@vger.kernel.org, Rob Herring , bcm-kernel-feedback-list@broadcom.com, linux-i2c@vger.kernel.org, Grant Likely , Kumar Gala , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v5 2/3] i2c: iproc: Add Broadcom iProc I2C Driver Message-ID: <20150118094741.GE22880@pengutronix.de> References: <1421451737-7107-1-git-send-email-rjui@broadcom.com> <1421451737-7107-3-git-send-email-rjui@broadcom.com> <54BB795C.6040402@broadcom.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <54BB795C.6040402@broadcom.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Sun, Jan 18, 2015 at 10:14:04AM +0100, Arend van Spriel wrote: > On 01/17/15 00:42, Ray Jui wrote: > > [...] > > >+/* > >+ * Can be expanded in the future if more interrupt status bits are utilized > >+ */ > >+#define ISR_MASK (1<< IS_M_START_BUSY_SHIFT) > >+ > >+static irqreturn_t bcm_iproc_i2c_isr(int irq, void *data) > >+{ > >+ struct bcm_iproc_i2c_dev *iproc_i2c = data; > >+ u32 status = readl(iproc_i2c->base + IS_OFFSET); > >+ > >+ status&= ISR_MASK; > >+ > >+ if (!status) > >+ return IRQ_NONE; > >+ > >+ writel(status, iproc_i2c->base + IS_OFFSET); > >+ complete_all(&iproc_i2c->done); > > Looking over this code it seems to me there is always a single > process waiting for iproc_i2c->done to complete. So using complete() > here would suffice. Yeah, there is always only a single thread waiting. That means both complete and complete_all are suitable. AFAIK there is no reason to pick one over the other in this case. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | http://www.pengutronix.de/ |