linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yingjoe Chen <yingjoe.chen@mediatek.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Liguo Zhang <liguo.zhang@mediatek.com>,
	Xudong Chen <xudong.chen@mediatek.com>,
	srv_heupstream@mediatek.com, Wolfram Sang <wsa@the-dreams.de>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	linux-mediatek@lists.infradead.org, linux-i2c@vger.kernel.org,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Eddie Huang <eddie.huang@mediatek.com>,
	linux-arm Mailing List <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v2 1/2] i2c: mediatek: add i2c first write then read optimization
Date: Tue, 10 Nov 2015 08:50:53 +0800	[thread overview]
Message-ID: <1447116653.24760.1.camel@mtksdaap41> (raw)
In-Reply-To: <CAHp75VfutRR0N0bGDYMjFr+nQGFnmuoiA2afvYfuZ2aOy=2qbQ@mail.gmail.com>

On Mon, 2015-11-09 at 16:25 +0200, Andy Shevchenko wrote:
> On Mon, Nov 9, 2015 at 7:43 AM, Liguo Zhang <liguo.zhang@mediatek.com> wrote:
> > For platform with auto restart support, between every transfer,
> > i2c controller will trigger an interrupt and SW need to handle
> > it to start new transfer. When doing write-then-read transfer,
> > instead of restart mechanism, using WRRD mode to have controller
> > send both transfer in one request to reduce latency.
> 
> 
> > @@ -518,6 +529,16 @@ static int mtk_i2c_transfer(struct i2c_adapter *adap,
> >         if (ret)
> >                 return ret;
> >
> > +       i2c->auto_restart = i2c->dev_comp->auto_restart;
> > +
> > +       /* checking if we can skip restart and optimize using WRRD mode */
> > +       if (i2c->auto_restart && num == 2) {
> > +               if (!(msgs[0].flags & I2C_M_RD) && (msgs[1].flags & I2C_M_RD) &&
> > +                   msgs[0].addr == msgs[1].addr) {
> 
> Nitpick (optional):
> 
> ((msgs[0].flags & msgs[1].flags) & I2C_M_RD)
> ?

These 2 check for different conditions.
The original one check the first one must NOT set I2C_M_RD, but second
one must set I2C_M_RD.

Joe.C

  parent reply	other threads:[~2015-11-10  0:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-09  5:43 [PATCH v2 0/2] Mediatek I2C Fixup Liguo Zhang
2015-11-09  5:43 ` [PATCH v2 1/2] i2c: mediatek: add i2c first write then read optimization Liguo Zhang
2015-11-09 14:25   ` Andy Shevchenko
2015-11-10  0:34     ` Daniel Kurtz
2015-11-10  0:50     ` Yingjoe Chen [this message]
2015-12-01  0:56   ` Wolfram Sang
2015-11-09  5:43 ` [PATCH v2 2/2] i2c: mediatek: fix i2c multi transfer issue in high speed mode Liguo Zhang
     [not found]   ` <1447047839-5223-3-git-send-email-liguo.zhang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2015-11-14 14:38     ` Daniel Kurtz
2015-12-01  0:54       ` Wolfram Sang
2015-12-01 11:24       ` Liguo Zhang (张立国)
2015-12-02  2:51       ` liguo zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1447116653.24760.1.camel@mtksdaap41 \
    --to=yingjoe.chen@mediatek.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=eddie.huang@mediatek.com \
    --cc=liguo.zhang@mediatek.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=s.hauer@pengutronix.de \
    --cc=srv_heupstream@mediatek.com \
    --cc=wsa@the-dreams.de \
    --cc=xudong.chen@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).