[linux,dev-5.3] i2c: fsi: Increase performance
diff mbox series

Message ID 20191104201230.1423-1-eajames@linux.ibm.com
State New
Headers show
Series
  • [linux,dev-5.3] i2c: fsi: Increase performance
Related show

Commit Message

Eddie James Nov. 4, 2019, 8:12 p.m. UTC
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.

Signed-off-by: Eddie James <eajames@linux.ibm.com>
---
 drivers/i2c/busses/i2c-fsi.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

Patch
diff mbox series

diff --git a/drivers/i2c/busses/i2c-fsi.c b/drivers/i2c/busses/i2c-fsi.c
index da5eb3960def..22b79f995d2b 100644
--- a/drivers/i2c/busses/i2c-fsi.c
+++ b/drivers/i2c/busses/i2c-fsi.c
@@ -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;
 }