From nobody@FreeBSD.org  Mon Apr  9 21:58:36 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 5F70C106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  9 Apr 2012 21:58:36 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 314EB8FC12
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  9 Apr 2012 21:58:36 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q39LwZUQ029168
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 9 Apr 2012 21:58:35 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q39LwZKk029167;
	Mon, 9 Apr 2012 21:58:35 GMT
	(envelope-from nobody)
Message-Id: <201204092158.q39LwZKk029167@red.freebsd.org>
Date: Mon, 9 Apr 2012 21:58:35 GMT
From: Ian <yoitsmeremember@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Winbond W83627DHG-P serial console hang
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         166805
>Category:       kern
>Synopsis:       Winbond W83627DHG-P serial console hang
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Apr 09 22:00:42 UTC 2012
>Closed-Date:    
>Last-Modified:  Sat Mar 16 07:07:24 UTC 2013
>Originator:     Ian
>Release:        FreeBSD 9.0-RELEASE amd64
>Organization:
-
>Environment:
FreeBSD diamond 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Mon Apr  9 18:52:38 UTC 2012     root@diamond:/usr/obj/usr/src/sys/DIAMOND  amd64
>Description:
When using a serial console (either "-Dh -S115200" or "-h -S115200") on an Intel D2500CC, the system will hang during boot, shortly after the root filesystem is loaded.  More specifically, it will hang (not panic) after printing "Setting hostuuid", and if hostid is disabled in rc.conf, it will hang after printing "Entropy harvesti" (without the "ng" at the end), coincidentally the exact same number of printed characters (16) as would have been printed when trying to set the host UUID.  This leads me to believe it's a buffering issue.

According to the "Technical Product Specification" from Intel, the board uses a Winbond W83627DHG-P for legacy, including serial, I/O.  In dmesg these appear as:

uart0: <16550 or compatible> port 0x3f8-0x3ff irq 3 flags 0x10 on acpi0
uart1: <16550 or compatible> port 0x2f8-0x2ff irq 4 on acpi0
uart2: <16550 or compatible> port 0x2e8-0x2ef irq 3 on acpi0
uart3: <16550 or compatible> port 0x2e0-0x2e7 irq 4 on acpi0

The problem also occurs with any combination of either amd64 or i386 and FreeBSD 8.2-RELEASE or 9.0-RELEASE.
>How-To-Repeat:
Boot FreeBSD 9.0 or 8.2, either amd64 or i386, with a serial console configured (in my case, "-h -S115200" in /boot.config) on a D2500CC or, presumably, any board with a Winbond W83627DHG-P for serial I/O.

I also configured a serial tty for the same line at 115200 baud in /etc/ttys, though I don't believe it had any effect as I never got to a login prompt.
>Fix:
No known fix.

As there are also issues with the GPU on the new Intel Atom boards (see amd64/166639: [boot] Syscons issue Intel D2700) this leaves minimal options for administration of such boards running FreeBSD.  Aside from network administration (e.g. sshd), you may be stuck installing a PCI graphics card for installation or configuration if you are unable to do so via the network.

>Release-Note:
>Audit-Trail:

From: =?UTF-8?Q?Marcin_Wi=C5=9Bnicki?= <mwisnicki@gmail.com>
To: bug-followup@FreeBSD.org, yoitsmeremember@gmail.com
Cc:  
Subject: Re: kern/166805: Winbond W83627DHG-P serial console hang
Date: Tue, 1 May 2012 04:46:11 +0200

 I have this same problem in pfSense 2.0.1 (FreeBSD 8.1-RELEASE-p6). It
 seems that if I enter ddb using real (usb) keyboard, I can control it
 via serial console. Resuming execution will print more characters and
 stop. This can be repeated couple of times until entering ddb will
 cause what looks like a freeze where not even numlock works but
 repeatedly breaking will get me back to usable ddb.
 
 I have disabled all non-essential devices in bios (everything except
 usb and serial) and tried booting into single user mode.

From: =?UTF-8?Q?Marcin_Wi=C5=9Bnicki?= <mwisnicki@gmail.com>
To: bug-followup@FreeBSD.org, yoitsmeremember@gmail.com
Cc:  
Subject: Re: kern/166805: Winbond W83627DHG-P serial console hang
Date: Tue, 1 May 2012 16:10:14 +0200

 And here is a verbose bootlog and some ddb output:
 
   https://gist.github.com/2568016
 
 According to "show intrcnt" at least serial interrupts seem to be working.

From: =?UTF-8?Q?Marcin_Wi=C5=9Bnicki?= <mwisnicki@gmail.com>
To: bug-followup@FreeBSD.org, yoitsmeremember@gmail.com
Cc:  
Subject: Re: kern/166805: Winbond W83627DHG-P serial console hang
Date: Tue, 1 May 2012 22:51:10 +0200

 Booting to 9.0R/i386 without serial console works for me (D2500CCE).
 
 Launching "getty std.115200 ttyu0" after boot prints exactly
 "\nFreeBSD/i386 " and serial port hangs but the system is still
 usable.
 
 vmstat -i reports single interrupt that wasn't there before running getty.
 
 interrupt                          total       rate
 irq3: uart0                            1          0
 irq18: uhci2                        3038          0
 irq20: hpet0+                         20          0
 irq23: uhci0 ehci0                  4224          0
 cpu0:timer                        381634         66
 irq256: hdac0                         18          0
 irq257: em0:rx 0                    4267          0
 irq258: em0:tx 0                      13          0
 irq259: em0:link                       2          0
 irq263: ahci0                         53          0
 cpu1:timer                         79074         13
 Total                             472344         81

From: =?UTF-8?Q?Marcin_Wi=C5=9Bnicki?= <mwisnicki@gmail.com>
To: bug-followup@freebsd.org, yoitsmeremember@gmail.com
Cc:  
Subject: Re: kern/166805: Winbond W83627DHG-P serial console hang
Date: Mon, 4 Jun 2012 00:17:52 +0200

 --e89a8f23579dd5bd6f04c198c9b8
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: base64
 
 UHJvYmxlbSBjYW4gYmUgd29ya2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gwqAgwqAgNTMgwqAgwqAgwqAgwqAgwqAwCj4gY3B1MTp0aW1lciDCoCDCoCDCoCDCoCDCoCDC
 oCDCoCDCoCDCoCDCoCDCoCDCoCA3OTA3NCDCoCDCoCDCoCDCoCAxMwo+IFRvdGFsIMKgIMKgIMKg
 IMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIDQ3MjM0NCDCoCDCoCDCoCDCoCA4MQo=
 --e89a8f23579dd5bd6f04c198c9b8
 Content-Type: application/octet-stream; name="002-uart-disable-intr.diff"
 Content-Disposition: attachment; filename="002-uart-disable-intr.diff"
 Content-Transfer-Encoding: base64
 X-Attachment-Id: f_h30o2ayr0
 
 SW5kZXg6IGRldi91YXJ0L3VhcnRfY29yZS5jCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09
 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIGRldi91YXJ0L3VhcnRf
 Y29yZS5jCShyZXZpc2lvbiAyMzUwNjYpCisrKyBkZXYvdWFydC91YXJ0X2NvcmUuYwkod29ya2lu
 ZyBjb3B5KQpAQCAtNDE5LDYgKzQxOSw3IEBACiAJc2MtPnNjX2Jhcy5ic3QgPSBybWFuX2dldF9i
 dXN0YWcoc2MtPnNjX3JyZXMpOwogCiAJc2MtPnNjX2lyaWQgPSAwOworI2lmZGVmIFVBUlRfSU5U
 UgogCXNjLT5zY19pcmVzID0gYnVzX2FsbG9jX3Jlc291cmNlX2FueShkZXYsIFNZU19SRVNfSVJR
 LCAmc2MtPnNjX2lyaWQsCiAJICAgIFJGX0FDVElWRSB8IFJGX1NIQVJFQUJMRSk7CiAJaWYgKHNj
 LT5zY19pcmVzICE9IE5VTEwpIHsKQEAgLTQzOSw2ICs0NDAsOSBAQAogCQkJc2MtPnNjX2lyZXMg
 PSBOVUxMOwogCQl9CiAJfQorI2Vsc2UKKwlzYy0+c2NfaXJlcyA9IE5VTEw7CisjZW5kaWYKIAlp
 ZiAoc2MtPnNjX2lyZXMgPT0gTlVMTCkgewogCQkvKiBYWFggbm8gaW50ZXJydXB0IHJlc291cmNl
 LiBGb3JjZSBwb2xsZWQgbW9kZS4gKi8KIAkJc2MtPnNjX3BvbGxlZCA9IDE7Cg==
 --e89a8f23579dd5bd6f04c198c9b8--

From: Poul-Henning Kamp <phk@phk.freebsd.dk>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: kern/166805: Winbond W83627DHG-P serial console hang
Date: Thu, 14 Jun 2012 08:26:07 +0000

 Just a note to say that I'm seeing this too.
 
 -- 
 Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
 phk@FreeBSD.ORG         | TCP/IP since RFC 956
 FreeBSD committer       | BSD since 4.3-tahoe
 Never attribute to malice what can adequately be explained by incompetence.

From: Oleg Yurkivskyy <oleg@realnet.com.ua>
To: bug-followup@FreeBSD.org, yoitsmeremember@gmail.com
Cc:  
Subject: Re: kern/166805: Winbond W83627DHG-P serial console hang
Date: Fri, 15 Mar 2013 12:48:01 +0200

 This is a multi-part message in MIME format.
 --------------060200040905000701040504
 Content-Type: text/plain; charset=UTF-8; format=flowed
 Content-Transfer-Encoding: 7bit
 
 There is a workaround for this problem.
 Just add
 
 hint.apic.0.disabled="1"
 
 into /boot/device.hints or /boot/loader.conf in order to disable APIC 
 support (see man apic) and enable legacy PIC driver.
 
 The problem itself has something to do with invalid interrupt config on 
 Intel D2500CC (or similar).
 Legacy atpic driver just ignores incorrect settings for interrupt 
 handling (
 
 trig  ==  INTR_TRIGGER_EDGE  &&  pol  ==  INTR_POLARITY_LOW)  ||   (trig  ==  INTR_TRIGGER_LEVEL  &&  pol  ==  INTR_POLARITY_HIGH
 
 )
 
 while apic forcing these incorrect settings, resulting interrupts not 
 being handled properly.
 
 --------------060200040905000701040504--
>Unformatted:
