Skip to contentSkip to conversation

i2c: fsi: Increase performance

PATCH New Eddie James 1 participant 1 message Nov 4, 2019

Subsystems (2)
lore
Share & tools
lore

Eddie James

author maintainer
#0 lore raw

PATCH 1/1 i2c: fsi: Increase performance

Usleep_range is holding back performance too much with the current polling method, so remove it. In addition, reduce the default clock divider to 3. And fix a bug where timeouts aren't cleaned up.

---
 drivers/i2c/busses/i2c-fsi.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/i2c/busses/i2c-fsi.c +3 -6
index da5eb3960def..22b79f995d2b 100644
@@ -27,7 +27,7 @@
 
 #define FSI_ENGID_I2C		0x7
 
-#define I2C_DEFAULT_CLK_DIV	6
+#define I2C_DEFAULT_CLK_DIV	3
 
 /* i2c registers */
 #define I2C_FSI_FIFO		0x00
@@ -592,14 +592,11 @@ static int fsi_i2c_wait(struct fsi_i2c_port *port, struct i2c_msg *msg,
 			/* cmd complete and all data xfrd */
 			if (rc == msg->len)
 				return 0;
-
-			/* need to xfr more data, but maybe don't need wait */
-			continue;
 		}
-
-		usleep_range(I2C_CMD_SLEEP_MIN_US, I2C_CMD_SLEEP_MAX_US);
 	} while (time_after(start + timeout, jiffies));
 
+	fsi_i2c_abort(port, 0);
+
 	return -ETIMEDOUT;
 }
 
Signature · 1 line
2.23.0