0001-usb-serial-gadget-no-TTY-hangup-on-USB-disconnect-WI.patch 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. From 716120e8010a7f400c6bed7384000e95e1465c94 Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= <kyosti.malkki@gmail.com>
  3. Date: Mon, 26 Aug 2013 19:19:44 +0300
  4. Subject: [PATCH 1/2] usb serial gadget: no TTY hangup on USB disconnect [WIP]
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. We may want to maintain the TTY over USB disconnects.
  9. This is useful when we have a terminal console to a host which
  10. power-cycles or for other reasons resets the USB host controller.
  11. Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
  12. ---
  13. drivers/usb/gadget/function/u_serial.c | 5 +++++
  14. 1 file changed, 5 insertions(+)
  15. diff --git a/drivers/usb/gadget/function/u_serial.c b/drivers/usb/gadget/function/u_serial.c
  16. index b369292..d156a28 100644
  17. --- a/drivers/usb/gadget/function/u_serial.c
  18. +++ b/drivers/usb/gadget/function/u_serial.c
  19. @@ -1258,8 +1258,13 @@ void gserial_disconnect(struct gserial *gser)
  20. gser->ioport = NULL;
  21. if (port->port.count > 0 || port->openclose) {
  22. wake_up_interruptible(&port->drain_wait);
  23. +#if 0
  24. if (port->port.tty)
  25. tty_hangup(port->port.tty);
  26. +#else
  27. + if (port->port.tty)
  28. + stop_tty(port->port.tty);
  29. +#endif
  30. }
  31. spin_unlock_irqrestore(&port->port_lock, flags);
  32. --
  33. 1.8.1.1