diff options
| author | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-02 16:47:04 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-02 16:47:04 -0700 |
| commit | 24ec1fda011aeaad77e34172651892e704c1076e (patch) | |
| tree | 9ffb519b3af6b32842a59ce2ef10051426b2aeb1 /tty | |
| parent | 3e04eb00f19d12ec07922e9a32f049e046f3db4b (diff) | |
| download | patches-24ec1fda011aeaad77e34172651892e704c1076e.tar.gz | |
more patches
Diffstat (limited to 'tty')
| -rw-r--r-- | tty/char-nozomi-fix-tty-count-counting.patch | 34 | ||||
| -rw-r--r-- | tty/char-nozomi-set-tty-driver_data-appropriately.patch | 62 | ||||
| -rw-r--r-- | tty/serial-max3107-fix-gpiolib-support.patch | 30 | ||||
| -rw-r--r-- | tty/u6715-16550a-serial-driver-support.patch | 169 |
4 files changed, 295 insertions, 0 deletions
diff --git a/tty/char-nozomi-fix-tty-count-counting.patch b/tty/char-nozomi-fix-tty-count-counting.patch new file mode 100644 index 00000000000000..43468a9b7f7610 --- /dev/null +++ b/tty/char-nozomi-fix-tty-count-counting.patch @@ -0,0 +1,34 @@ +From jslaby@suse.cz Mon Aug 2 16:02:43 2010 +From: Jiri Slaby <jslaby@suse.cz> +To: gregkh@suse.de +Cc: jirislaby@gmail.com, linux-kernel@vger.kernel.org, + Jiri Slaby <jslaby@suse.cz>, Alan Cox <alan@linux.intel.com> +Subject: Char: nozomi, fix tty->count counting +Date: Thu, 29 Jul 2010 11:09:47 +0200 +Message-Id: <1280394587-31670-1-git-send-email-jslaby@suse.cz> + +Currently ntty_install omits to increment tty count and we get the +following warnings: +Warning: dev (noz2) tty->count(0) != #fd's(1) in tty_open + +So to fix that, add one tty->count++ there. + +Signed-off-by: Jiri Slaby <jslaby@suse.cz> +Cc: Alan Cox <alan@linux.intel.com> +Cc: stable <stable@kernel.org> [.34, .35] +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/char/nozomi.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/char/nozomi.c ++++ b/drivers/char/nozomi.c +@@ -1611,6 +1611,7 @@ static int ntty_install(struct tty_drive + ret = tty_init_termios(tty); + if (ret == 0) { + tty_driver_kref_get(driver); ++ tty->count++; + driver->ttys[tty->index] = tty; + } + return ret; diff --git a/tty/char-nozomi-set-tty-driver_data-appropriately.patch b/tty/char-nozomi-set-tty-driver_data-appropriately.patch new file mode 100644 index 00000000000000..ad809a039c1d90 --- /dev/null +++ b/tty/char-nozomi-set-tty-driver_data-appropriately.patch @@ -0,0 +1,62 @@ +From jslaby@suse.cz Mon Aug 2 16:03:19 2010 +From: Jiri Slaby <jslaby@suse.cz> +To: gregkh@suse.de +Cc: jirislaby@gmail.com, linux-kernel@vger.kernel.org, + Jiri Slaby <jslaby@suse.cz>, Alan Cox <alan@linux.intel.com> +Subject: [PATCH 1/1] Char: nozomi, set tty->driver_data appropriately +Date: Thu, 29 Jul 2010 11:46:32 +0200 +Message-Id: <1280396792-32060-1-git-send-email-jslaby@suse.cz> + +Sorry, one more fix, this one depends on the other, so this is rather 2/2. +-- + +tty->driver_data is used all over the code, but never set. This +results in oopses like: +BUG: unable to handle kernel NULL pointer dereference at 0000000000000130 +IP: [<ffffffff814a0040>] mutex_lock+0x10/0x40 +... +Pid: 2157, comm: modem-manager Not tainted 2.6.34.1-0.1-desktop #1 2768DR7/2768DR7 +RIP: 0010:[<ffffffff814a0040>] [<ffffffff814a0040>] mutex_lock+0x10/0x40 +RSP: 0018:ffff88007b16fa50 EFLAGS: 00010286 +RAX: 0000000000000000 RBX: 0000000000000130 RCX: 0000000000000003 +RDX: 0000000000000003 RSI: 0000000000000286 RDI: 0000000000000130 +RBP: 0000000000001000 R08: 0000000000000000 R09: 0000000000000000 +R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000130 +R13: 0000000000000001 R14: 0000000000000000 R15: ffff88007b16feb4 +... +Call Trace: + [<ffffffffa077690d>] ntty_write_room+0x4d/0x90 [nozomi] +... + +Set tty->driver_data to the computed port in .install to not recompute it in +every place where needed. Switch .open to use driver_data too. + +Signed-off-by: Jiri Slaby <jslaby@suse.cz> +Cc: Alan Cox <alan@linux.intel.com> +Cc: stable <stable@kernel.org> [.34, .35] +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + + +--- + drivers/char/nozomi.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/char/nozomi.c ++++ b/drivers/char/nozomi.c +@@ -1612,6 +1612,7 @@ static int ntty_install(struct tty_drive + if (ret == 0) { + tty_driver_kref_get(driver); + tty->count++; ++ tty->driver_data = port; + driver->ttys[tty->index] = tty; + } + return ret; +@@ -1640,7 +1641,7 @@ static int ntty_activate(struct tty_port + + static int ntty_open(struct tty_struct *tty, struct file *filp) + { +- struct port *port = get_port_by_tty(tty); ++ struct port *port = tty->driver_data; + return tty_port_open(&port->port, tty, filp); + } + diff --git a/tty/serial-max3107-fix-gpiolib-support.patch b/tty/serial-max3107-fix-gpiolib-support.patch new file mode 100644 index 00000000000000..cab4baeaacefc5 --- /dev/null +++ b/tty/serial-max3107-fix-gpiolib-support.patch @@ -0,0 +1,30 @@ +From alan@linux.intel.com Tue Jul 27 10:12:52 2010 +From: Alan Cox <alan@linux.intel.com> +Subject: serial: max3107: Fix gpiolib support +To: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, greg@kroah.com +Date: Tue, 27 Jul 2010 08:16:05 +0100 +Message-ID: <20100727071551.25761.146.stgit@localhost.localdomain> + +Because of the way gpiolib works we actually need to ifdef this in our +header file + +Signed-off-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/serial/max3107.h | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/serial/max3107.h ++++ b/drivers/serial/max3107.h +@@ -368,8 +368,10 @@ struct max3107_port { + /* SPI device structure */ + struct spi_device *spi; + ++#if defined(CONFIG_GPIOLIB) + /* GPIO chip stucture */ + struct gpio_chip chip; ++#endif + + /* Workqueue that does all the magic */ + struct workqueue_struct *workqueue; diff --git a/tty/u6715-16550a-serial-driver-support.patch b/tty/u6715-16550a-serial-driver-support.patch new file mode 100644 index 00000000000000..6208e0d5e5f2f8 --- /dev/null +++ b/tty/u6715-16550a-serial-driver-support.patch @@ -0,0 +1,169 @@ +From philippe.langlais@stericsson.com Mon Aug 2 16:04:14 2010 +From: Philippe Langlais <philippe.langlais@stericsson.com> +Cc: <alan@lxorguk.ukuu.org.uk>, <gregkh@suse.de>, + <ludovic.barre@stericsson.com>, <vincent.guittot@stericsson.com>, + Philippe Langlais <philippe.langlais@stericsson.com> +Subject: U6715 16550A serial driver support +Date: Thu, 29 Jul 2010 17:13:57 +0200 +Message-ID: <1280416437-25364-1-git-send-email-philippe.langlais@stericsson.com> + +UART Features extract from STEricsson U6715 data-sheet (arm926 SoC for mobile phone): +* Fully compatible with industry standard 16C550 and 16C450 from various +manufacturers +* RX and TX 64 byte FIFO reduces CPU interrupts +* Full double buffering +* Modem control signals include CTS, RTS, (and DSR, DTR on UART1 only) +* Automatic baud rate selection +* Manual or automatic RTS/CTS smart hardware flow control +* Programmable serial characteristics: +– Baud rate generation (50 to 3.25M baud) +– 5, 6, 7 or 8-bit characters +– Even, odd or no-parity bit generation and detection +– 1, 1.5 or 2 stop bit generation +* Independent control of transmit, receive, line status, data set interrupts and FIFOs +* Full status-reporting capabilities +* Separate DMA signaling for RX and TX +* Timed interrupt to spread receive interrupt on known duration +* DMA time-out interrupt to allow detection of end of reception +* Carkit pulse coding and decoding compliant with USB carkit control interface [40] + +In 16550A auto-configuration, if the fifo size is 64 then it's an U6 16550A port +Add set_termios hook & export serial8250_do_set_termios to change uart +clock following baudrate + +Signed-off-by: Philippe Langlais <philippe.langlais@stericsson.com> +Acked-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/serial/8250.c | 37 ++++++++++++++++++++++++++++++++++--- + include/linux/serial.h | 3 ++- + include/linux/serial_8250.h | 5 +++++ + include/linux/serial_core.h | 3 +++ + 4 files changed, 44 insertions(+), 4 deletions(-) + +--- a/drivers/serial/8250.c ++++ b/drivers/serial/8250.c +@@ -300,6 +300,13 @@ static const struct serial8250_config ua + .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_00, + .flags = UART_CAP_FIFO | UART_CAP_AFE, + }, ++ [PORT_U6_16550A] = { ++ .name = "U6_16550A", ++ .fifo_size = 64, ++ .tx_loadsz = 64, ++ .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10, ++ .flags = UART_CAP_FIFO | UART_CAP_AFE, ++ }, + }; + + #if defined (CONFIG_SERIAL_8250_AU1X00) +@@ -1075,6 +1082,15 @@ static void autoconfig_16550a(struct uar + DEBUG_AUTOCONF("Couldn't force IER_UUE to 0 "); + } + serial_outp(up, UART_IER, iersave); ++ ++ /* ++ * We distinguish between 16550A and U6 16550A by counting ++ * how many bytes are in the FIFO. ++ */ ++ if (up->port.type == PORT_16550A && size_fifo(up) == 64) { ++ up->port.type = PORT_U6_16550A; ++ up->capabilities |= UART_CAP_AFE; ++ } + } + + /* +@@ -2229,9 +2245,9 @@ static unsigned int serial8250_get_divis + return quot; + } + +-static void +-serial8250_set_termios(struct uart_port *port, struct ktermios *termios, +- struct ktermios *old) ++void ++serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios, ++ struct ktermios *old) + { + struct uart_8250_port *up = (struct uart_8250_port *)port; + unsigned char cval, fcr = 0; +@@ -2407,6 +2423,17 @@ serial8250_set_termios(struct uart_port + if (tty_termios_baud_rate(termios)) + tty_termios_encode_baud_rate(termios, baud, baud); + } ++EXPORT_SYMBOL(serial8250_do_set_termios); ++ ++static void ++serial8250_set_termios(struct uart_port *port, struct ktermios *termios, ++ struct ktermios *old) ++{ ++ if (port->set_termios) ++ port->set_termios(port, termios, old); ++ else ++ serial8250_do_set_termios(port, termios, old); ++} + + static void + serial8250_set_ldisc(struct uart_port *port, int new) +@@ -2989,6 +3016,7 @@ static int __devinit serial8250_probe(st + port.type = p->type; + port.serial_in = p->serial_in; + port.serial_out = p->serial_out; ++ port.set_termios = p->set_termios; + port.dev = &dev->dev; + port.irqflags |= irqflag; + ret = serial8250_register_port(&port); +@@ -3152,6 +3180,9 @@ int serial8250_register_port(struct uart + uart->port.serial_in = port->serial_in; + if (port->serial_out) + uart->port.serial_out = port->serial_out; ++ /* Possibly override set_termios call */ ++ if (port->set_termios) ++ uart->port.set_termios = port->set_termios; + + ret = uart_add_one_port(&serial8250_reg, &uart->port); + if (ret == 0) +--- a/include/linux/serial.h ++++ b/include/linux/serial.h +@@ -77,7 +77,8 @@ struct serial_struct { + #define PORT_16654 11 + #define PORT_16850 12 + #define PORT_RSA 13 /* RSA-DV II/S card */ +-#define PORT_MAX 13 ++#define PORT_U6_16550A 14 ++#define PORT_MAX 14 + + #define SERIAL_IO_PORT 0 + #define SERIAL_IO_HUB6 1 +--- a/include/linux/serial_8250.h ++++ b/include/linux/serial_8250.h +@@ -32,6 +32,9 @@ struct plat_serial8250_port { + unsigned int type; /* If UPF_FIXED_TYPE */ + unsigned int (*serial_in)(struct uart_port *, int); + void (*serial_out)(struct uart_port *, int, int); ++ void (*set_termios)(struct uart_port *, ++ struct ktermios *new, ++ struct ktermios *old); + }; + + /* +@@ -71,5 +74,7 @@ extern int early_serial_setup(struct uar + extern int serial8250_find_port(struct uart_port *p); + extern int serial8250_find_port_for_earlycon(void); + extern int setup_early_serial8250_console(char *cmdline); ++extern void serial8250_do_set_termios(struct uart_port *port, ++ struct ktermios *termios, struct ktermios *old); + + #endif +--- a/include/linux/serial_core.h ++++ b/include/linux/serial_core.h +@@ -282,6 +282,9 @@ struct uart_port { + unsigned char __iomem *membase; /* read/write[bwl] */ + unsigned int (*serial_in)(struct uart_port *, int); + void (*serial_out)(struct uart_port *, int, int); ++ void (*set_termios)(struct uart_port *, ++ struct ktermios *new, ++ struct ktermios *old); + unsigned int irq; /* irq number */ + unsigned long irqflags; /* irq flags */ + unsigned int uartclk; /* base uart clock */ |
