[PATCH] uart_core: start countdown for non-interrupt mode

From: Aleksey Kuleshov <rndfax_at_yandex.ru>
Date: Wed, 8 Jul 2015 22:14:25 +0000
The uart_intr will never be called if interrupts are not available.
Start counter with callout_reset call.

---
 sys/dev/uart/uart_core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/dev/uart/uart_core.c b/sys/dev/uart/uart_core.c
index bbb06ff..c1b64ba 100644
--- a/sys/dev/uart/uart_core.c
+++ b/sys/dev/uart/uart_core.c
_at__at_ -540,6 +540,8 _at__at_ uart_bus_attach(device_t dev)
 		/* No interrupt resource. Force polled mode. */
 		sc->sc_polled = 1;
 		callout_init(&sc->sc_timer, 1);
+		callout_reset(&sc->sc_timer, hz / uart_poll_freq,
+		    (timeout_t *)uart_intr, sc);
 	}
 
 	if (bootverbose && (sc->sc_fastintr || sc->sc_polled)) {
-- 
2.4.5
Received on Wed Jul 08 2015 - 17:21:49 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:58 UTC