--- /dev/null
+From 8d0c2d10dd72c5292eda7a06231056a4c972e4cc Mon Sep 17 00:00:00 2001
+From: Lars-Peter Clausen <lars@metafoo.de>
+Date: Sat, 9 Mar 2013 15:28:44 +0100
+Subject: ext3: Fix format string issues
+
+From: Lars-Peter Clausen <lars@metafoo.de>
+
+commit 8d0c2d10dd72c5292eda7a06231056a4c972e4cc upstream.
+
+ext3_msg() takes the printk prefix as the second parameter and the
+format string as the third parameter. Two callers of ext3_msg omit the
+prefix and pass the format string as the second parameter and the first
+parameter to the format string as the third parameter. In both cases
+this string comes from an arbitrary source. Which means the string may
+contain format string characters, which will
+lead to undefined and potentially harmful behavior.
+
+The issue was introduced in commit 4cf46b67eb("ext3: Unify log messages
+in ext3") and is fixed by this patch.
+
+Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
+Signed-off-by: Jan Kara <jack@suse.cz>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/ext3/super.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/fs/ext3/super.c
++++ b/fs/ext3/super.c
+@@ -353,7 +353,7 @@ static struct block_device *ext3_blkdev_
+ return bdev;
+
+ fail:
+- ext3_msg(sb, "error: failed to open journal device %s: %ld",
++ ext3_msg(sb, KERN_ERR, "error: failed to open journal device %s: %ld",
+ __bdevname(dev, b), PTR_ERR(bdev));
+
+ return NULL;
+@@ -887,7 +887,7 @@ static ext3_fsblk_t get_sb_block(void **
+ /*todo: use simple_strtoll with >32bit ext3 */
+ sb_block = simple_strtoul(options, &options, 0);
+ if (*options && *options != ',') {
+- ext3_msg(sb, "error: invalid sb specification: %s",
++ ext3_msg(sb, KERN_ERR, "error: invalid sb specification: %s",
+ (char *) *data);
+ return 1;
+ }
--- /dev/null
+From d13402a4a944e72612a9ec5c9190e35717c02a9d Mon Sep 17 00:00:00 2001
+From: Scott Ashcroft <scott.ashcroft@talk21.com>
+Date: Sun, 3 Mar 2013 21:35:06 +0000
+Subject: Fix 4 port and add support for 8 port 'Unknown' PCI serial port cards
+
+From: Scott Ashcroft <scott.ashcroft@talk21.com>
+
+commit d13402a4a944e72612a9ec5c9190e35717c02a9d upstream.
+
+I've managed to find an 8 port version of the card 4 port card which was discussed here:
+
+http://marc.info/?l=linux-serial&m=120760744205314&w=2
+
+Looking back at that thread there were two issues in the original patch.
+
+1) The I/O ports for the UARTs are within BAR2 not BAR0. This can been seen in the original post.
+2) A serial quirk isn't needed as these cards have no memory in BAR0 which makes pci_plx9050_init just return.
+
+This patch fixes the 4 port support to use BAR2, removes the bogus quirk and adds support for the 8 port card.
+
+$ lspci -vvv -n -s 00:08.0
+00:08.0 0780: 10b5:9050 (rev 01)
+ Subsystem: 10b5:1588
+ Control: I/O+ Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
+ Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
+ Interrupt: pin A routed to IRQ 17
+ Region 1: I/O ports at ff00 [size=128]
+ Region 2: I/O ports at fe00 [size=64]
+ Region 3: I/O ports at fd00 [size=8]
+ Capabilities: <access denied>
+ Kernel driver in use: serial
+
+$ dmesg | grep 0000:00:08.0:
+[ 0.083320] pci 0000:00:08.0: [10b5:9050] type 0 class 0x000780
+[ 0.083355] pci 0000:00:08.0: reg 14: [io 0xff00-0xff7f]
+[ 0.083369] pci 0000:00:08.0: reg 18: [io 0xfe00-0xfe3f]
+[ 0.083382] pci 0000:00:08.0: reg 1c: [io 0xfd00-0xfd07]
+[ 0.083460] pci 0000:00:08.0: PME# supported from D0 D3hot
+[ 1.212867] 0000:00:08.0: ttyS4 at I/O 0xfe00 (irq = 17) is a 16550A
+[ 1.233073] 0000:00:08.0: ttyS5 at I/O 0xfe08 (irq = 17) is a 16550A
+[ 1.253270] 0000:00:08.0: ttyS6 at I/O 0xfe10 (irq = 17) is a 16550A
+[ 1.273468] 0000:00:08.0: ttyS7 at I/O 0xfe18 (irq = 17) is a 16550A
+[ 1.293666] 0000:00:08.0: ttyS8 at I/O 0xfe20 (irq = 17) is a 16550A
+[ 1.313863] 0000:00:08.0: ttyS9 at I/O 0xfe28 (irq = 17) is a 16550A
+[ 1.334061] 0000:00:08.0: ttyS10 at I/O 0xfe30 (irq = 17) is a 16550A
+[ 1.354258] 0000:00:08.0: ttyS11 at I/O 0xfe38 (irq = 17) is a 16550A
+
+Signed-off-by: Scott Ashcroft <scott.ashcroft@talk21.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/tty/serial/8250/8250_pci.c | 17 +++++++----------
+ 1 file changed, 7 insertions(+), 10 deletions(-)
+
+--- a/drivers/tty/serial/8250/8250_pci.c
++++ b/drivers/tty/serial/8250/8250_pci.c
+@@ -1321,6 +1321,7 @@ pci_wch_ch353_setup(struct serial_privat
+
+ /* Unknown vendors/cards - this should not be in linux/pci_ids.h */
+ #define PCI_SUBDEVICE_ID_UNKNOWN_0x1584 0x1584
++#define PCI_SUBDEVICE_ID_UNKNOWN_0x1588 0x1588
+
+ /*
+ * Master list of serial port init/setup/exit quirks.
+@@ -1592,15 +1593,6 @@ static struct pci_serial_quirk pci_seria
+ },
+ {
+ .vendor = PCI_VENDOR_ID_PLX,
+- .device = PCI_DEVICE_ID_PLX_9050,
+- .subvendor = PCI_VENDOR_ID_PLX,
+- .subdevice = PCI_SUBDEVICE_ID_UNKNOWN_0x1584,
+- .init = pci_plx9050_init,
+- .setup = pci_default_setup,
+- .exit = pci_plx9050_exit,
+- },
+- {
+- .vendor = PCI_VENDOR_ID_PLX,
+ .device = PCI_DEVICE_ID_PLX_ROMULUS,
+ .subvendor = PCI_VENDOR_ID_PLX,
+ .subdevice = PCI_DEVICE_ID_PLX_ROMULUS,
+@@ -3456,7 +3448,12 @@ static struct pci_device_id serial_pci_t
+ { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
+ PCI_VENDOR_ID_PLX,
+ PCI_SUBDEVICE_ID_UNKNOWN_0x1584, 0, 0,
+- pbn_b0_4_115200 },
++ pbn_b2_4_115200 },
++ /* Unknown card - subdevice 0x1588 */
++ { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
++ PCI_VENDOR_ID_PLX,
++ PCI_SUBDEVICE_ID_UNKNOWN_0x1588, 0, 0,
++ pbn_b2_8_115200 },
+ { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
+ PCI_SUBVENDOR_ID_KEYSPAN,
+ PCI_SUBDEVICE_ID_KEYSPAN_SX2, 0, 0,
--- /dev/null
+From f2b8dfd9e480c3db3bad0c25c590a5d11b31f4ef Mon Sep 17 00:00:00 2001
+From: Josh Boyer <jwboyer@redhat.com>
+Date: Sun, 10 Mar 2013 10:33:40 -0400
+Subject: serial: 8250: Keep 8250.<xxxx> module options functional after driver rename
+
+From: Josh Boyer <jwboyer@redhat.com>
+
+commit f2b8dfd9e480c3db3bad0c25c590a5d11b31f4ef upstream.
+
+With commit 835d844d1 (8250_pnp: do pnp probe before legacy probe), the
+8250 driver was renamed to 8250_core. This means any existing usage of
+the 8259.<xxxx> module parameters or as a kernel command line switch is
+now broken, as the 8250_core driver doesn't parse options belonging to
+something called "8250".
+
+To solve this, we redefine the module options in a dummy function using
+a redefined MODULE_PARAM_PREFX when built into the kernel. In the case
+where we're building as a module, we provide an alias to the old 8250
+name. The dummy function prevents compiler errors due to global variable
+redefinitions that happen as part of the module_param_ macro expansions.
+
+Signed-off-by: Josh Boyer <jwboyer@redhat.com>
+Acked-by: Jiri Slaby <jslaby@suse.cz>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/tty/serial/8250/8250.c | 29 +++++++++++++++++++++++++++++
+ 1 file changed, 29 insertions(+)
+
+--- a/drivers/tty/serial/8250/8250.c
++++ b/drivers/tty/serial/8250/8250.c
+@@ -3430,3 +3430,32 @@ module_param_array(probe_rsa, ulong, &pr
+ MODULE_PARM_DESC(probe_rsa, "Probe I/O ports for RSA");
+ #endif
+ MODULE_ALIAS_CHARDEV_MAJOR(TTY_MAJOR);
++
++#ifndef MODULE
++/* This module was renamed to 8250_core in 3.7. Keep the old "8250" name
++ * working as well for the module options so we don't break people. We
++ * need to keep the names identical and the convenient macros will happily
++ * refuse to let us do that by failing the build with redefinition errors
++ * of global variables. So we stick them inside a dummy function to avoid
++ * those conflicts. The options still get parsed, and the redefined
++ * MODULE_PARAM_PREFIX lets us keep the "8250." syntax alive.
++ *
++ * This is hacky. I'm sorry.
++ */
++static void __used s8250_options(void)
++{
++#undef MODULE_PARAM_PREFIX
++#define MODULE_PARAM_PREFIX "8250."
++
++ module_param_cb(share_irqs, ¶m_ops_uint, &share_irqs, 0644);
++ module_param_cb(nr_uarts, ¶m_ops_uint, &nr_uarts, 0644);
++ module_param_cb(skip_txen_test, ¶m_ops_uint, &skip_txen_test, 0644);
++#ifdef CONFIG_SERIAL_8250_RSA
++ __module_param_call(MODULE_PARAM_PREFIX, probe_rsa,
++ ¶m_array_ops, .arr = &__param_arr_probe_rsa,
++ 0444, -1);
++#endif
++}
++#else
++MODULE_ALIAS("8250");
++#endif
--- /dev/null
+From 8d2f8cd424ca0b99001f3ff4f5db87c4e525f366 Mon Sep 17 00:00:00 2001
+From: Wang YanQing <udknight@gmail.com>
+Date: Fri, 1 Mar 2013 11:47:20 +0800
+Subject: serial: 8250_pci: add support for another kind of NetMos Technology PCI 9835 Multi-I/O Controller
+
+From: Wang YanQing <udknight@gmail.com>
+
+commit 8d2f8cd424ca0b99001f3ff4f5db87c4e525f366 upstream.
+
+01:08.0 Communication controller: NetMos Technology PCI 9835 Multi-I/O Controller (rev 01)
+ Subsystem: Device [1000:0012]
+ Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
+ Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
+ Interrupt: pin A routed to IRQ 20
+ Region 0: I/O ports at e050 [size=8]
+ Region 1: I/O ports at e040 [size=8]
+ Region 2: I/O ports at e030 [size=8]
+ Region 3: I/O ports at e020 [size=8]
+ Region 4: I/O ports at e010 [size=8]
+ Region 5: I/O ports at e000 [size=16]
+
+Signed-off-by: Wang YanQing <udknight@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/tty/serial/8250/8250_pci.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/drivers/tty/serial/8250/8250_pci.c
++++ b/drivers/tty/serial/8250/8250_pci.c
+@@ -4449,6 +4449,10 @@ static struct pci_device_id serial_pci_t
+ PCI_VENDOR_ID_IBM, 0x0299,
+ 0, 0, pbn_b0_bt_2_115200 },
+
++ { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9835,
++ 0x1000, 0x0012,
++ 0, 0, pbn_b0_bt_2_115200 },
++
+ { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9901,
+ 0xA000, 0x1000,
+ 0, 0, pbn_b0_1_115200 },
staging-vt6656-fix-oops-on-resume-from-suspend.patch
staging-comedi-dt9812-use-cr_chan-for-channel-number.patch
qcserial-bind-to-dm-diag-port-on-gobi-1k-devices.patch
+signal-always-clear-sa_restorer-on-execve.patch
+ext3-fix-format-string-issues.patch
+tty-8250_pnp-serial-port-detection-regression-since-v3.7.patch
+serial-8250-keep-8250.-xxxx-module-options-functional-after-driver-rename.patch
+serial-8250_pci-add-support-for-another-kind-of-netmos-technology-pci-9835-multi-i-o-controller.patch
+tty-serial-fix-typo-arch_s5p6450.patch
+tty-serial-fix-typo-serial_s3c2412.patch
+tty-serial-add-support-for-altera-serial-port.patch
+tty-disable-debugging-warning.patch
+tty-do-not-reset-master-s-packet-mode.patch
+fix-4-port-and-add-support-for-8-port-unknown-pci-serial-port-cards.patch
--- /dev/null
+From 2ca39528c01a933f6689cd6505ce65bd6d68a530 Mon Sep 17 00:00:00 2001
+From: Kees Cook <keescook@chromium.org>
+Date: Wed, 13 Mar 2013 14:59:33 -0700
+Subject: signal: always clear sa_restorer on execve
+
+From: Kees Cook <keescook@chromium.org>
+
+commit 2ca39528c01a933f6689cd6505ce65bd6d68a530 upstream.
+
+When the new signal handlers are set up, the location of sa_restorer is
+not cleared, leaking a parent process's address space location to
+children. This allows for a potential bypass of the parent's ASLR by
+examining the sa_restorer value returned when calling sigaction().
+
+Based on what should be considered "secret" about addresses, it only
+matters across the exec not the fork (since the VMAs haven't changed
+until the exec). But since exec sets SIG_DFL and keeps sa_restorer,
+this is where it should be fixed.
+
+Given the few uses of sa_restorer, a "set" function was not written
+since this would be the only use. Instead, we use
+__ARCH_HAS_SA_RESTORER, as already done in other places.
+
+Example of the leak before applying this patch:
+
+ $ cat /proc/$$/maps
+ ...
+ 7fb9f3083000-7fb9f3238000 r-xp 00000000 fd:01 404469 .../libc-2.15.so
+ ...
+ $ ./leak
+ ...
+ 7f278bc74000-7f278be29000 r-xp 00000000 fd:01 404469 .../libc-2.15.so
+ ...
+ 1 0 (nil) 0x7fb9f30b94a0
+ 2 4000000 (nil) 0x7f278bcaa4a0
+ 3 4000000 (nil) 0x7f278bcaa4a0
+ 4 0 (nil) 0x7fb9f30b94a0
+ ...
+
+[akpm@linux-foundation.org: use SA_RESTORER for backportability]
+Signed-off-by: Kees Cook <keescook@chromium.org>
+Reported-by: Emese Revfy <re.emese@gmail.com>
+Cc: Emese Revfy <re.emese@gmail.com>
+Cc: PaX Team <pageexec@freemail.hu>
+Cc: Al Viro <viro@zeniv.linux.org.uk>
+Cc: Oleg Nesterov <oleg@redhat.com>
+Cc: "Eric W. Biederman" <ebiederm@xmission.com>
+Cc: Serge Hallyn <serge.hallyn@canonical.com>
+Cc: Julien Tinnes <jln@google.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ kernel/signal.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/kernel/signal.c
++++ b/kernel/signal.c
+@@ -485,6 +485,9 @@ flush_signal_handlers(struct task_struct
+ if (force_default || ka->sa.sa_handler != SIG_IGN)
+ ka->sa.sa_handler = SIG_DFL;
+ ka->sa.sa_flags = 0;
++#ifdef SA_RESTORER
++ ka->sa.sa_restorer = NULL;
++#endif
+ sigemptyset(&ka->sa.sa_mask);
+ ka++;
+ }
--- /dev/null
+From 77e372a3d82e5e4878ce1962207edd766773cc76 Mon Sep 17 00:00:00 2001
+From: Sean Young <sean@mess.org>
+Date: Fri, 22 Feb 2013 16:27:19 +0000
+Subject: tty/8250_pnp: serial port detection regression since v3.7
+
+From: Sean Young <sean@mess.org>
+
+commit 77e372a3d82e5e4878ce1962207edd766773cc76 upstream.
+
+The InsydeH2O BIOS (version dated 09/12/2011) has the following in
+its pnp resouces for its serial ports:
+
+$ cat /sys/bus/pnp/devices/00:0b/resources
+state = active
+io disabled
+irq disabled
+
+We do not check if the resources are disabled, and create a bogus
+ttyS* device. Since commit 835d844d1a28e (8250_pnp: do pnp probe
+before legacy probe) we get a bogus ttyS0, which prevents the legacy
+probe from detecting it.
+
+Note, the BIOS can also be upgraded, fixing this problem, but for people
+who can't do that, this fix is needed.
+
+Reported-by: Vincent Deffontaines <vincent@gryzor.com>
+Tested-by: Vincent Deffontaines <vincent@gryzor.com>
+Signed-off-by: Sean Young <sean@mess.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/tty/serial/8250/8250_pnp.c | 12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+--- a/drivers/tty/serial/8250/8250_pnp.c
++++ b/drivers/tty/serial/8250/8250_pnp.c
+@@ -429,6 +429,7 @@ serial_pnp_probe(struct pnp_dev *dev, co
+ {
+ struct uart_8250_port uart;
+ int ret, line, flags = dev_id->driver_data;
++ struct resource *res = NULL;
+
+ if (flags & UNKNOWN_DEV) {
+ ret = serial_pnp_guess_board(dev);
+@@ -439,11 +440,12 @@ serial_pnp_probe(struct pnp_dev *dev, co
+ memset(&uart, 0, sizeof(uart));
+ if (pnp_irq_valid(dev, 0))
+ uart.port.irq = pnp_irq(dev, 0);
+- if ((flags & CIR_PORT) && pnp_port_valid(dev, 2)) {
+- uart.port.iobase = pnp_port_start(dev, 2);
+- uart.port.iotype = UPIO_PORT;
+- } else if (pnp_port_valid(dev, 0)) {
+- uart.port.iobase = pnp_port_start(dev, 0);
++ if ((flags & CIR_PORT) && pnp_port_valid(dev, 2))
++ res = pnp_get_resource(dev, IORESOURCE_IO, 2);
++ else if (pnp_port_valid(dev, 0))
++ res = pnp_get_resource(dev, IORESOURCE_IO, 0);
++ if (pnp_resource_enabled(res)) {
++ uart.port.iobase = res->start;
+ uart.port.iotype = UPIO_PORT;
+ } else if (pnp_mem_valid(dev, 0)) {
+ uart.port.mapbase = pnp_mem_start(dev, 0);
--- /dev/null
+From 34dcfb8479ab3c3669561eb9279284cb0eda2572 Mon Sep 17 00:00:00 2001
+From: Jiri Slaby <jslaby@suse.cz>
+Date: Wed, 27 Feb 2013 22:30:24 +0100
+Subject: TTY: disable debugging warning
+
+From: Jiri Slaby <jslaby@suse.cz>
+
+commit 34dcfb8479ab3c3669561eb9279284cb0eda2572 upstream.
+
+We added a warning to flush_to_ldisc to report cases when it is called
+with a NULL tty. It was for debugging purposes and it lead to a
+patchset from Peter Hurley. The patchset however did not make it to
+3.9, so disable the warning now to not disturb people.
+
+We can re-add it when the series is in and we are hunting for another
+bugs.
+
+Reported-by: David Miller <davem@davemloft.net>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/tty/tty_buffer.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/tty/tty_buffer.c
++++ b/drivers/tty/tty_buffer.c
+@@ -473,7 +473,7 @@ static void flush_to_ldisc(struct work_s
+ struct tty_ldisc *disc;
+
+ tty = port->itty;
+- if (WARN_RATELIMIT(tty == NULL, "tty is NULL\n"))
++ if (tty == NULL)
+ return;
+
+ disc = tty_ldisc_ref(tty);
--- /dev/null
+From b81273a132177edd806476b953f6afeb17b786d5 Mon Sep 17 00:00:00 2001
+From: Jiri Slaby <jslaby@suse.cz>
+Date: Tue, 15 Jan 2013 23:26:22 +0100
+Subject: TTY: do not reset master's packet mode
+
+From: Jiri Slaby <jslaby@suse.cz>
+
+commit b81273a132177edd806476b953f6afeb17b786d5 upstream.
+
+Now that login from util-linux is forced to drop all references to a
+TTY which it wants to hangup (to reach reference count 1) we are
+seeing issues with telnet. When login closes its last reference to the
+slave PTY, it also resets packet mode on the *master* side. And we
+have a race here.
+
+What telnet does is fork+exec of `login'. Then there are two
+scenarios:
+* `login' closes the slave TTY and resets thus master's packet mode,
+ but even now telnet properly sets the mode, or
+* `telnetd' sets packet mode on the master, `login' closes the slave
+ TTY and resets master's packet mode.
+
+The former case is OK. However the latter happens in much more cases,
+by the order of magnitude to be precise. So when one tries to login to
+such a messed telnet setup, they see the following:
+inux login:
+ ogin incorrect
+
+Note the missing first letters -- telnet thinks it is still in the
+packet mode, so when it receives "linux login" from `login', it
+considers "l" as the type of the packet and strips it.
+
+SuS does not mention how the implementation should behave. Both BSDs I
+checked (Free and Net) do not reset the flag upon the last close.
+
+By this I am resurrecting an old bug, see References. We are hitting
+it regularly now, i.e. with updated util-linux, ergo login.
+
+Here, I am changing a behavior introduced back in 2.1 times. It would
+better have a long time testing before goes upstream.
+
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
+Cc: Bryan Mason <bmason@redhat.com>
+References: https://lkml.org/lkml/2009/11/11/223
+References: https://bugzilla.redhat.com/show_bug.cgi?id=504703
+References: https://bugzilla.novell.com/show_bug.cgi?id=797042
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/tty/pty.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+--- a/drivers/tty/pty.c
++++ b/drivers/tty/pty.c
+@@ -47,7 +47,6 @@ static void pty_close(struct tty_struct
+ /* Review - krefs on tty_link ?? */
+ if (!tty->link)
+ return;
+- tty->link->packet = 0;
+ set_bit(TTY_OTHER_CLOSED, &tty->link->flags);
+ wake_up_interruptible(&tty->link->read_wait);
+ wake_up_interruptible(&tty->link->write_wait);
--- /dev/null
+From e06c93cacb82dd147266fd1bdb2d0a0bd45ff2c1 Mon Sep 17 00:00:00 2001
+From: Ley Foon Tan <lftan@altera.com>
+Date: Thu, 7 Mar 2013 10:28:37 +0800
+Subject: tty/serial: Add support for Altera serial port
+
+From: Ley Foon Tan <lftan@altera.com>
+
+commit e06c93cacb82dd147266fd1bdb2d0a0bd45ff2c1 upstream.
+
+Add support for Altera 8250/16550 compatible serial port.
+
+Signed-off-by: Ley Foon Tan <lftan@altera.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ Documentation/devicetree/bindings/tty/serial/of-serial.txt | 3 +
+ drivers/tty/serial/8250/8250.c | 23 ++++++++++++-
+ drivers/tty/serial/of_serial.c | 6 +++
+ include/uapi/linux/serial_core.h | 5 ++
+ 4 files changed, 35 insertions(+), 2 deletions(-)
+
+--- a/Documentation/devicetree/bindings/tty/serial/of-serial.txt
++++ b/Documentation/devicetree/bindings/tty/serial/of-serial.txt
+@@ -11,6 +11,9 @@ Required properties:
+ - "nvidia,tegra20-uart"
+ - "nxp,lpc3220-uart"
+ - "ibm,qpace-nwp-serial"
++ - "altr,16550-FIFO32"
++ - "altr,16550-FIFO64"
++ - "altr,16550-FIFO128"
+ - "serial" if the port type is unknown.
+ - reg : offset and length of the register set for the device.
+ - interrupts : should contain uart interrupt.
+--- a/drivers/tty/serial/8250/8250.c
++++ b/drivers/tty/serial/8250/8250.c
+@@ -308,7 +308,28 @@ static const struct serial8250_config ua
+ },
+ [PORT_8250_CIR] = {
+ .name = "CIR port"
+- }
++ },
++ [PORT_ALTR_16550_F32] = {
++ .name = "Altera 16550 FIFO32",
++ .fifo_size = 32,
++ .tx_loadsz = 32,
++ .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10,
++ .flags = UART_CAP_FIFO | UART_CAP_AFE,
++ },
++ [PORT_ALTR_16550_F64] = {
++ .name = "Altera 16550 FIFO64",
++ .fifo_size = 64,
++ .tx_loadsz = 64,
++ .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10,
++ .flags = UART_CAP_FIFO | UART_CAP_AFE,
++ },
++ [PORT_ALTR_16550_F128] = {
++ .name = "Altera 16550 FIFO128",
++ .fifo_size = 128,
++ .tx_loadsz = 128,
++ .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10,
++ .flags = UART_CAP_FIFO | UART_CAP_AFE,
++ },
+ };
+
+ /* Uart divisor latch read */
+--- a/drivers/tty/serial/of_serial.c
++++ b/drivers/tty/serial/of_serial.c
+@@ -240,6 +240,12 @@ static struct of_device_id of_platform_s
+ { .compatible = "ns16850", .data = (void *)PORT_16850, },
+ { .compatible = "nvidia,tegra20-uart", .data = (void *)PORT_TEGRA, },
+ { .compatible = "nxp,lpc3220-uart", .data = (void *)PORT_LPC3220, },
++ { .compatible = "altr,16550-FIFO32",
++ .data = (void *)PORT_ALTR_16550_F32, },
++ { .compatible = "altr,16550-FIFO64",
++ .data = (void *)PORT_ALTR_16550_F64, },
++ { .compatible = "altr,16550-FIFO128",
++ .data = (void *)PORT_ALTR_16550_F128, },
+ #ifdef CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL
+ { .compatible = "ibm,qpace-nwp-serial",
+ .data = (void *)PORT_NWPSERIAL, },
+--- a/include/uapi/linux/serial_core.h
++++ b/include/uapi/linux/serial_core.h
+@@ -51,7 +51,10 @@
+ #define PORT_8250_CIR 23 /* CIR infrared port, has its own driver */
+ #define PORT_XR17V35X 24 /* Exar XR17V35x UARTs */
+ #define PORT_BRCM_TRUMANAGE 25
+-#define PORT_MAX_8250 25 /* max port ID */
++#define PORT_ALTR_16550_F32 26 /* Altera 16550 UART with 32 FIFOs */
++#define PORT_ALTR_16550_F64 27 /* Altera 16550 UART with 64 FIFOs */
++#define PORT_ALTR_16550_F128 28 /* Altera 16550 UART with 128 FIFOs */
++#define PORT_MAX_8250 28 /* max port ID */
+
+ /*
+ * ARM specific type numbers. These are not currently guaranteed
--- /dev/null
+From 827aa0d36d486f359808c8fb931cf7a71011a09d Mon Sep 17 00:00:00 2001
+From: Paul Bolle <pebolle@tiscali.nl>
+Date: Sat, 9 Mar 2013 23:16:44 +0100
+Subject: tty: serial: fix typo "ARCH_S5P6450"
+
+From: Paul Bolle <pebolle@tiscali.nl>
+
+commit 827aa0d36d486f359808c8fb931cf7a71011a09d upstream.
+
+This could have been either ARCH_S5P64X0 or CPU_S5P6450. Looking at
+commit 2555e663b367b8d555e76023f4de3f6338c28d6c ("ARM: S5P64X0: Add UART
+serial support for S5P6450") - which added this typo - makes clear this
+should be CPU_S5P6450.
+
+Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
+Acked-by: Kukjin Kim <kgene.kim@samsung.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/tty/serial/Kconfig | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/tty/serial/Kconfig
++++ b/drivers/tty/serial/Kconfig
+@@ -216,7 +216,7 @@ config SERIAL_SAMSUNG_UARTS_4
+ config SERIAL_SAMSUNG_UARTS
+ int
+ depends on PLAT_SAMSUNG
+- default 6 if ARCH_S5P6450
++ default 6 if CPU_S5P6450
+ default 4 if SERIAL_SAMSUNG_UARTS_4 || CPU_S3C2416
+ default 3
+ help
--- /dev/null
+From c51d41a1dd8f23a06a4ed651ebb9617de7f59368 Mon Sep 17 00:00:00 2001
+From: Paul Bolle <pebolle@tiscali.nl>
+Date: Tue, 12 Mar 2013 10:10:32 +0100
+Subject: tty: serial: fix typo "SERIAL_S3C2412"
+
+From: Paul Bolle <pebolle@tiscali.nl>
+
+commit c51d41a1dd8f23a06a4ed651ebb9617de7f59368 upstream.
+
+The Kconfig symbol SERIAL_S3C2412 got removed in commit
+da121506eb03ee5daea55404709110b798bd61d9 ("serial: samsung: merge
+probe() function from all SoC specific extensions"). But it also added a
+last reference to that symbol. The commit and the tree make clear that
+CPU_S3C2412 should have been used instead.
+
+Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/tty/serial/Kconfig | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/tty/serial/Kconfig
++++ b/drivers/tty/serial/Kconfig
+@@ -209,7 +209,7 @@ config SERIAL_SAMSUNG
+ config SERIAL_SAMSUNG_UARTS_4
+ bool
+ depends on PLAT_SAMSUNG
+- default y if !(CPU_S3C2410 || SERIAL_S3C2412 || CPU_S3C2440 || CPU_S3C2442)
++ default y if !(CPU_S3C2410 || CPU_S3C2412 || CPU_S3C2440 || CPU_S3C2442)
+ help
+ Internal node for the common case of 4 Samsung compatible UARTs
+