Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2584603yba; Mon, 15 Apr 2019 15:06:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqwiEQ64zA9WoqD5tJnjCBxxNRm/sxMlLbORcI2BuPPS7iNlgk0148ldFiLZ8T3U79WnDiiz X-Received: by 2002:a63:1d5b:: with SMTP id d27mr71022128pgm.386.1555366004994; Mon, 15 Apr 2019 15:06:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555366004; cv=none; d=google.com; s=arc-20160816; b=p/XyBuk/YY36Ws/nkFvYjNsXBo3NkhlY5zHtTcHCL8T8hfaBLulnSzeM0DRelQmpKD POE3h2TJ16Wd3o+aQClTePIya1CPnS03nCtDbIRANPo213d2WL4PIYL4hmTVXfeG0ITl 2wotAkNeapeL/Vjjr+GECZhMj/V4TOE/BjkD7k583BUDqXxAWYyo7wJBWEvfEelBkCou 3k+cofJAZ9QUqpnVaQnl0d6Zz9caMRtpEtAwFXjJ6UW5T0wRaxcByYF/DuwY87nDfiYm ozyTWZ5wIYK6uRSOoSn2Mzu/VTBtiPMjp9UeuuBWNSNsaPdCSWJUVKpA918qb2dI2qH2 BSFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=vhMCJeLROrk2cBn3WObNKh/DQO7qn9P3kW8X/Z/GsAM=; b=PPVYKGr0y/j2PmYch/eUk+Ik9vk4purETWplj7KckgHGhtSkCJ6XnMKQ7O5gDHrxou 3DcN7K0iLKLIz/znystsurke1L/kGsWxsgoy1Cy5bcvgS7EVXd1AeA3vdVI8f1eg+V8h t5yn1TT6LYYvstjzlx3QV2kbZ78qjoiZb/67cUXkdhwkb66UDODp/EGCsbjh+3ynu8iX ksMjO6QjU7cBM91mCCydo6cPWn+pNWnR0JV7v3UgTWZ8vzAXZwtDF3EjrlKOT2FQIjko W3inWRV/4FSrDeQYiHczm8h7cxBvf1IYVwaSJqSuKsq6TrVCcuz7Ce1Nnn1pKMyW3j2K NHpg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p2si44579949pgk.326.2019.04.15.15.06.27; Mon, 15 Apr 2019 15:06:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727910AbfDOWFx (ORCPT + 99 others); Mon, 15 Apr 2019 18:05:53 -0400 Received: from stcim.de ([78.46.90.227]:43676 "EHLO stcim.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725804AbfDOWFx (ORCPT ); Mon, 15 Apr 2019 18:05:53 -0400 Received: from xdsl-89-0-59-235.nc.de ([89.0.59.235] helo=porty) by stcim with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hG9jX-00010l-Eu; Tue, 16 Apr 2019 00:05:47 +0200 Date: Tue, 16 Apr 2019 00:05:46 +0200 From: Stefan Lengfeld To: Wolfram Sang Cc: linux-i2c@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Peter Rosin , linux-omap@vger.kernel.org, linux-tegra@vger.kernel.org, Linus Walleij , Andy Shevchenko , Tero Kristo , Keerthy , Simon Horman Subject: Re: [PATCH 06/12] i2c: omap: Add the master_xfer_irqless hook Message-ID: <20190415220546.bvrp7jodgdq7phwg@porty> References: <20190403124019.8947-1-wsa+renesas@sang-engineering.com> <20190403124019.8947-7-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190403124019.8947-7-wsa+renesas@sang-engineering.com> X-PGP-Key: https://stefanchrist.eu/personal/Stefan_Lengfeld_0xE44A23B289092311.asc User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Wolfram, the subject line of this patch i2c: omap: Add the master_xfer_irqless hook still contains the old name of the callback '_irqless'. It should be '_atomic' instead. On Wed, Apr 03, 2019 at 02:40:13PM +0200, Wolfram Sang wrote: > Add the master_xfer_irqless hook to enable i2c transactions Here again. It should be 'master_xfer_atomic'. > in irq disabled contexts like the poweroff case. > > Signed-off-by: Tero Kristo > Signed-off-by: Keerthy > [wsa: simplified code a little: 'timeout = !ret'] > Reviewed-by: Simon Horman > Signed-off-by: Wolfram Sang > --- > drivers/i2c/busses/i2c-omap.c | 76 +++++++++++++++++++++++++++++++++++-------- > 1 file changed, 63 insertions(+), 13 deletions(-) > snipped > @@ -648,15 +650,28 @@ static void omap_i2c_resize_fifo(struct omap_i2c_dev *omap, u8 size, bool is_rx) > (1000 * omap->speed / 8); > } > > +static void omap_i2c_wait(struct omap_i2c_dev *omap) > +{ > + u16 stat; > + u16 mask = omap_i2c_read_reg(omap, OMAP_I2C_IE_REG); > + int count = 0; > + > + do { > + stat = omap_i2c_read_reg(omap, OMAP_I2C_STAT_REG); > + count++; > + } while (!(stat & mask) && count < 5); > +} > + > /* > * Low level master read/write transaction. > */ > static int omap_i2c_xfer_msg(struct i2c_adapter *adap, > - struct i2c_msg *msg, int stop) > + struct i2c_msg *msg, int stop, bool polling) Nitpick. In the patches for the other drivers the boolean flag is called 'atomic' and not 'polling'. > { > struct omap_i2c_dev *omap = i2c_get_adapdata(adap); > unsigned long timeout; > u16 w; > + int ret; > > dev_dbg(omap->dev, "addr: 0x%04x, len: %d, flags: 0x%x, stop: %d\n", > msg->addr, msg->len, msg->flags, stop); sniped > @@ -1165,14 +1204,25 @@ omap_i2c_isr_thread(int this_irq, void *dev_id) > } > } while (stat); > > - omap_i2c_complete_cmd(omap, err); > + return err; > +} > + > +static irqreturn_t > +omap_i2c_isr_thread(int this_irq, void *dev_id) > +{ > + int ret; > + struct omap_i2c_dev *omap = dev_id; > + > + ret = omap_i2c_xfer_data(omap); > + if (ret != -EAGAIN) > + omap_i2c_complete_cmd(omap, ret); > > -out: > return IRQ_HANDLED; > } > > static const struct i2c_algorithm omap_i2c_algo = { > - .master_xfer = omap_i2c_xfer, > + .master_xfer = omap_i2c_xfer_irq, > + .master_xfer_atomic = omap_i2c_xfer_polling, When consistency with other drivers is a goal, the functions should be named like: .master_xfe = omap_i2c_xfer, .master_xfer_atomic = omap_i2c_xfer_atomic, The first without a suffix and the second with the '_atomic' suffix. Kind regards, Stefan