From aphor@horizon.aphor.net  Fri Mar  2 05:34:30 2007
Return-Path: <aphor@horizon.aphor.net>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 43C7616A401
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  2 Mar 2007 05:34:30 +0000 (UTC)
	(envelope-from aphor@horizon.aphor.net)
Received: from horizon.aphor.net (dsl092-135-118.chi1.dsl.speakeasy.net [66.92.135.118])
	by mx1.freebsd.org (Postfix) with ESMTP id CE7C313C478
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  2 Mar 2007 05:34:29 +0000 (UTC)
	(envelope-from aphor@horizon.aphor.net)
Received: from horizon.aphor.net (localhost [127.0.0.1])
	by horizon.aphor.net (8.13.8/8.13.8) with ESMTP id l2256Ct1024041
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 1 Mar 2007 23:06:12 -0600 (CST)
	(envelope-from aphor@horizon.aphor.net)
Received: (from root@localhost)
	by horizon.aphor.net (8.13.8/8.13.8/Submit) id l2256C8Z024040;
	Thu, 1 Mar 2007 23:06:12 -0600 (CST)
	(envelope-from aphor)
Message-Id: <200703020506.l2256C8Z024040@horizon.aphor.net>
Date: Thu, 1 Mar 2007 23:06:12 -0600 (CST)
From: Jeremy McMillan <aphor@mac.com>
Reply-To: Jeremy McMillan <aphor@mac.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: The sio(4) driver appears to be getting the serial port speed multiplier bits wrong.
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         109743
>Category:       kern
>Synopsis:       [sio] The sio(4) driver appears to be getting the serial port speed multiplier bits wrong.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Mar 02 05:40:04 GMT 2007
>Closed-Date:    
>Last-Modified:  Sun Apr 22 09:45:56 GMT 2007
>Originator:     
>Release:        FreeBSD 6.2-STABLE i386
>Organization:
>Environment:
 >System: FreeBSD horizon.aphor.net 6.2-STABLE FreeBSD 6.2-STABLE #53: Tue Feb 27 22:37:03 CST 2007 root@horizon.aphor.net:/usr/obj/usr/src/sys/ATHLON i386
 
 Vintage FIC SD11 Athlon Slot-A PC motherboard.
>Description:
Serial port settings via sofware are not effective on the hardware device.
This *used* to work, but I can't remember when I had to change the batteries
last ... probably 18-24 months ago. Ancient history, but my point is that
the hardware hasn't changed.

The behavior is identical using puc(4) ports and built-in serial port at
sio0, so it doesn't appear to be puc(4) or shady cheap hardware at fault.
Maybe it's ACPI bugs?

- dmesg -
puc0: NetMos NM9835 Dual UART and 1284 Printer port port 0xd400-0xd407,0xd000-0xd007,0xcc00-0xcc07,0xc800-0xc807,0xc400-0xc407,0xc000-0xc00f irq 10 at device 4.0 on pci0
sio4: NetMos NM9835 Dual UART and 1284 Printer port on puc0
sio4: type 16550A
sio4: unable to activate interrupt in fast mode - using normal mode
sio5: NetMos NM9835 Dual UART and 1284 Printer port> on puc0
sio5: type 16550A
sio5: unable to activate interrupt in fast mode - using normal mode
sio0: 16550A-compatible COM port port 0x3f8-0x3ff irq 4 flags 0x30 on acpi0
sio0: type 16550A, console

>How-To-Repeat:
I discovered this trying to get my puc(4) serial ports wired to my APC
SmartUPS. I got frustrated and broke out my null-modem cable. When I set
up the serial port in /etc/ttys as root autologin, I can get a shell via
the serial port at 9600 baud despite the 2400 baud gettytab entry on the
/etc/ttys line for that port. When I type 'stty speed 9600' in that
prompt across the serial line, I get garbage until I switch to 38400
baud. When I stty to 600, I can communicate at 2400.
>Fix:
Get two PCs and hook up a serial debugger on one port and another null
modem cable on the other.

Observe the bit-twiddling on the subject kernel's second serial port via
debugger on the first port as stty does its ioctl(2) magic. Marvel at the
layers of abstraction that must be penetrated to understand what went
wrong. Read more code than you want to. Please?

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: brooks 
State-Changed-When: Mon Mar 26 15:49:20 UTC 2007 
State-Changed-Why:  
The PR database can not support confidential problem reports.  Please 
submit without this setting. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=109743 
State-Changed-From-To: closed->open 
State-Changed-By: brooks 
State-Changed-When: Tue Mar 27 04:09:41 UTC 2007 
State-Changed-Why:  
Re-open and strip the bogus confidential bit. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=109743 
>Unformatted:
