All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH linux dev-5.3] i2c: fsi: Increase performance
@ 2019-11-04 20:12 Eddie James
  0 siblings, 0 replies; only message in thread
From: Eddie James @ 2019-11-04 20:12 UTC (permalink / raw)
  To: openbmc; +Cc: joel, Eddie James

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(-)

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;
 }
 
-- 
2.23.0

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-11-04 20:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-04 20:12 [PATCH linux dev-5.3] i2c: fsi: Increase performance Eddie James

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.