Skip site navigation (1)Skip section navigation (2)
Date:      Wed,  8 Jul 2015 22:14:25 +0000
From:      Aleksey Kuleshov <rndfax@yandex.ru>
To:        freebsd-current@freebsd.org
Cc:        Aleksey Kuleshov <rndfax@yandex.ru>
Subject:   [PATCH] uart_core: start countdown for non-interrupt mode
Message-ID:  <1436393665-1327-1-git-send-email-rndfax@yandex.ru>

next in thread | raw e-mail | index | archive | help
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
@@ -540,6 +540,8 @@ 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1436393665-1327-1-git-send-email-rndfax>