All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
To: Marek Vasut <marex@denx.de>
Cc: Lucas Stach <l.stach@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	wsa@the-dreams.de, shawn.guo@linaro.org, kernel@pengutronix.de,
	linux-i2c@vger.kernel.org, to-fleischer@t-online.de,
	Fabio Estevam <fabio.estevam@freescale.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH v2] i2c: i2c-mxs: Use DMA mode even for small transfers
Date: Wed, 03 Jul 2013 10:33:22 +0200	[thread overview]
Message-ID: <51D3E1D2.4070706@free-electrons.com> (raw)
In-Reply-To: <201307030637.05324.marex@denx.de>

Hi Marek,

On 03/07/2013 06:37, Marek Vasut wrote:
> 
> I'm attaching a patch. Alex, please give it a go and see if it fixes your issue. 
> It is _VERY_ ugly.
>

Quite ugly ;)

It indeed seems to fix the issue.

> The basic idea behind the the patch is that, as (attempted to be) explained 
> above, subsequent writes to DATA register in PIO mode cause constant generation 
> of clock on the bus and therefore a very long transfer of zero data. This 
> confuses the I2C peripherals of course.
> 
> The patch implements clock stretching for PIO writes (maybe we need this for 
> reads too) by making the controller blast out only 4 (or less) bytes of data in 
> each write into the DATA register. To prevent interruption of the transfer 
> between writes into the DATA register, the SCK is held low using the 
> RETAIN_CLOCK bit.
> 
> But (!) here comes the caveat. The PIO was introduced to speed up small 
> transfers. Introducing clock stretching into PIO mode operation might completely 
> remove this advantage. This has to be measured again.
> 

And now, PIO mode is slower than DMA...


-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

  reply	other threads:[~2013-07-03  8:33 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-01 21:14 [PATCH v2] i2c: i2c-mxs: Use DMA mode even for small transfers Fabio Estevam
2013-07-02  2:23 ` Shawn Guo
2013-07-15 13:30   ` Fabio Estevam
     [not found]     ` <CAOMZO5Dyk_5CzcXvG7eJ3h07i=So0DS7MjtMQVHfpfx9Se_Teg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-07-15 14:12       ` Marek Vasut
2013-07-23 18:15     ` Fabio Estevam
2013-07-24  3:02       ` Marek Vasut
2013-07-24  3:09         ` Fabio Estevam
2013-07-26  0:46           ` Ben Hutchings
2013-07-26  4:20             ` Marek Vasut
     [not found] ` <1372713261-20551-1-git-send-email-festevam-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-07-02  8:16   ` Lucas Stach
2013-07-03  2:38     ` Marek Vasut
     [not found]       ` <201307030438.50069.marex-ynQEQJNshbs@public.gmane.org>
2013-07-03  4:37         ` Marek Vasut
2013-07-03  8:33           ` Alexandre Belloni [this message]
     [not found]             ` <51D3E1D2.4070706-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2013-07-03 11:41               ` Marek Vasut
     [not found]           ` <201307030637.05324.marex-ynQEQJNshbs@public.gmane.org>
2013-07-03  9:11             ` Lucas Stach
     [not found]               ` <1372842695.4440.3.camel-WzVe3FnzCwFR6QfukMTsflXZhhPuCNm+@public.gmane.org>
2013-07-03 11:39                 ` Marek Vasut
2013-08-05  8:11 ` Wolfram Sang

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=51D3E1D2.4070706@free-electrons.com \
    --to=alexandre.belloni@free-electrons.com \
    --cc=fabio.estevam@freescale.com \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=l.stach@pengutronix.de \
    --cc=linux-i2c@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=shawn.guo@linaro.org \
    --cc=stable@vger.kernel.org \
    --cc=to-fleischer@t-online.de \
    --cc=wsa@the-dreams.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.