From d98d0c0185e0bd68a624c967779362bff183ab11 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Fri, 23 Jun 2006 18:39:51 +0000 Subject: [PATCH] i2c-i801: Fix block transaction poll loops Two of the three poll loops have the poll and sleep swapped, causing an extra sleep to occur after the polled condition is fulfilled. In practice, this doubles the amount of sleep time for every block transaction. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4059 7894878c-1315-0410-8ee3-d5d059ff63e0 --- CHANGES | 1 + kernel/busses/i2c-i801.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 8d8d915f..4b050819 100644 --- a/CHANGES +++ b/CHANGES @@ -16,6 +16,7 @@ lm_sensors CHANGES file (2.6 backport) Module i2c-i801: Disable PEC mode after every transaction (2.6 backport) Add ICH8 support (2.6 backport) + Fix block transaction poll loops (2.6 backport) Module i2c-nforce2: Add nForce4 MCP51, MCP55 support (2.6 backport) Module i2c-piix4: Add ServerWorks HT-1000 support (2.6 backport) Add ATI IXP200, IXP300, IXP400 support (2.6 backport) diff --git a/kernel/busses/i2c-i801.c b/kernel/busses/i2c-i801.c index ed72d27a..a53c9ec0 100644 --- a/kernel/busses/i2c-i801.c +++ b/kernel/busses/i2c-i801.c @@ -393,8 +393,8 @@ static int i801_block_transaction(union i2c_smbus_data *data, char read_write, /* We will always wait for a fraction of a second! */ timeout = 0; do { - temp = inb_p(SMBHSTSTS); i2c_delay(1); + temp = inb_p(SMBHSTSTS); } while ((!(temp & 0x80)) && (timeout++ < MAX_TIMEOUT)); @@ -457,8 +457,8 @@ static int i801_block_transaction(union i2c_smbus_data *data, char read_write, /* wait for INTR bit as advised by Intel */ timeout = 0; do { - temp = inb_p(SMBHSTSTS); i2c_delay(1); + temp = inb_p(SMBHSTSTS); } while ((!(temp & 0x02)) && (timeout++ < MAX_TIMEOUT));