From abdcc7ee809140b91658d709c3bbc2cdbc2f1f2b Mon Sep 17 00:00:00 2001 From: Dan Eaton Date: Wed, 1 Nov 2000 16:31:45 +0000 Subject: [PATCH] (dan) Restructured the error checks performed at the end of the transaction to check the "command completed" flag before checking for error flags in the status register. This will insure that when both conditions exist (command not completed && error conditions present), a "kill" command will be executed on the SMBus controller to clean up the bus. Also, added a status register write after "kill" and "timeout" commands to insure that the status gets cleaned up after a bad transaction. This change fixes observed behavior in which a "command never completed" transaction was always followed by an "idle wait timeout" on the next subsequent trans- action. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@919 7894878c-1315-0410-8ee3-d5d059ff63e0 --- kernel/busses/i2c-ali1535.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/kernel/busses/i2c-ali1535.c b/kernel/busses/i2c-ali1535.c index 1c4a808d..095702b2 100644 --- a/kernel/busses/i2c-ali1535.c +++ b/kernel/busses/i2c-ali1535.c @@ -434,14 +434,16 @@ int ali1535_transaction(void) /* take consequent actions for error conditions */ - if (temp & ALI1535_STS_ERR) { - /* issue "timeout" to reset all devices on bus */ - outb_p(ALI1535_T_OUT,SMBHSTTYP); - } - else if (!(temp & ALI1535_STS_DONE)) { + if (!(temp & ALI1535_STS_DONE)) { /* issue "kill" to reset host controller */ outb_p(ALI1535_KILL,SMBHSTTYP); + outb_p(0xFF,SMBHSTSTS); } + else if (temp & ALI1535_STS_ERR) { + /* issue "timeout" to reset all devices on bus */ + outb_p(ALI1535_T_OUT,SMBHSTTYP); + outb_p(0xFF,SMBHSTSTS); + } return result; } @@ -642,6 +644,7 @@ int __init ali1535_cleanup(void) #ifdef RLX EXPORT_SYMBOL(ali1535_smba); +EXPORT_SYMBOL(ali1535_access); #else EXPORT_NO_SYMBOLS; #endif