From owner-freebsd-current@freebsd.org Wed Jul 8 19:21:49 2015 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F24E9966E3 for ; Wed, 8 Jul 2015 19:21:49 +0000 (UTC) (envelope-from rndfax@yandex.ru) Received: from forward2l.mail.yandex.net (forward2l.mail.yandex.net [IPv6:2a02:6b8:0:1819::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Certum Level IV CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E9D41F17 for ; Wed, 8 Jul 2015 19:21:49 +0000 (UTC) (envelope-from rndfax@yandex.ru) Received: from smtp18.mail.yandex.net (smtp18.mail.yandex.net [IPv6:2a02:6b8:0:1402::119]) by forward2l.mail.yandex.net (Yandex) with ESMTP id F192F1AC04AF; Wed, 8 Jul 2015 22:21:45 +0300 (MSK) Received: from smtp18.mail.yandex.net (localhost [127.0.0.1]) by smtp18.mail.yandex.net (Yandex) with ESMTP id 8D00318A0159; Wed, 8 Jul 2015 22:21:45 +0300 (MSK) Received: from broadband-46-188-123-161.2com.net (broadband-46-188-123-161.2com.net [46.188.123.161]) by smtp18.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id RWhQXepKRc-Ljp8rdnj; Wed, 8 Jul 2015 22:21:45 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1436383305; bh=sSKgdEhvx/+vjSWbI2+5B0WT0oXOyqRvwK5BU8hXdbc=; h=From:To:Cc:Subject:Date:Message-Id:X-Mailer; b=Qylzmvdi1mgpis6frKV8rUH5Td+MjTsl/QCwp5Qu7lSxMOZfgUlkKbQwIrGuyzmac enK6FXBOxDVFqJvQ8xxGDvPRMLdY2+0EmC1J97yovZ2xmFuM+/MoQftuFwIIZYlZEp c2XvrMzLRTEvQ5OZNrxP9LdaaZxC03fg4vjDu1mA= Authentication-Results: smtp18.mail.yandex.net; dkim=pass header.i=@yandex.ru From: Aleksey Kuleshov To: freebsd-current@freebsd.org Cc: Aleksey Kuleshov Subject: [PATCH] uart_core: start countdown for non-interrupt mode Date: Wed, 8 Jul 2015 22:14:25 +0000 Message-Id: <1436393665-1327-1-git-send-email-rndfax@yandex.ru> X-Mailer: git-send-email 2.4.5 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2015 19:21:49 -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 @@ -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