]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
UBUNTU: SAUCE: xr-usb-serial: re-initialise baudrate after resume from S3/S4
authorShrirang Bagul <shrirang.bagul@canonical.com>
Wed, 19 Feb 2020 04:38:03 +0000 (12:38 +0800)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 11 Mar 2020 05:01:45 +0000 (01:01 -0400)
BugLink: https://bugs.launchpad.net/bugs/1863834
The XR21V1412 ports were using the hardware power-on default of 9600bps
after resume from S3/S4. This patch re-initialises the baud rate and
fixes the re-connection issues after S3/S4.

Changelog:
Version 1B, 11/6/2015
Fixed Bug: The conditional logic to support kernel 3.9 was incorrect(line 396 in xr_usb_serial_common.c).

Version 1A, 1/9/2015
This driver will work with any USB UART function in these Exar devices:
        XR21V1410/1412/1414
        XR21B1411
        XR21B1420/1422/1424
        XR22801/802/804

The source code has been tested on various Linux kernels from 3.6.x to 3.17.x.
This may also work with newer kernels as well.

buglink: http://bugs.launchpad.net/bugs/1690362
Signed-off-by: Shrirang Bagul <shrirang.bagul@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Timo Aaltonen <timo.aaltonen@canonical.com>
(cherry picked from commit 39f69345fca1f14e1e27875b83f87a6067c36fbb)
(source tag: Ubuntu-oem-4.15.0-1073.83)
Signed-off-by: Shrirang Bagul <shrirang.bagul@canonical.com>
Acked-by: Kleber Souza <kleber.souza@canonical.com>
Acked-by: Wen-chien Jesse Sung <jesse.sung@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
ubuntu/xr-usb-serial/Makefile
ubuntu/xr-usb-serial/xr_usb_serial_common.c

index 1a323a62b3484f86a452b58ae0fca67b8e869753..533988cede120cda41a347a84dd50ca54a904e79 100644 (file)
@@ -1,6 +1,7 @@
 obj-m := xr_usb_serial_common.o
 
-KERNELDIR ?= /lib/modules/$(shell uname -r)/build
+#KERNELDIR ?= /lib/modules/$(shell uname -r)/build
+KERNELDIR ?=$(shell pwd)/../parts/kernel/build
 PWD       := $(shell pwd)
 
 EXTRA_CFLAGS   := -DDEBUG=0
index 5d049855fb1a1dbed4e7bcb1d19b0d42e4792a47..09d21e63606e007613391ae3f91285b9bc903b45 100644 (file)
@@ -1146,7 +1146,7 @@ static void xr_usb_serial_tty_set_termios(struct tty_struct *tty,
     }
 
                
-       if (memcmp(&xr_usb_serial->line, &newline, sizeof newline))
+       //if (memcmp(&xr_usb_serial->line, &newline, sizeof newline))
        {
                memcpy(&xr_usb_serial->line, &newline, sizeof newline);
                /*
@@ -1819,11 +1819,21 @@ static int xr_usb_serial_resume(struct usb_interface *intf)
 {
        struct xr_usb_serial *xr_usb_serial = usb_get_intfdata(intf);
        struct xr_usb_serial_wb *wb;
+#if 0  
+       struct tty_struct *tty = xr_usb_serial->port.tty;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 7, 0)       
+       struct ktermios *termios = tty->termios;
+#else
+    struct ktermios *termios = &tty->termios;
+#endif
+#endif
        int rv = 0;
        int cnt;
             
        xr_usb_serial_pre_setup(xr_usb_serial);
-       
+       xr_usb_serial_disable(xr_usb_serial);
+       xr_usb_serial_set_line(xr_usb_serial, &xr_usb_serial->line);
+       xr_usb_serial_enable(xr_usb_serial);    
        spin_lock_irq(&xr_usb_serial->read_lock);
        xr_usb_serial->susp_count -= 1;
        cnt = xr_usb_serial->susp_count;