From nobody@FreeBSD.org  Fri Mar 12 15:16:22 2010
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 861D4106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 12 Mar 2010 15:16:22 +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 748BE8FC13
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 12 Mar 2010 15:16:22 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o2CFGMYc002634
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 12 Mar 2010 15:16:22 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o2CFGMKu002632;
	Fri, 12 Mar 2010 15:16:22 GMT
	(envelope-from nobody)
Message-Id: <201003121516.o2CFGMKu002632@www.freebsd.org>
Date: Fri, 12 Mar 2010 15:16:22 GMT
From: Uniballer <nobody@igetenoughspamthanku.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: tcdrain(3) does not work right with uart(4) driver
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         144696
>Category:       kern
>Synopsis:       [uart] tcdrain(3) does not work right with uart(4) driver
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    ed
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Mar 12 15:20:01 UTC 2010
>Closed-Date:    
>Last-Modified:  Mon Jan 24 19:50:41 UTC 2011
>Originator:     Uniballer
>Release:        8.0-RELEASE-p2
>Organization:
>Environment:
FreeBSD ????.xxxx.com 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 #0: Tue Jan  5 16:02:27 UTC 2010     root@i386-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  i386

>Description:
tcdrain(3) does not wait for serial output to complete when used with the uart(4) driver.  This worked correctly on 6.4 and 7.x with the sio(4) driver.

>How-To-Repeat:
Loop back a serial port, write a long buffer to it, then call tcdrain(3) to wait for output to complete, and call tcflush(3) to get rid of the data.  A subsequent read will show that part of the data is in the receive buffer, probably because it was received after tcflush(3) was called because tcdrain(3) was called early.

See http://forums.freebsd.org/showthread.php?t=12154 for more info and sample code.

>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->ed 
Responsible-Changed-By: marcel 
Responsible-Changed-When: Mon Jan 24 19:49:24 UTC 2011 
Responsible-Changed-Why:  
Ed, 
Can you do a quick triage to see if there's a problem in the TTY layer? 
Thanks, 


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