Skip to content

Commit

Permalink
USB: serial: ftdi_sio: fix setting latency for unprivileged users
Browse files Browse the repository at this point in the history
Commit 557aaa7 ("ft232: support the ASYNC_LOW_LATENCY
flag") enables unprivileged users to set the FTDI latency timer,
but there was a logic flaw that skipped sending the corresponding
USB control message to the device.

Specifically, the device latency timer would not be updated until next
open, something which was later also inadvertently broken by commit
c19db4c ("USB: ftdi_sio: set device latency timeout at port
probe").

A recent commit c6dce26 ("USB: serial: ftdi_sio: fix extreme
low-latency setting") disabled the low-latency mode by default so we now
need this fix to allow unprivileged users to again enable it.

Signed-off-by: Anthony Mallet <anthony.mallet@laas.fr>
[johan: amend commit message]
Fixes: 557aaa7 ("ft232: support the ASYNC_LOW_LATENCY flag")
Fixes: c19db4c ("USB: ftdi_sio: set device latency timeout at port probe").
Cc: stable <stable@vger.kernel.org>     # 2.6.31
Signed-off-by: Johan Hovold <johan@kernel.org>
  • Loading branch information
Anthony Mallet authored and Johan Hovold committed May 15, 2017
1 parent 40dd460 commit bb24668
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/serial/ftdi_sio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1527,9 +1527,9 @@ static int set_serial_info(struct tty_struct *tty,
(new_serial.flags & ASYNC_FLAGS));
priv->custom_divisor = new_serial.custom_divisor;

check_and_exit:
write_latency_timer(port);

check_and_exit:
if ((old_priv.flags & ASYNC_SPD_MASK) !=
(priv->flags & ASYNC_SPD_MASK)) {
if ((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI)
Expand Down

0 comments on commit bb24668

Please sign in to comment.