From owner-svn-src-stable-9@FreeBSD.ORG Mon Aug 20 14:56:44 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EDF341065674 for ; Mon, 20 Aug 2012 14:56:44 +0000 (UTC) (envelope-from freebsd@damnhippie.dyndns.org) Received: from qmta03.emeryville.ca.mail.comcast.net (qmta03.emeryville.ca.mail.comcast.net [76.96.30.32]) by mx1.freebsd.org (Postfix) with ESMTP id CD6738FC1D for ; Mon, 20 Aug 2012 14:56:41 +0000 (UTC) Received: from omta16.emeryville.ca.mail.comcast.net ([76.96.30.72]) by qmta03.emeryville.ca.mail.comcast.net with comcast id ozqZ1j0081ZMdJ4A32whZF; Mon, 20 Aug 2012 14:56:41 +0000 Received: from damnhippie.dyndns.org ([24.8.232.202]) by omta16.emeryville.ca.mail.comcast.net with comcast id p2wg1j0074NgCEG8c2wgXC; Mon, 20 Aug 2012 14:56:41 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id q7KEucgL021085; Mon, 20 Aug 2012 08:56:38 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) From: Ian Lepore To: Konstantin Belousov In-Reply-To: <201208201207.q7KC7Bnp031526@svn.freebsd.org> References: <201208201207.q7KC7Bnp031526@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Mon, 20 Aug 2012 08:56:38 -0600 Message-ID: <1345474598.27688.313.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org Subject: Re: svn commit: r239414 - stable/9/sys/kern X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2012 14:56:45 -0000 On Mon, 2012-08-20 at 12:07 +0000, Konstantin Belousov wrote: > Author: kib > Date: Mon Aug 20 12:07:10 2012 > New Revision: 239414 > URL: http://svn.freebsd.org/changeset/base/239414 > > Log: > MFC r232197 (on behalf of phk): > Also call the low-level driver if ->c_iflag & (IXON|IXOFF|IXANY) changes. > > Uftdi(4) examines (c_iflag & (IXON|IXOFF)) to control hw XON-XOFF support. > This is obviously no good, if changes to those bits are not communicated > down the stack. > > Modified: > stable/9/sys/kern/tty.c > Directory Properties: > stable/9/sys/ (props changed) > > Modified: stable/9/sys/kern/tty.c > ============================================================================== > --- stable/9/sys/kern/tty.c Mon Aug 20 11:51:49 2012 (r239413) > +++ stable/9/sys/kern/tty.c Mon Aug 20 12:07:10 2012 (r239414) > @@ -1498,6 +1498,8 @@ tty_generic_ioctl(struct tty *tp, u_long > */ > if ((t->c_cflag & CIGNORE) == 0 && > (tp->t_termios.c_cflag != t->c_cflag || > + ((tp->t_termios.c_iflag ^ t->c_iflag) & > + (IXON|IXOFF|IXANY)) || > tp->t_termios.c_ispeed != t->c_ispeed || > tp->t_termios.c_ospeed != t->c_ospeed)) { > error = ttydevsw_param(tp, t); I think this is the wrong fix for this problem. The correct fix is to get the uftdi driver and hardware out of the business of managing software flow control, because it cannot do so properly. For example, the hardware has no support for the concept of IXANY. Also, this change is insufficient for communicating changes of the VSTART and VSTOP chars to the hardware. When I was working on the uftdi driver recently I saw situations where the hardware and software (tty layer) got out of sync on the state of flow control when the driver/hardware were doing the XON/XOFF handling, locking up comms until the device was closed and reopened (and that may have un-wedged things primarily because the ftdi driver inappropriately does a reset of the hardware on open(2)). I have a large set of fixes and enhancements to the uftdi driver, I've just had too many irons in the fire recently to get them packaged up and submitted for review. I guess maybe it's time to get that done. -- Ian