(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
This commit is contained in:
Dan Eaton committed 2000-11-01 16:31:45 +00:00
1 parent 2e083cada0
commit abdcc7ee80
1 file changed
+8 -5
+8 -5
View File
@@ -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