svn commit: r278326 - in stable: 10/sys/dev/ipmi 8/sys/dev/ipmi 9/sys/dev/ipmi
John Baldwin
jhb at FreeBSD.org
Fri Feb 6 18:41:59 UTC 2015
Author: jhb
Date: Fri Feb 6 18:41:57 2015
New Revision: 278326
URL: https://svnweb.freebsd.org/changeset/base/278326
Log:
MFC 276065:
Explicitly treat timeouts when waiting for IBF or OBF to change state as an
error. This fixes occasional hangs in the IPMI kcs thread when using
ipmitool locally.
Modified:
stable/8/sys/dev/ipmi/ipmi_kcs.c
Directory Properties:
stable/8/sys/ (props changed)
stable/8/sys/dev/ (props changed)
stable/8/sys/dev/ipmi/ (props changed)
Changes in other areas also in this revision:
Modified:
stable/10/sys/dev/ipmi/ipmi_kcs.c
stable/9/sys/dev/ipmi/ipmi_kcs.c
Directory Properties:
stable/10/ (props changed)
stable/9/sys/ (props changed)
stable/9/sys/dev/ (props changed)
Modified: stable/8/sys/dev/ipmi/ipmi_kcs.c
==============================================================================
--- stable/8/sys/dev/ipmi/ipmi_kcs.c Fri Feb 6 18:19:59 2015 (r278325)
+++ stable/8/sys/dev/ipmi/ipmi_kcs.c Fri Feb 6 18:41:57 2015 (r278326)
@@ -184,6 +184,8 @@ kcs_start_write(struct ipmi_softc *sc)
for (retry = 0; retry < 10; retry++) {
/* Wait for IBF = 0 */
status = kcs_wait_for_ibf(sc, 0);
+ if (status & KCS_STATUS_IBF)
+ return (0);
/* Clear OBF */
kcs_clear_obf(sc, status);
@@ -193,6 +195,9 @@ kcs_start_write(struct ipmi_softc *sc)
/* Wait for IBF = 0 */
status = kcs_wait_for_ibf(sc, 0);
+ if (status & KCS_STATUS_IBF)
+ return (0);
+
if (KCS_STATUS_STATE(status) == KCS_STATUS_STATE_WRITE)
break;
DELAY(1000000);
@@ -222,6 +227,8 @@ kcs_write_byte(struct ipmi_softc *sc, u_
/* Wait for IBF = 0 */
status = kcs_wait_for_ibf(sc, 0);
+ if (status & KCS_STATUS_IBF)
+ return (0);
if (KCS_STATUS_STATE(status) != KCS_STATUS_STATE_WRITE)
return (0);
@@ -244,6 +251,8 @@ kcs_write_last_byte(struct ipmi_softc *s
/* Wait for IBF = 0 */
status = kcs_wait_for_ibf(sc, 0);
+ if (status & KCS_STATUS_IBF)
+ return (0);
if (KCS_STATUS_STATE(status) != KCS_STATUS_STATE_WRITE)
/* error state */
@@ -274,6 +283,8 @@ kcs_read_byte(struct ipmi_softc *sc, u_c
/* Wait for OBF = 1 */
status = kcs_wait_for_obf(sc, 1);
+ if ((status & KCS_STATUS_OBF) == 0)
+ return (0);
/* Read Data_out */
*data = INB(sc, KCS_DATA);
@@ -288,6 +299,8 @@ kcs_read_byte(struct ipmi_softc *sc, u_c
/* Wait for OBF = 1*/
status = kcs_wait_for_obf(sc, 1);
+ if ((status & KCS_STATUS_OBF) == 0)
+ return (0);
/* Read Dummy */
dummy = INB(sc, KCS_DATA);
More information about the svn-src-stable-8
mailing list