From rmgls@orange.fr  Sat Feb 24 16:44:11 2007
Return-Path: <rmgls@orange.fr>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id AF05116A400
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 24 Feb 2007 16:44:11 +0000 (UTC)
	(envelope-from rmgls@orange.fr)
Received: from smtp25.orange.fr (smtp25.orange.fr [193.252.22.24])
	by mx1.freebsd.org (Postfix) with ESMTP id 3612413C467
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 24 Feb 2007 16:44:08 +0000 (UTC)
	(envelope-from rmgls@orange.fr)
Received: from smtp25.orange.fr (mwinf2553 [10.232.9.161])
	by mwinf2505.orange.fr (SMTP Server) with ESMTP id 2A6A71C00BF8
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 24 Feb 2007 17:23:13 +0100 (CET)
Received: from me-wanadoo.net (localhost [127.0.0.1])
	by mwinf2553.orange.fr (SMTP Server) with ESMTP id A72DA1C000A1
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 24 Feb 2007 17:23:11 +0100 (CET)
Received: from orange.fr (ARouen-156-1-73-7.w90-8.abo.wanadoo.fr [90.8.96.7])
	by mwinf2553.orange.fr (SMTP Server) with ESMTP id D01ED1C0009D
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 24 Feb 2007 17:23:10 +0100 (CET)
Message-Id: <20070224162310.D01ED1C0009D@mwinf2553.orange.fr>
Date: Sat, 24 Feb 2007 17:23:08 +0100
From: rmgls@wanadoo.fr
Sender: rmgls@orange.fr
To: FreeBSD-gnats-submit@freebsd.org
Subject: uart speed

>Number:         109490
>Category:       bin
>Synopsis:       stty(1): setting the sio or uart speed does not work
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Feb 24 16:50:05 GMT 2007
>Closed-Date:    Wed Apr 11 07:44:06 GMT 2007
>Last-Modified:  Wed Apr 11 07:44:06 GMT 2007
>Originator:     raoul megelas
>Release:        FreeBSD 7.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD port.private.music 7.0-CURRENT FreeBSD 7.0-CURRENT SAt Feb 24 2007 root@bip.private.music:/usr/obj/usr/src/sys/GENERIC i386

>Description:

hello,

some mounths ago i noticed that stty does not set any parameters.
i do not reported that because i wanted to be sure and trace at least
the stty part.
It appears there is something wrong in the ioctl (not the parameters!).

the machine: i386 sony s5 vaio laptop,
with two external usb=>serial which work quite well except this point,
(under Win or debian, i can change the speed)
ane a serial pccard who worked quite well.

i run current from this day:
sat 24, Feb 2007.

I suspect the syscall, but i don't know how to trace a syscall
(yes! what a stupid newbie).

the problem is easily reproducible here:

stty -f /dev/cuau0
9600
stty -f /dev/cuau0 speed 38400
9600


stty -f /dev/ttyu0
9600
stty -f /dev/ttyu0 speed 38400
9600


stty -f /dev/cuaU0
9600
stty -f /dev/cuaU0 speed 38400
9600
now the relevant part of gdb session:

gdb stty

GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd"...
(gdb) set args -f /dev/cuau0 speed 19200
(gdb) b main
Breakpoint 1 at 0x804a009: file /usr/src/bin/stty/stty.c, line 60.
(gdb) r
Starting program: /usr/obj/usr/src/bin/stty/stty -f /dev/cuau0 speed 19200

Breakpoint 1, main (argc=5, argv=0xbfbfe844) at /usr/src/bin/stty/stty.c:60
60	{
(gdb) b 149
Breakpoint 2 at 0x804a194: file /usr/src/bin/stty/stty.c, line 149.
(gdb) c
Continuing.

Breakpoint 2, main (argc=5, argv=0xbfbfe858) at /usr/src/bin/stty/stty.c:149
149		if (i.wset && ioctl(i.fd, TIOCSWINSZ, &i.win) < 0)
(gdb) l s
151		exit(0);
(gdb) p i
$1 = {fd = 3, ldisc = 0, off = 0, set = 1, wset = 0, 
  arg = 0xbfbfe7e4 "\230\032\005(\b迿\005", t = {c_iflag = 11010, 
    c_oflag = 3, c_cflag = 19200, c_lflag = 1408, 
    c_cc = "\004\177\027\025\022\b\003\034\032\031\021\023\026\017\001\000\024", c_ispeed = 19200, c_ospeed = 19200}, win = {ws_row = 0, ws_col = 0, 
    ws_xpixel = 0, ws_ypixel = 0}}
(gdb) p i.win
$2 = {ws_row = 0, ws_col = 0, ws_xpixel = 0, ws_ypixel = 0}
(gdb) c
Continuing.
9600

Program exited normally.
(gdb) quit

Best regards.

rmgls

>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: gnats-admin->freebsd-bugs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sat Feb 24 20:03:57 UTC 2007 
Responsible-Changed-Why:  
Rescue this PR from the 'pending' category. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=109490 

From: "Andrew Pantyukhin" <infofarmer@FreeBSD.org>
To: bug-followup@FreeBSD.org, rmgls@wanadoo.fr
Cc:  
Subject: Re: bin/109490: stty(1): setting the sio or uart speed does not work
Date: Mon, 2 Apr 2007 11:30:45 +0400

 Please try:
 stty 0 < /dev/<whatever>.lock
 stty 57600 < /dev/<whatever>.init
 stty 57600 < /dev/<whatever>
 
 See sio(4) for more info on init/lock subdevs.
State-Changed-From-To: open->closed 
State-Changed-By: sat 
State-Changed-When: Wed Apr 11 07:42:45 UTC 2007 
State-Changed-Why:  
Submitter resolved the issue by unlocking device using 
lock subdevice. 

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