Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8870 do not lock cpu when waiting for IBF or OBF #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions usr/src/uts/intel/io/ipmi/ipmi_kcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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(drv_usectohz(1000000));
Expand Down Expand Up @@ -222,6 +227,8 @@ kcs_write_byte(struct ipmi_softc *sc, uchar_t data)

/* 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);
Expand All @@ -244,6 +251,8 @@ kcs_write_last_byte(struct ipmi_softc *sc, uchar_t data)

/* 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 */
Expand Down Expand Up @@ -273,6 +282,8 @@ kcs_read_byte(struct ipmi_softc *sc, uchar_t *data)

/* 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);
Expand All @@ -287,6 +298,8 @@ kcs_read_byte(struct ipmi_softc *sc, uchar_t *data)

/* Wait for OBF = 1 */
status = kcs_wait_for_obf(sc, 1);
if ((status & KCS_STATUS_OBF) == 0)
return (0);

/* Read Dummy */
(void) INB(sc, KCS_DATA);
Expand Down