Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1374181 > unrolled thread
| Started by | Jarkko Nikula <jarkko.nikula@linux.intel.com> |
|---|---|
| First post | 2016-04-08 14:20 +0200 |
| Last post | 2016-04-08 14:20 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH] i2c: designware: do not disable adapter after transfer Jarkko Nikula <jarkko.nikula@linux.intel.com> - 2016-04-08 14:20 +0200
| From | Jarkko Nikula <jarkko.nikula@linux.intel.com> |
|---|---|
| Date | 2016-04-08 14:20 +0200 |
| Subject | Re: [PATCH] i2c: designware: do not disable adapter after transfer |
| Message-ID | <rlDyi-3AX-7@gated-at.bofh.it> |
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
Back to top | Article view | linux.kernel
csiph-web