From: Jarkko Nikula <jarkko.nikula@linux.intel.com>
To: Lucas De Marchi <lucas.de.marchi@gmail.com>, linux-i2c@vger.kernel.org
Cc: Lucas De Marchi <lucas.demarchi@intel.com>,
linux-kernel@vger.kernel.org, Wolfram Sang <wsa@the-dreams.de>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
christian.ruppert@alitech.com
Subject: Re: [PATCH] i2c: designware: do not disable adapter after transfer
Date: Fri, 8 Apr 2016 15:17:49 +0300 [thread overview]
Message-ID: <5707A16D.2010800@linux.intel.com> (raw)
In-Reply-To: <1459478866-3896-1-git-send-email-lucas.de.marchi@gmail.com>
Hi
On 04/01/2016 05:47 AM, Lucas De Marchi wrote:
> From: Lucas De Marchi <lucas.demarchi@intel.com>
>
> Disabling the adapter after each transfer is pretty bad for sensors and
> other devices doing small transfers at a high rate. It slows down the
> transfer rate a lot since each of them have to wait the adapter to be
> enabled again.
>
> It was done in order to avoid the adapter to generate interrupts when
> it's not being used. Instead of doing that here we just disable the
> interrupt generation in the controller. With a small program test to
> read/write registers in a sensor the speed doubled. Example below with
> write sequences of 16 bytes:
>
> Before:
> i2c-transfer-time -w -a 0x40 -x 6 -n 20000 -- 0 0 0xd0 0x07 0 0 0xd0 0x07 0 0 0xd0 0x07 0 0 0xd0 0x07
> num_transfers=20000
> transfer_time_avg=1032.728500us
>
> After:
> i2c-transfer-time -w -a 0x40 -x 6 -n 20000 -- 0 0 0xd0 0x07 0 0 0xd0 0x07 0 0 0xd0 0x07 0 0 0xd0 0x07
> num_transfers=20000
> transfer_time_avg=470.256050us
>
I gave a test to this patch and saw similar improvements when dumping
large set of registers from I2C connected audio codec.
echo Y > /sys/kernel/debug/regmap/i2c-10EC5640\:00/cache_bypass
time cat /sys/kernel/debug/regmap/i2c-10EC5640\:00/registers >/dev/null
I checked the runtime PM status of adapter was suspended before running
above cat command in order to get comparable results.
Before patch time was ~0.55 - ~0.76 s and with patch applied time was
~0.16 - ~0.25 s.
Hopefully we'll find how to prevent regression on Christian's machines.
--
Jarkko
prev parent reply other threads:[~2016-04-08 12:18 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-01 2:47 [PATCH] i2c: designware: do not disable adapter after transfer Lucas De Marchi
2016-04-07 13:37 ` Christian Ruppert
2016-04-07 17:28 ` De Marchi, Lucas
2016-04-08 14:01 ` Christian Ruppert
2016-04-22 15:08 ` Lucas De Marchi
2016-04-22 15:19 ` Lucas De Marchi
2016-05-02 10:11 ` Christian Ruppert
2016-05-04 14:38 ` Lucas De Marchi
2016-05-09 8:50 ` Christian Ruppert
2016-04-25 11:51 ` Jarkko Nikula
2016-04-25 15:04 ` Lucas De Marchi
2016-04-27 7:47 ` Jarkko Nikula
2016-04-08 12:17 ` Jarkko Nikula [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=5707A16D.2010800@linux.intel.com \
--to=jarkko.nikula@linux.intel.com \
--cc=christian.ruppert@alitech.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lucas.de.marchi@gmail.com \
--cc=lucas.demarchi@intel.com \
--cc=mika.westerberg@linux.intel.com \
--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 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).