* [PATCH] i2c-omap: Set latency requirements only once for several messages
@ 2010-11-18 10:04 Samu Onkalo
[not found] ` <1290074660-2640-1-git-send-email-samu.p.onkalo-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Samu Onkalo @ 2010-11-18 10:04 UTC (permalink / raw)
To: ben-linux-elnMNo+KYs3YtjvyW6yDsg
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA,
khilman-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR,
paul-DWxLp4Yu+b8AvxtiuMwx3w, linux-omap-u79uwXL29TY76Z2rM5mHXA
Ordinary I2C read consist of two messages. First a write operation
to tell register address and then read operation to get data.
CPU wake up latency is set and removed twice in read case.
Set latency requirement before the message processing loop
and remove the requirement after the loop to remove latency
adjustment operations between the messages.
Signed-off-by: Samu Onkalo <samu.p.onkalo-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
Acked-by: Kevin Hilman <khilman-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org>
Acked-by: Paul Walmsley <paul-DWxLp4Yu+b8AvxtiuMwx3w@public.gmane.org>
---
drivers/i2c/busses/i2c-omap.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index b33c785..3e9323e 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -616,12 +616,8 @@ static int omap_i2c_xfer_msg(struct i2c_adapter *adap,
* REVISIT: We should abort the transfer on signals, but the bus goes
* into arbitration and we're currently unable to recover from it.
*/
- if (dev->set_mpu_wkup_lat != NULL)
- dev->set_mpu_wkup_lat(dev->dev, dev->latency);
r = wait_for_completion_timeout(&dev->cmd_complete,
OMAP_I2C_TIMEOUT);
- if (dev->set_mpu_wkup_lat != NULL)
- dev->set_mpu_wkup_lat(dev->dev, -1);
dev->buf_len = 0;
if (r < 0)
return r;
@@ -672,12 +668,18 @@ omap_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
if (r < 0)
goto out;
+ if (dev->set_mpu_wkup_lat != NULL)
+ dev->set_mpu_wkup_lat(dev->dev, dev->latency);
+
for (i = 0; i < num; i++) {
r = omap_i2c_xfer_msg(adap, &msgs[i], (i == (num - 1)));
if (r != 0)
break;
}
+ if (dev->set_mpu_wkup_lat != NULL)
+ dev->set_mpu_wkup_lat(dev->dev, -1);
+
if (r == 0)
r = num;
--
1.6.0.4
^ permalink raw reply related [flat|nested] 4+ messages in thread[parent not found: <1290074660-2640-1-git-send-email-samu.p.onkalo-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>]
* Re: [PATCH] i2c-omap: Set latency requirements only once for several messages [not found] ` <1290074660-2640-1-git-send-email-samu.p.onkalo-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org> @ 2010-12-03 2:37 ` Ben Dooks [not found] ` <20101203023751.GF20097-SMNkleLxa3Z6Wcw2j4pizdi2O/JbrIOy@public.gmane.org> 0 siblings, 1 reply; 4+ messages in thread From: Ben Dooks @ 2010-12-03 2:37 UTC (permalink / raw) To: Samu Onkalo Cc: ben-linux-elnMNo+KYs3YtjvyW6yDsg, linux-i2c-u79uwXL29TY76Z2rM5mHXA, khilman-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR, paul-DWxLp4Yu+b8AvxtiuMwx3w, linux-omap-u79uwXL29TY76Z2rM5mHXA On Thu, Nov 18, 2010 at 12:04:20PM +0200, Samu Onkalo wrote: > Ordinary I2C read consist of two messages. First a write operation > to tell register address and then read operation to get data. > CPU wake up latency is set and removed twice in read case. > Set latency requirement before the message processing loop > and remove the requirement after the loop to remove latency > adjustment operations between the messages. > > Signed-off-by: Samu Onkalo <samu.p.onkalo-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org> > Acked-by: Kevin Hilman <khilman-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org> > Acked-by: Paul Walmsley <paul-DWxLp4Yu+b8AvxtiuMwx3w@public.gmane.org> I'll queue this for -rc unless it is going in via the omap list or it should wait for merge window? -- Ben Q: What's a light-year? A: One-third less calories than a regular year. ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <20101203023751.GF20097-SMNkleLxa3Z6Wcw2j4pizdi2O/JbrIOy@public.gmane.org>]
* RE: [PATCH] i2c-omap: Set latency requirements only once for several messages [not found] ` <20101203023751.GF20097-SMNkleLxa3Z6Wcw2j4pizdi2O/JbrIOy@public.gmane.org> @ 2010-12-03 6:43 ` samu.p.onkalo-xNZwKgViW5gAvxtiuMwx3w 2010-12-03 8:31 ` Paul Walmsley 0 siblings, 1 reply; 4+ messages in thread From: samu.p.onkalo-xNZwKgViW5gAvxtiuMwx3w @ 2010-12-03 6:43 UTC (permalink / raw) To: ben-i2c-elnMNo+KYs3YtjvyW6yDsg Cc: ben-linux-elnMNo+KYs3YtjvyW6yDsg, linux-i2c-u79uwXL29TY76Z2rM5mHXA, khilman-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR, paul-DWxLp4Yu+b8AvxtiuMwx3w, linux-omap-u79uwXL29TY76Z2rM5mHXA >-----Original Message----- >From: ext Ben Dooks [mailto:ben-i2c-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org] >Sent: 03 December, 2010 04:38 >To: Onkalo Samu.P (Nokia-MS/Tampere) >Cc: ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org; linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; >khilman-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org; paul-DWxLp4Yu+b8AvxtiuMwx3w@public.gmane.org; linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org >Subject: Re: [PATCH] i2c-omap: Set latency requirements only once for >several messages > >On Thu, Nov 18, 2010 at 12:04:20PM +0200, Samu Onkalo wrote: >> Ordinary I2C read consist of two messages. First a write operation >> to tell register address and then read operation to get data. >> CPU wake up latency is set and removed twice in read case. >> Set latency requirement before the message processing loop >> and remove the requirement after the loop to remove latency >> adjustment operations between the messages. >> >> Signed-off-by: Samu Onkalo <samu.p.onkalo-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org> >> Acked-by: Kevin Hilman <khilman-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org> >> Acked-by: Paul Walmsley <paul-DWxLp4Yu+b8AvxtiuMwx3w@public.gmane.org> > >I'll queue this for -rc unless it is going in via the omap list >or it should wait for merge window? > Hi Ben, I first sent this to omap-list and I got instructions to send this to you. So I assume that you should queue this. Kevin, Paul, is -rc ok for you? -Samu ^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH] i2c-omap: Set latency requirements only once for several messages 2010-12-03 6:43 ` samu.p.onkalo-xNZwKgViW5gAvxtiuMwx3w @ 2010-12-03 8:31 ` Paul Walmsley 0 siblings, 0 replies; 4+ messages in thread From: Paul Walmsley @ 2010-12-03 8:31 UTC (permalink / raw) To: samu.p.onkalo; +Cc: ben-i2c, ben-linux, linux-i2c, khilman, linux-omap Hello Ben, Samu, On Fri, 3 Dec 2010, samu.p.onkalo@nokia.com wrote: > >-----Original Message----- > >From: ext Ben Dooks [mailto:ben-i2c@fluff.org] > >Sent: 03 December, 2010 04:38 > >To: Onkalo Samu.P (Nokia-MS/Tampere) > >Cc: ben-linux@fluff.org; linux-i2c@vger.kernel.org; > >khilman@deeprootsystems.com; paul@pwsan.com; linux-omap@vger.kernel.org > >Subject: Re: [PATCH] i2c-omap: Set latency requirements only once for > >several messages > > > >On Thu, Nov 18, 2010 at 12:04:20PM +0200, Samu Onkalo wrote: > >> Ordinary I2C read consist of two messages. First a write operation > >> to tell register address and then read operation to get data. > >> CPU wake up latency is set and removed twice in read case. > >> Set latency requirement before the message processing loop > >> and remove the requirement after the loop to remove latency > >> adjustment operations between the messages. > >> > >> Signed-off-by: Samu Onkalo <samu.p.onkalo@nokia.com> > >> Acked-by: Kevin Hilman <khilman@deeprootsystems.com> > >> Acked-by: Paul Walmsley <paul@pwsan.com> > > > >I'll queue this for -rc unless it is going in via the omap list > >or it should wait for merge window? > > > > I first sent this to omap-list and I got instructions to send this to you. > So I assume that you should queue this. Kevin, Paul, is -rc ok for you? I'd suggest that this go in through Ben, and go in as part of the 2.6.38 merge window, rather than the .37-rc. The patch doesn't fix any regressions introduced in the 2.6.37 merge window, and there's no impact on system stability, as far as I know. - Paul ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-12-03 8:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-18 10:04 [PATCH] i2c-omap: Set latency requirements only once for several messages Samu Onkalo
[not found] ` <1290074660-2640-1-git-send-email-samu.p.onkalo-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
2010-12-03 2:37 ` Ben Dooks
[not found] ` <20101203023751.GF20097-SMNkleLxa3Z6Wcw2j4pizdi2O/JbrIOy@public.gmane.org>
2010-12-03 6:43 ` samu.p.onkalo-xNZwKgViW5gAvxtiuMwx3w
2010-12-03 8:31 ` Paul Walmsley
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox