From: broonie@opensource.wolfsonmicro.com (Mark Brown)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] i2c-s3c2410: Remove unconditional 1ms delay on each transfer
Date: Wed, 28 Apr 2010 10:39:21 +0100 [thread overview]
Message-ID: <20100428093921.GD31400@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <4BD7BBF6.9090103@samsung.com>
On Wed, Apr 28, 2010 at 01:39:18PM +0900, Joonyoung Shim wrote:
> On 4/2/2010 10:15 PM, Mark Brown wrote:
> > Replace the sleep with a spin on the IIC status register for up to 1ms.
> > This will busy wait but testing on my SMDK6410 system indicates that
> > the overwhelming majority of transactions complete on the first spin,
> > with maximum latencies of less than 10 spins so the absolute overhead
> > of busy waiting should be at worst comprable to msleep(), and the
> > overall system performance is dramatically improved.
> I tested this patch on the s5pc110. This occurs msleep(1) still by time
> out at the my touchscreen i2c device on the s5pc110. It takes 80usec to
> clear S3C2410_IICSTAT_START bit in the worst case of my touchscreen and
> need about 400 spins. The 1msec delay is overhead to me still now.
Yeah, I did expect we might run on a bit and get into the sleep which is
why I left the fallback for it in there. I was trying to make as small
a change as possible so that the change would be robust, the performance
win is so dramatic. I guess tuning up the number of spins would work
well in your case.
One idea that did occur to me while I was looking at this is to change
the code so that if the delay is long instead of waiting for the bus to
go idle at the end of the transaction we do so at the start of the next
transaction. It's the next one that really cares that the bus has gone
idle, and in a lot of cases there's enough gap between the transactions
due to other work the CPU is doing to mean that there's no need to
explicitly wait at all.
prev parent reply other threads:[~2010-04-28 9:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-02 13:15 [PATCH v2] i2c-s3c2410: Remove unconditional 1ms delay on each transfer Mark Brown
2010-04-05 22:44 ` Ben Dooks
2010-04-28 4:39 ` Joonyoung Shim
2010-04-28 9:39 ` Mark Brown [this message]
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=20100428093921.GD31400@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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).