Re: [PATCH] USB: ftdi_sio: revert "USB: ftdi_sio: fix DTR/RTS line modes"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Forgot to CC linux-usb. Sorry about that.

On Sun, Sep 12, 2010 at 04:31:45PM +0200, Johan Hovold wrote:
> This reverts commit 6a1a82df91fa0eb1cc76069a9efe5714d087eccd.
> 
> RTS and DTR should not be modified based on CRTSCTS when calling
> set_termios.
> 
> Modem control lines are raised at port open by the tty layer and should stay
> raised regardless of whether hardware flow control is enabled or not.
> 
> This is in conformance with the way serial ports work today and many
> applications depend on this behaviour to be able to talk to hardware
> implementing hardware flow control (without the applications actually using
> it).
> 
> Hardware which expects different behaviour on these lines can always
> use TIOCMSET/TIOCMBI[SC] after port open to change them.
> 
> Signed-off-by: Johan Hovold <jhovold@xxxxxxxxx>
> Cc: stable <stable@xxxxxxxxxx>
> ---
> 
> Hi, 
> 
> We have had numerous reports of broken applications due to the patch mentioned
> above, and earlier this week I was bitten by this regression myself when
> updating one of our production machines.
> 
> RTS and DTR should definitely not be _cleared_ by the driver if CRTSCTS is not
> set. That is simply a bug (just consider an application using RTS/DTR for whatever
> purpose other than flow control).
> 
> One could perhaps argue that the tty layer should honour the (previous) termios
> settings at open and only _raise_ RTS if hardware flow control is enabled, but
> then the fix lies elsewhere (and this is likely to cause even more regressions
> as it affects all drivers implementing raise_dtr_rts).
> 
> Applications talking to hardware using non-standard semantics for RTS/DTR can
> simply clear these signals after open for now.
> 
> Thanks,
> Johan
> 
> 
> drivers/usb/serial/ftdi_sio.c |    4 ----
>  1 files changed, 0 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
> index 63ddb2f..6771dfb 100644
> --- a/drivers/usb/serial/ftdi_sio.c
> +++ b/drivers/usb/serial/ftdi_sio.c
> @@ -2020,8 +2020,6 @@ static void ftdi_set_termios(struct tty_struct *tty,
>  				"urb failed to set to rts/cts flow control\n");
>  		}
>  
> -		/* raise DTR/RTS */
> -		set_mctrl(port, TIOCM_DTR | TIOCM_RTS);
>  	} else {
>  		/*
>  		 * Xon/Xoff code
> @@ -2069,8 +2067,6 @@ static void ftdi_set_termios(struct tty_struct *tty,
>  			}
>  		}
>  
> -		/* lower DTR/RTS */
> -		clear_mctrl(port, TIOCM_DTR | TIOCM_RTS);
>  	}
>  	return;
>  }
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux