lkml.org 
[lkml]   [2017]   [Dec]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] i2c: piix4: Use usleep_range()
Date
The piix4 i2c driver is extremely slow. Replacing msleep()
with usleep_range() increases its speed substantially.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
drivers/i2c/busses/i2c-piix4.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
index 78dd5951d6e7..52a8b1c5c110 100644
--- a/drivers/i2c/busses/i2c-piix4.c
+++ b/drivers/i2c/busses/i2c-piix4.c
@@ -467,13 +467,13 @@ static int piix4_transaction(struct i2c_adapter *piix4_adapter)

/* We will always wait for a fraction of a second! (See PIIX4 docs errata) */
if (srvrworks_csb5_delay) /* Extra delay for SERVERWORKS_CSB5 */
- msleep(2);
+ usleep_range(2000, 2000);
else
- msleep(1);
+ usleep_range(500, 1000);

while ((++timeout < MAX_TIMEOUT) &&
((temp = inb_p(SMBHSTSTS)) & 0x01))
- msleep(1);
+ usleep_range(200, 500);

/* If the SMBus is still busy, we give up */
if (timeout == MAX_TIMEOUT) {
--
2.7.4
\
 
 \ /
  Last update: 2017-12-30 17:51    [W:0.139 / U:13.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site