Skip to contentSkip to conversation

i2c-i801: Don't use the block buffer for I2C block writes

PATCH In review Jean Delvare 2 participants 3 messages Mar 4, 2010 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c-i801: Don't use the block buffer for I2C block writes

From: Jean Delvare <[email protected]>
Subject: i2c-i801: Don't use the block buffer for I2C block writes

Experience has shown that the block buffer can only be used for SMBus (not I2C) block transactions, even though the datasheet doesn't mention this limitation.

Cc Felix Rubinstein <[email protected]>
Cc Oleg Ryjkov <[email protected]>
Cc Seth Heasley <[email protected]>

---
Oleg, can you remember which transaction types you tested when you added support for the block buffer originally?

Seth, do you have any additional information regarding the use of the 32-byte block buffer with I2C block read and write transactions on Intel ICH chips? The datasheet doesn't say it won't work, but experience suggests that this is the case. Which is unfortunate because it degrades performance quite a bit.

 drivers/i2c/busses/i2c-i801.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-i801.c +4 -2
@@ -416,9 +416,11 @@ static int i801_block_transaction(union
 		data->block[0] = 32;	/* max for SMBus block reads */
 	}
 
+	/* Experience has shown that the block buffer can only be used for
+	   SMBus (not I2C) block transactions, even though the datasheet
+	   doesn't mention this limitation. */
 	if ((i801_features & FEATURE_BLOCK_BUFFER)
-	 && !(command == I2C_SMBUS_I2C_BLOCK_DATA
-	      && read_write == I2C_SMBUS_READ)
+	 && command != I2C_SMBUS_I2C_BLOCK_DATA
 	 && i801_set_block_buffer_mode() == 0)
 		result = i801_block_transaction_by_block(data, read_write,
 							 hwpec);
Signature · 1 line
Jean Delvare

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

drivers/i2c/busses/i2c-i801.c static int i801_block_transaction(union · line 421

Quoted 3 lines
drivers/i2c/busses/i2c-i801.c +3 -0
+	/* Experience has shown that the block buffer can only be used for
+	   SMBus (not I2C) block transactions, even though the datasheet
+	   doesn't mention this limitation. */

Minor: Comment style?

Signature · 2 lines
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw
Quoted 5 lines · Wolfram Sang

drivers/i2c/busses/i2c-i801.c static int i801_block_transaction(union · line 421

Quoted 3 lines
drivers/i2c/busses/i2c-i801.c +3 -0
+	/* Experience has shown that the block buffer can only be used for
+	   SMBus (not I2C) block transactions, even though the datasheet
+	   doesn't mention this limitation. */

Minor: Comment style?

checkpatch did not complain, and I couldn't find any consistency in comment style in this driver.

Signature · 1 line
Jean Delvare