diff --git a/sys/dev/ichiic/ig4_iic.c b/sys/dev/ichiic/ig4_iic.c --- a/sys/dev/ichiic/ig4_iic.c +++ b/sys/dev/ichiic/ig4_iic.c @@ -72,7 +72,7 @@ #include #include -#define DO_POLL(sc) (cold || kdb_active || SCHEDULER_STOPPED() || sc->poll) +#define DO_POLL(sc) (cold || kdb_active || SCHEDULER_STOPPED()) /* * tLOW, tHIGH periods of the SCL clock and maximal falling time of both @@ -720,14 +720,11 @@ if ((how & IIC_WAIT) == 0) { if (sx_try_xlock(&sc->call_lock) == 0) error = IIC_EBUSBSY; - else - sc->poll = true; } else sx_xlock(&sc->call_lock); break; case IIC_RELEASE_BUS: - sc->poll = false; sx_unlock(&sc->call_lock); break; diff --git a/sys/dev/ichiic/ig4_var.h b/sys/dev/ichiic/ig4_var.h --- a/sys/dev/ichiic/ig4_var.h +++ b/sys/dev/ichiic/ig4_var.h @@ -93,7 +93,6 @@ bool platform_attached : 1; bool use_10bit : 1; bool slave_valid : 1; - bool poll: 1; /* * Locking semantics: diff --git a/sys/dev/iicbus/iichid.c b/sys/dev/iicbus/iichid.c --- a/sys/dev/iicbus/iichid.c +++ b/sys/dev/iicbus/iichid.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -602,7 +603,9 @@ * acknowledge interrupts we fetch only length header and discard it. */ maxlen = sc->power_on ? sc->intr_bufsize : 0; + THREAD_SLEEPING_OK(); error = iichid_cmd_read(sc, sc->intr_buf, maxlen, &actual); + THREAD_NO_SLEEPING(); if (error == 0) { if (sc->power_on) { if (actual != 0)