diff options
author | Johan Hovold <johan@kernel.org> | 2017-01-06 13:15:14 -0500 |
---|---|---|
committer | Johan Hovold <johan@kernel.org> | 2017-01-09 08:55:38 -0500 |
commit | ce5e292828117d1b71cbd3edf9e9137cf31acd30 (patch) | |
tree | 166a5fabbc2bbd48906e274cadcc31e6bd1fc271 /drivers/usb | |
parent | f2950b78547ffb8475297ada6b92bc2d774d5461 (diff) |
USB: serial: ch341: fix resume after reset
Fix reset-resume handling which failed to resubmit the read and
interrupt URBs, thereby leaving a port that was open before suspend in a
broken state until closed and reopened.
Fixes: 1ded7ea47b88 ("USB: ch341 serial: fix port number changed after
resume")
Fixes: 2bfd1c96a9fb ("USB: serial: ch341: remove reset_resume callback")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/serial/ch341.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c index 8f41d4385f1c..5343d65f3b52 100644 --- a/drivers/usb/serial/ch341.c +++ b/drivers/usb/serial/ch341.c | |||
@@ -582,14 +582,23 @@ static int ch341_tiocmget(struct tty_struct *tty) | |||
582 | 582 | ||
583 | static int ch341_reset_resume(struct usb_serial *serial) | 583 | static int ch341_reset_resume(struct usb_serial *serial) |
584 | { | 584 | { |
585 | struct ch341_private *priv; | 585 | struct usb_serial_port *port = serial->port[0]; |
586 | 586 | struct ch341_private *priv = usb_get_serial_port_data(port); | |
587 | priv = usb_get_serial_port_data(serial->port[0]); | 587 | int ret; |
588 | 588 | ||
589 | /* reconfigure ch341 serial port after bus-reset */ | 589 | /* reconfigure ch341 serial port after bus-reset */ |
590 | ch341_configure(serial->dev, priv); | 590 | ch341_configure(serial->dev, priv); |
591 | 591 | ||
592 | return 0; | 592 | if (tty_port_initialized(&port->port)) { |
593 | ret = usb_submit_urb(port->interrupt_in_urb, GFP_NOIO); | ||
594 | if (ret) { | ||
595 | dev_err(&port->dev, "failed to submit interrupt urb: %d\n", | ||
596 | ret); | ||
597 | return ret; | ||
598 | } | ||
599 | } | ||
600 | |||
601 | return usb_serial_generic_resume(serial); | ||
593 | } | 602 | } |
594 | 603 | ||
595 | static struct usb_serial_driver ch341_device = { | 604 | static struct usb_serial_driver ch341_device = { |