]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commit
i2c/eeprom: Fall back to SMBus read word transactions
authorJean Delvare <khali@linux-fr.org>
Mon, 14 Jul 2008 20:38:29 +0000 (22:38 +0200)
committerJean Delvare <khali@mahadeva.delvare>
Mon, 14 Jul 2008 20:38:29 +0000 (22:38 +0200)
commit1b4dff9cd37d430bc76112396e92bb3552f37ccd
tree30bc7e5816a5d68bb0e2a202e4b54e1d776c2348
parentd4653bf946a5856a17342cd47c47d10b16b1cc22
i2c/eeprom: Fall back to SMBus read word transactions

When I2C block reads are not supported by the underlying adapter, use
SMBus read word transactions instead of consecutive byte reads.
Reasons for this change are:

* The consecutive byte read approach is not safe on multi-master buses.

* While consecutive byte reads have less overhead if you only count the
  bytes on the bus, it takes more than twice as many transactions as
  with SMBus read word transactions, and each transaction has a cost:
  taking and releasing the adapter mutex, and for polling drivers,
  waiting for the transaction to complete.

This change yields a significant performance boost at HZ=250 with
EEPROMs on an Intel 82801 bus (basically twice as fast.)

SMBus read word transactions are widely supported so I don't expect
compatibility issues.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
drivers/i2c/chips/eeprom.c