USB: serial: cp210x: enable usb generic throttle/unthrottle
authorBrant Merryman <brant.merryman@silabs.com>
Fri, 26 Jun 2020 04:22:58 +0000 (04:22 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Aug 2020 09:02:05 +0000 (11:02 +0200)
commit 4387b3dbb079d482d3c2b43a703ceed4dd27ed28 upstream.

Assign the .throttle and .unthrottle functions to be generic function
in the driver structure to prevent data loss that can otherwise occur
if the host does not enable USB throttling.

Signed-off-by: Brant Merryman <brant.merryman@silabs.com>
Co-developed-by: Phu Luu <phu.luu@silabs.com>
Signed-off-by: Phu Luu <phu.luu@silabs.com>
Link: https://lore.kernel.org/r/57401AF3-9961-461F-95E1-F8AFC2105F5E@silabs.com
[ johan: fix up tags ]
Fixes: 39a66b8d22a3 ("[PATCH] USB: CP2101 Add support for flow control")
Cc: stable <stable@vger.kernel.org> # 2.6.12
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/cp210x.c

index a075207..abf8a3c 100644 (file)
@@ -255,6 +255,8 @@ static struct usb_serial_driver cp210x_device = {
        .break_ctl              = cp210x_break_ctl,
        .set_termios            = cp210x_set_termios,
        .tx_empty               = cp210x_tx_empty,
+       .throttle               = usb_serial_generic_throttle,
+       .unthrottle             = usb_serial_generic_unthrottle,
        .tiocmget               = cp210x_tiocmget,
        .tiocmset               = cp210x_tiocmset,
        .port_probe             = cp210x_port_probe,