From owner-freebsd-bugs@FreeBSD.ORG Mon Oct 13 01:00:02 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F419106568A for ; Mon, 13 Oct 2008 01:00:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 011138FC14 for ; Mon, 13 Oct 2008 01:00:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id m9D101PA035843 for ; Mon, 13 Oct 2008 01:00:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id m9D101FJ035842; Mon, 13 Oct 2008 01:00:01 GMT (envelope-from gnats) Resent-Date: Mon, 13 Oct 2008 01:00:01 GMT Resent-Message-Id: <200810130100.m9D101FJ035842@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Arthur Hartwig Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C83701065686 for ; Mon, 13 Oct 2008 00:58:49 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id B5CB58FC0C for ; Mon, 13 Oct 2008 00:58:49 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id m9D0wnrP072569 for ; Mon, 13 Oct 2008 00:58:49 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id m9D0wndN072568; Mon, 13 Oct 2008 00:58:49 GMT (envelope-from nobody) Message-Id: <200810130058.m9D0wndN072568@www.freebsd.org> Date: Mon, 13 Oct 2008 00:58:49 GMT From: Arthur Hartwig To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/128036: Serial console mostly ignores typein to restart after shutdown X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Oct 2008 01:00:02 -0000 >Number: 128036 >Category: kern >Synopsis: Serial console mostly ignores typein to restart after shutdown >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Oct 13 01:00:01 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Arthur Hartwig >Release: 6.3 >Organization: Nokia >Environment: >Description: System with serial console. If the system is shutdown by "shutdown -h ..." the following prompt is displayed on the console: "The operating system has halted. Please press any key to reboot." Often a single keypress is not recognised; multiple keypresses are often required for the system to reboot. >How-To-Repeat: On system with serial console, issue # shutdown -h now command >Fix: In sys/dev/sio.c, function siocnclose() change outb(iobase + com_mcr, sp->mcr | MCR_DTR | MCR_RTS); outb(iobase + com_ier, sp->ier); to outb(iobase + com_mcr, sp->mcr | MCR_DTR | MCR_RTS); if (rebooting == 0) { /* * Only restore the interrupt enables if not rebooting. If * rebooting leave interrupts disabled, else a key press might be * swallowed by the interrupt handler and not seen by the shutdown code. */ outb(iobase + com_ier, sp->ier); } The problem is that the shutdown code looking for a keypress on the console (loop in sys/kern/kern_shutdown.c function shutdown_halt) runs with console interrupts enabled. If the keypress generates a console interrupt then the keypress is swallowed by the console interrupt handler and not seen by the code polling for a keypress. >Release-Note: >Audit-Trail: >Unformatted: