--- /dev/null
+From 2f7861de111bb8e33e6ab9f9607583c6fbc00132 Mon Sep 17 00:00:00 2001
+From: WANG Cong <xiyou.wangcong@gmail.com>
+Date: Thu, 1 Sep 2011 13:58:29 +0800
+Subject: cris: fix a build error in drivers/tty/serial/crisv10.c
+
+From: WANG Cong <xiyou.wangcong@gmail.com>
+
+commit 2f7861de111bb8e33e6ab9f9607583c6fbc00132 upstream.
+
+This patch fixes the following build error:
+
+drivers/tty/serial/crisv10.c:4453: error: 'if_ser0' undeclared (first use in this function): 2 errors in 2 logs
+ v3.1-rc4/cris/cris-allmodconfig v3.1-rc4/cris/cris-allyesconfig
+drivers/tty/serial/crisv10.c:4453: error: (Each undeclared identifier is reported only once: 2 errors in 2 logs
+ v3.1-rc4/cris/cris-allmodconfig v3.1-rc4/cris/cris-allyesconfig
+drivers/tty/serial/crisv10.c:4453: error: for each function it appears in.): 2 errors in 2 logs
+ v3.1-rc4/cris/cris-allmodconfig v3.1-rc4/cris/cris-allyesconfig
+
+"if_ser0" is a typo, it should be "if_serial_0".
+
+Cc: Mikael Starvik <starvik@axis.com>
+Cc: Jesper Nilsson <jesper.nilsson@axis.com>
+Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/tty/serial/crisv10.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/tty/serial/crisv10.c
++++ b/drivers/tty/serial/crisv10.c
+@@ -4450,7 +4450,7 @@ static int __init rs_init(void)
+
+ #if defined(CONFIG_ETRAX_RS485)
+ #if defined(CONFIG_ETRAX_RS485_ON_PA)
+- if (cris_io_interface_allocate_pins(if_ser0, 'a', rs485_pa_bit,
++ if (cris_io_interface_allocate_pins(if_serial_0, 'a', rs485_pa_bit,
+ rs485_pa_bit)) {
+ printk(KERN_CRIT "ETRAX100LX serial: Could not allocate "
+ "RS485 pin\n");
+@@ -4459,7 +4459,7 @@ static int __init rs_init(void)
+ }
+ #endif
+ #if defined(CONFIG_ETRAX_RS485_ON_PORT_G)
+- if (cris_io_interface_allocate_pins(if_ser0, 'g', rs485_pa_bit,
++ if (cris_io_interface_allocate_pins(if_serial_0, 'g', rs485_pa_bit,
+ rs485_port_g_bit)) {
+ printk(KERN_CRIT "ETRAX100LX serial: Could not allocate "
+ "RS485 pin\n");
--- /dev/null
+From 94abc56f4d90f289ea32a0a11d3577fcd8cb28fb Mon Sep 17 00:00:00 2001
+From: Ning Jiang <ning.jiang@marvell.com>
+Date: Mon, 5 Sep 2011 16:28:18 +0800
+Subject: serial-core: power up uart port early before we do set_termios when resuming
+
+From: Ning Jiang <ning.jiang@marvell.com>
+
+commit 94abc56f4d90f289ea32a0a11d3577fcd8cb28fb upstream.
+
+The following patch removed uart_change_pm() in uart_resume_port():
+
+commit 5933a161abcb8d83a2c145177f48027c3c0a8995
+Author: Yin Kangkai <kangkai.yin@linux.intel.com>
+ serial-core: reset the console speed on resume
+
+It will break the pxa serial driver when the system resumes from suspend mode
+as it will try to set baud rate divider register in set_termios but with
+clock off. The register value can not be set correctly on some platform if
+the clock is disabled. The pxa driver will check the value and report the
+following warning:
+
+------------[ cut here ]------------
+WARNING: at drivers/tty/serial/pxa.c:545 serial_pxa_set_termios+0x1dc/0x250()
+Modules linked in:
+[<c0281f30>] (unwind_backtrace+0x0/0xf0) from [<c029341c>] (warn_slowpath_common+0x4c/0x64)
+[<c029341c>] (warn_slowpath_common+0x4c/0x64) from [<c029344c>] (warn_slowpath_null+0x18/0x1c)
+[<c029344c>] (warn_slowpath_null+0x18/0x1c) from [<c044b1e4>] (serial_pxa_set_termios+0x1dc/0x250)
+[<c044b1e4>] (serial_pxa_set_termios+0x1dc/0x250) from [<c044a840>] (uart_resume_port+0x128/0x2dc)
+[<c044a840>] (uart_resume_port+0x128/0x2dc) from [<c044bbe0>] (serial_pxa_resume+0x18/0x24)
+[<c044bbe0>] (serial_pxa_resume+0x18/0x24) from [<c0454d34>] (platform_pm_resume+0x40/0x4c)
+[<c0454d34>] (platform_pm_resume+0x40/0x4c) from [<c0457ebc>] (pm_op+0x68/0xb4)
+[<c0457ebc>] (pm_op+0x68/0xb4) from [<c0458368>] (device_resume+0xb0/0xec)
+[<c0458368>] (device_resume+0xb0/0xec) from [<c04584c8>] (dpm_resume+0xe0/0x194)
+[<c04584c8>] (dpm_resume+0xe0/0x194) from [<c0458588>] (dpm_resume_end+0xc/0x18)
+[<c0458588>] (dpm_resume_end+0xc/0x18) from [<c02c518c>] (suspend_devices_and_enter+0x16c/0x1ac)
+[<c02c518c>] (suspend_devices_and_enter+0x16c/0x1ac) from [<c02c5278>] (enter_state+0xac/0xdc)
+[<c02c5278>] (enter_state+0xac/0xdc) from [<c02c48ec>] (state_store+0xa0/0xbc)
+[<c02c48ec>] (state_store+0xa0/0xbc) from [<c0408f7c>] (kobj_attr_store+0x18/0x1c)
+[<c0408f7c>] (kobj_attr_store+0x18/0x1c) from [<c034a6a4>] (sysfs_write_file+0x108/0x140)
+[<c034a6a4>] (sysfs_write_file+0x108/0x140) from [<c02fb798>] (vfs_write+0xac/0x134)
+[<c02fb798>] (vfs_write+0xac/0x134) from [<c02fb8cc>] (sys_write+0x3c/0x68)
+[<c02fb8cc>] (sys_write+0x3c/0x68) from [<c027c700>] (ret_fast_syscall+0x0/0x2c)
+---[ end trace 88289eceb4675b04 ]---
+
+This patch fix the problem by adding the power on opertion back for uart
+console when console_suspend_enabled is true.
+
+Signed-off-by: Ning Jiang <ning.jiang@marvell.com>
+Tested-by: Mayank Rana <mrana@codeaurora.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/tty/serial/serial_core.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/tty/serial/serial_core.c
++++ b/drivers/tty/serial/serial_core.c
+@@ -2003,6 +2003,8 @@ int uart_resume_port(struct uart_driver
+ if (port->tty && port->tty->termios && termios.c_cflag == 0)
+ termios = *(port->tty->termios);
+
++ if (console_suspend_enabled)
++ uart_change_pm(state, 0);
+ uport->ops->set_termios(uport, &termios, NULL);
+ if (console_suspend_enabled)
+ console_start(uport->cons);
--- /dev/null
+From e44aabd649c80e8be16ede3ed3cbff6fb2561ca9 Mon Sep 17 00:00:00 2001
+From: Marcus Folkesson <marcus.folkesson@gmail.com>
+Date: Tue, 30 Aug 2011 13:53:10 +0200
+Subject: serial: pxa: work around for errata #20
+
+From: Marcus Folkesson <marcus.folkesson@gmail.com>
+
+commit e44aabd649c80e8be16ede3ed3cbff6fb2561ca9 upstream.
+
+Errata E20: UART: Character Timeout interrupt remains set under certain
+software conditions.
+
+Implication: The software servicing the UART can be trapped in an infinite loop.
+
+Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/tty/serial/pxa.c | 20 ++++++++++++++++++++
+ 1 file changed, 20 insertions(+)
+
+--- a/drivers/tty/serial/pxa.c
++++ b/drivers/tty/serial/pxa.c
+@@ -100,6 +100,16 @@ static inline void receive_chars(struct
+ int max_count = 256;
+
+ do {
++ /* work around Errata #20 according to
++ * Intel(R) PXA27x Processor Family
++ * Specification Update (May 2005)
++ *
++ * Step 2
++ * Disable the Reciever Time Out Interrupt via IER[RTOEI]
++ */
++ up->ier &= ~UART_IER_RTOIE;
++ serial_out(up, UART_IER, up->ier);
++
+ ch = serial_in(up, UART_RX);
+ flag = TTY_NORMAL;
+ up->port.icount.rx++;
+@@ -156,6 +166,16 @@ static inline void receive_chars(struct
+ *status = serial_in(up, UART_LSR);
+ } while ((*status & UART_LSR_DR) && (max_count-- > 0));
+ tty_flip_buffer_push(tty);
++
++ /* work around Errata #20 according to
++ * Intel(R) PXA27x Processor Family
++ * Specification Update (May 2005)
++ *
++ * Step 6:
++ * No more data in FIFO: Re-enable RTO interrupt via IER[RTOIE]
++ */
++ up->ier |= UART_IER_RTOIE;
++ serial_out(up, UART_IER, up->ier);
+ }
+
+ static void transmit_chars(struct uart_pxa_port *up)
cifs-fix-incorrect-max-rfc1002-write-size-value.patch
cifs-fix-dfs-handling-in-cifs_get_file_info.patch
+cris-fix-a-build-error-in-drivers-tty-serial-crisv10.c.patch
+tty-drop-driver-reference-in-tty_open-fail-path.patch
+tty-make-tty_add_file-non-failing.patch
+tty-pty-release-tty-in-all-ptmx_open-fail-paths.patch
+usb-for-usb_autopm_get_interface_async-einprogress-is-not-an-error.patch
+staging-serqt_usb2-remove-ssu100-from-supported-devices.patch
+staging-quatech_usb2-potential-lost-wakeup-scenario-in-tiocmiwait.patch
+staging-hv-add-support-for-2-tb-lun-in-storage-driver.patch
+usb-qcserial-add-support-for-sierra-wireless-mc8355-gobi-3000.patch
+usb-qcserial-add-device-id-for-hp-un2430-mobile-broadband-module.patch
+serial-pxa-work-around-for-errata-20.patch
+serial-core-power-up-uart-port-early-before-we-do-set_termios-when-resuming.patch
--- /dev/null
+From cf55f4a8b6243b42fb91c56d1421db0d36d60f96 Mon Sep 17 00:00:00 2001
+From: Mike Sterling <mike.sterling@microsoft.com>
+Date: Tue, 6 Sep 2011 16:10:55 -0700
+Subject: Staging: hv: Add support for >2 TB LUN in storage driver.
+
+From: Mike Sterling <mike.sterling@microsoft.com>
+
+commit cf55f4a8b6243b42fb91c56d1421db0d36d60f96 upstream.
+
+If a LUN larger than 2 TB is attached to a Linux VM on Hyper-V, we currently
+report a maximum size of 2 TB. This patch resolves the issue in hv_storvsc.
+Thanks to Robert Scheck <robert.scheck@etes.de> for reporting the issue.
+
+Reported-by: Robert Scheck <robert.scheck@etes.de>
+Signed-off-by: Mike Sterling <mike.sterling@microsoft.com>
+Signed-off-by: K.Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/staging/hv/hyperv_storage.h | 1 +
+ drivers/staging/hv/storvsc_drv.c | 2 ++
+ 2 files changed, 3 insertions(+)
+
+--- a/drivers/staging/hv/hyperv_storage.h
++++ b/drivers/staging/hv/hyperv_storage.h
+@@ -218,6 +218,7 @@ struct vstor_packet {
+ #define STORVSC_MAX_LUNS_PER_TARGET 64
+ #define STORVSC_MAX_TARGETS 1
+ #define STORVSC_MAX_CHANNELS 1
++#define STORVSC_MAX_CMD_LEN 16
+
+ struct hv_storvsc_request;
+
+--- a/drivers/staging/hv/storvsc_drv.c
++++ b/drivers/staging/hv/storvsc_drv.c
+@@ -729,6 +729,8 @@ static int storvsc_probe(struct hv_devic
+ host->max_id = STORVSC_MAX_TARGETS;
+ /* max # of channels */
+ host->max_channel = STORVSC_MAX_CHANNELS - 1;
++ /* max cmd length */
++ host->max_cmd_len = STORVSC_MAX_CMD_LEN;
+
+ /* Register the HBA and start the scsi bus scan */
+ ret = scsi_add_host(host, &device->device);
--- /dev/null
+From e8df1674d383d2ecc6efa8d7dba74c03aafdfdd7 Mon Sep 17 00:00:00 2001
+From: Kautuk Consul <consul.kautuk@gmail.com>
+Date: Wed, 14 Sep 2011 08:56:21 +0530
+Subject: staging: quatech_usb2: Potential lost wakeup scenario in TIOCMIWAIT
+
+From: Kautuk Consul <consul.kautuk@gmail.com>
+
+commit e8df1674d383d2ecc6efa8d7dba74c03aafdfdd7 upstream.
+
+If the usermode app does an ioctl over this serial device by
+using TIOCMIWAIT, then the code will wait by setting the current
+task state to TASK_INTERRUPTIBLE and then calling schedule().
+This will be woken up by the qt2_process_modem_status on URB
+completion when the port_extra->shadowMSR is set to the new
+modem status.
+
+However, this could result in a lost wakeup scenario due to a race
+in the logic in the qt2_ioctl(TIOCMIWAIT) loop and the URB completion
+for new modem status in qt2_process_modem_status.
+Due to this, the usermode app's task will continue to sleep despite a
+change in the modem status.
+
+Signed-off-by: Kautuk Consul <consul.kautuk@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/staging/quatech_usb2/quatech_usb2.c | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+--- a/drivers/staging/quatech_usb2/quatech_usb2.c
++++ b/drivers/staging/quatech_usb2/quatech_usb2.c
+@@ -916,9 +916,10 @@ static int qt2_ioctl(struct tty_struct *
+ dbg("%s() port %d, cmd == TIOCMIWAIT enter",
+ __func__, port->number);
+ prev_msr_value = port_extra->shadowMSR & QT2_SERIAL_MSR_MASK;
++ barrier();
++ __set_current_state(TASK_INTERRUPTIBLE);
+ while (1) {
+ add_wait_queue(&port_extra->wait, &wait);
+- set_current_state(TASK_INTERRUPTIBLE);
+ schedule();
+ dbg("%s(): port %d, cmd == TIOCMIWAIT here\n",
+ __func__, port->number);
+@@ -926,9 +927,12 @@ static int qt2_ioctl(struct tty_struct *
+ /* see if a signal woke us up */
+ if (signal_pending(current))
+ return -ERESTARTSYS;
++ set_current_state(TASK_INTERRUPTIBLE);
+ msr_value = port_extra->shadowMSR & QT2_SERIAL_MSR_MASK;
+- if (msr_value == prev_msr_value)
++ if (msr_value == prev_msr_value) {
++ __set_current_state(TASK_RUNNING);
+ return -EIO; /* no change - error */
++ }
+ if ((arg & TIOCM_RNG &&
+ ((prev_msr_value & QT2_SERIAL_MSR_RI) ==
+ (msr_value & QT2_SERIAL_MSR_RI))) ||
+@@ -941,6 +945,7 @@ static int qt2_ioctl(struct tty_struct *
+ (arg & TIOCM_CTS &&
+ ((prev_msr_value & QT2_SERIAL_MSR_CTS) ==
+ (msr_value & QT2_SERIAL_MSR_CTS)))) {
++ __set_current_state(TASK_RUNNING);
+ return 0;
+ }
+ } /* end inifinite while */
--- /dev/null
+From 7cbf3c7cd59288fb5e9f31815c74773549668d43 Mon Sep 17 00:00:00 2001
+From: Bill Pemberton <wfp5p@virginia.edu>
+Date: Mon, 29 Aug 2011 13:48:54 -0400
+Subject: staging: serqt_usb2: remove ssu100 from supported devices
+
+From: Bill Pemberton <wfp5p@virginia.edu>
+
+commit 7cbf3c7cd59288fb5e9f31815c74773549668d43 upstream.
+
+The serqt_usb2 driver will not work properly with the ssu100 device
+even though it claims to support it. The ssu100 is supported by the
+ssu100 driver in mainline so there is no need to have it claimed by
+serqt_usb2.
+
+Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/staging/serqt_usb2/serqt_usb2.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+--- a/drivers/staging/serqt_usb2/serqt_usb2.c
++++ b/drivers/staging/serqt_usb2/serqt_usb2.c
+@@ -24,7 +24,6 @@ static int debug;
+ #define DRIVER_DESC "Quatech USB to Serial Driver"
+
+ #define USB_VENDOR_ID_QUATECH 0x061d /* Quatech VID */
+-#define QUATECH_SSU100 0xC020 /* SSU100 */
+ #define QUATECH_SSU200 0xC030 /* SSU200 */
+ #define QUATECH_DSU100 0xC040 /* DSU100 */
+ #define QUATECH_DSU200 0xC050 /* DSU200 */
+@@ -127,7 +126,6 @@ static int debug;
+ #define RS232_MODE 0x00
+
+ static const struct usb_device_id serqt_id_table[] = {
+- {USB_DEVICE(USB_VENDOR_ID_QUATECH, QUATECH_SSU100)},
+ {USB_DEVICE(USB_VENDOR_ID_QUATECH, QUATECH_SSU200)},
+ {USB_DEVICE(USB_VENDOR_ID_QUATECH, QUATECH_DSU100)},
+ {USB_DEVICE(USB_VENDOR_ID_QUATECH, QUATECH_DSU200)},
+@@ -775,7 +773,6 @@ static int qt_startup(struct usb_serial
+ }
+
+ switch (serial->dev->descriptor.idProduct) {
+- case QUATECH_SSU100:
+ case QUATECH_DSU100:
+ case QUATECH_QSU100:
+ case QUATECH_ESU100A:
--- /dev/null
+From c290f8358acaeffd8e0c551ddcc24d1206143376 Mon Sep 17 00:00:00 2001
+From: Jiri Slaby <jslaby@suse.cz>
+Date: Wed, 12 Oct 2011 11:32:42 +0200
+Subject: TTY: drop driver reference in tty_open fail path
+
+From: Jiri Slaby <jslaby@suse.cz>
+
+commit c290f8358acaeffd8e0c551ddcc24d1206143376 upstream.
+
+When tty_driver_lookup_tty fails in tty_open, we forget to drop a
+reference to the tty driver. This was added by commit 4a2b5fddd5 (Move
+tty lookup/reopen to caller).
+
+Fix that by adding tty_driver_kref_put to the fail path.
+
+I will refactor the code later. This is for the ease of backporting to
+stable.
+
+Introduced-in: v2.6.28-rc2
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
+Acked-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/tty/tty_io.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/tty/tty_io.c
++++ b/drivers/tty/tty_io.c
+@@ -1872,6 +1872,7 @@ got_driver:
+ if (IS_ERR(tty)) {
+ tty_unlock();
+ mutex_unlock(&tty_mutex);
++ tty_driver_kref_put(driver);
+ return PTR_ERR(tty);
+ }
+ }
--- /dev/null
+From fa90e1c935472281de314e6d7c9a37db9cbc2e4e Mon Sep 17 00:00:00 2001
+From: Jiri Slaby <jslaby@suse.cz>
+Date: Wed, 12 Oct 2011 11:32:43 +0200
+Subject: TTY: make tty_add_file non-failing
+
+From: Jiri Slaby <jslaby@suse.cz>
+
+commit fa90e1c935472281de314e6d7c9a37db9cbc2e4e upstream.
+
+If tty_add_file fails at the point it is now, we have to revert all
+the changes we did to the tty. It means either decrease all refcounts
+if this was a tty reopen or delete the tty if it was newly allocated.
+
+There was a try to fix this in v3.0-rc2 using tty_release in 0259894c7
+(TTY: fix fail path in tty_open). But instead it introduced a NULL
+dereference. It's because tty_release dereferences
+filp->private_data, but that one is set even in our tty_add_file. And
+when tty_add_file fails, it's still NULL/garbage. Hence tty_release
+cannot be called there.
+
+To circumvent the original leak (and the current NULL deref) we split
+tty_add_file into two functions, making the latter non-failing. In
+that case we may do the former early in open, where handling failures
+is easy. The latter stays as it is now. So there is no change in
+functionality.
+
+The original bug (leak) was introduced by f573bd176 (tty: Remove
+__GFP_NOFAIL from tty_add_file()). Thanks Dan for reporting this.
+
+Later, we may split tty_release into more functions and call only some
+of them in this fail path instead. (If at all possible.)
+
+Introduced-in: v2.6.37-rc2
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
+Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
+Cc: Pekka Enberg <penberg@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/tty/pty.c | 16 +++++++++++-----
+ drivers/tty/tty_io.c | 47 +++++++++++++++++++++++++++++++++++------------
+ include/linux/tty.h | 4 +++-
+ 3 files changed, 49 insertions(+), 18 deletions(-)
+
+--- a/drivers/tty/pty.c
++++ b/drivers/tty/pty.c
+@@ -670,12 +670,18 @@ static int ptmx_open(struct inode *inode
+
+ nonseekable_open(inode, filp);
+
++ retval = tty_alloc_file(filp);
++ if (retval)
++ return retval;
++
+ /* find a device that is not in use. */
+ tty_lock();
+ index = devpts_new_index(inode);
+ tty_unlock();
+- if (index < 0)
+- return index;
++ if (index < 0) {
++ retval = index;
++ goto err_file;
++ }
+
+ mutex_lock(&tty_mutex);
+ tty_lock();
+@@ -689,9 +695,7 @@ static int ptmx_open(struct inode *inode
+
+ set_bit(TTY_PTY_LOCK, &tty->flags); /* LOCK THE SLAVE */
+
+- retval = tty_add_file(tty, filp);
+- if (retval)
+- goto out;
++ tty_add_file(tty, filp);
+
+ retval = devpts_pty_new(inode, tty->link);
+ if (retval)
+@@ -710,6 +714,8 @@ out2:
+ out:
+ devpts_kill_index(inode, index);
+ tty_unlock();
++err_file:
++ tty_free_file(filp);
+ return retval;
+ }
+
+--- a/drivers/tty/tty_io.c
++++ b/drivers/tty/tty_io.c
+@@ -193,8 +193,7 @@ static inline struct tty_struct *file_tt
+ return ((struct tty_file_private *)file->private_data)->tty;
+ }
+
+-/* Associate a new file with the tty structure */
+-int tty_add_file(struct tty_struct *tty, struct file *file)
++int tty_alloc_file(struct file *file)
+ {
+ struct tty_file_private *priv;
+
+@@ -202,15 +201,36 @@ int tty_add_file(struct tty_struct *tty,
+ if (!priv)
+ return -ENOMEM;
+
++ file->private_data = priv;
++
++ return 0;
++}
++
++/* Associate a new file with the tty structure */
++void tty_add_file(struct tty_struct *tty, struct file *file)
++{
++ struct tty_file_private *priv = file->private_data;
++
+ priv->tty = tty;
+ priv->file = file;
+- file->private_data = priv;
+
+ spin_lock(&tty_files_lock);
+ list_add(&priv->list, &tty->tty_files);
+ spin_unlock(&tty_files_lock);
++}
+
+- return 0;
++/**
++ * tty_free_file - free file->private_data
++ *
++ * This shall be used only for fail path handling when tty_add_file was not
++ * called yet.
++ */
++void tty_free_file(struct file *file)
++{
++ struct tty_file_private *priv = file->private_data;
++
++ file->private_data = NULL;
++ kfree(priv);
+ }
+
+ /* Delete file from its tty */
+@@ -221,8 +241,7 @@ void tty_del_file(struct file *file)
+ spin_lock(&tty_files_lock);
+ list_del(&priv->list);
+ spin_unlock(&tty_files_lock);
+- file->private_data = NULL;
+- kfree(priv);
++ tty_free_file(file);
+ }
+
+
+@@ -1811,6 +1830,10 @@ static int tty_open(struct inode *inode,
+ nonseekable_open(inode, filp);
+
+ retry_open:
++ retval = tty_alloc_file(filp);
++ if (retval)
++ return -ENOMEM;
++
+ noctty = filp->f_flags & O_NOCTTY;
+ index = -1;
+ retval = 0;
+@@ -1823,6 +1846,7 @@ retry_open:
+ if (!tty) {
+ tty_unlock();
+ mutex_unlock(&tty_mutex);
++ tty_free_file(filp);
+ return -ENXIO;
+ }
+ driver = tty_driver_kref_get(tty->driver);
+@@ -1855,6 +1879,7 @@ retry_open:
+ }
+ tty_unlock();
+ mutex_unlock(&tty_mutex);
++ tty_free_file(filp);
+ return -ENODEV;
+ }
+
+@@ -1862,6 +1887,7 @@ retry_open:
+ if (!driver) {
+ tty_unlock();
+ mutex_unlock(&tty_mutex);
++ tty_free_file(filp);
+ return -ENODEV;
+ }
+ got_driver:
+@@ -1873,6 +1899,7 @@ got_driver:
+ tty_unlock();
+ mutex_unlock(&tty_mutex);
+ tty_driver_kref_put(driver);
++ tty_free_file(filp);
+ return PTR_ERR(tty);
+ }
+ }
+@@ -1888,15 +1915,11 @@ got_driver:
+ tty_driver_kref_put(driver);
+ if (IS_ERR(tty)) {
+ tty_unlock();
++ tty_free_file(filp);
+ return PTR_ERR(tty);
+ }
+
+- retval = tty_add_file(tty, filp);
+- if (retval) {
+- tty_unlock();
+- tty_release(inode, filp);
+- return retval;
+- }
++ tty_add_file(tty, filp);
+
+ check_tty_count(tty, "tty_open");
+ if (tty->driver->type == TTY_DRIVER_TYPE_PTY &&
+--- a/include/linux/tty.h
++++ b/include/linux/tty.h
+@@ -472,7 +472,9 @@ extern void proc_clear_tty(struct task_s
+ extern struct tty_struct *get_current_tty(void);
+ extern void tty_default_fops(struct file_operations *fops);
+ extern struct tty_struct *alloc_tty_struct(void);
+-extern int tty_add_file(struct tty_struct *tty, struct file *file);
++extern int tty_alloc_file(struct file *file);
++extern void tty_add_file(struct tty_struct *tty, struct file *file);
++extern void tty_free_file(struct file *file);
+ extern void free_tty_struct(struct tty_struct *tty);
+ extern void initialize_tty_struct(struct tty_struct *tty,
+ struct tty_driver *driver, int idx);
--- /dev/null
+From 1177c0efc04d032644895b8d757f55b433912596 Mon Sep 17 00:00:00 2001
+From: Jiri Slaby <jslaby@suse.cz>
+Date: Wed, 12 Oct 2011 11:32:44 +0200
+Subject: TTY: pty, release tty in all ptmx_open fail paths
+
+From: Jiri Slaby <jslaby@suse.cz>
+
+commit 1177c0efc04d032644895b8d757f55b433912596 upstream.
+
+Mistakenly, commit 64ba3dc3143d (tty: never hold BTM while getting
+tty_mutex) switched one fail path in ptmx_open to not free the newly
+allocated tty.
+
+Fix that by jumping to the appropriate place. And rename the labels so
+that it's clear what is going on there.
+
+Introduced-in: v2.6.36-rc2
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+Cc: Arnd Bergmann <arnd@arndb.de>
+Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/tty/pty.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+--- a/drivers/tty/pty.c
++++ b/drivers/tty/pty.c
+@@ -699,15 +699,15 @@ static int ptmx_open(struct inode *inode
+
+ retval = devpts_pty_new(inode, tty->link);
+ if (retval)
+- goto out1;
++ goto err_release;
+
+ retval = ptm_driver->ops->open(tty, filp);
+ if (retval)
+- goto out2;
+-out1:
++ goto err_release;
++
+ tty_unlock();
+- return retval;
+-out2:
++ return 0;
++err_release:
+ tty_unlock();
+ tty_release(inode, filp);
+ return retval;
--- /dev/null
+From c5a48592d874ddef8c7880311581eccf0eb30c3b Mon Sep 17 00:00:00 2001
+From: Jim Wylder <jwylder1@motorola.com>
+Date: Tue, 6 Sep 2011 21:07:20 -0500
+Subject: USB: for usb_autopm_get_interface_async -EINPROGRESS is not an error
+
+From: Jim Wylder <jwylder1@motorola.com>
+
+commit c5a48592d874ddef8c7880311581eccf0eb30c3b upstream.
+
+A return value of -EINPROGRESS from pm_runtime_get indicates that
+the device is already resuming due to a previous call. Internally,
+usb_autopm_get_interface_async doesn't treat this as an error and
+increments the usage count, but passes the error status along
+to the caller. The logical assumption of the caller is that
+any negative return value reflects the device not resuming
+and the pm_usage_cnt not being incremented. Since the usage count
+is being incremented and the device is resuming, return success (0)
+instead.
+
+Signed-off-by: James Wylder <james.wylder@motorola.com>
+Acked-by: Alan Stern <stern@rowland.harvard.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/core/driver.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/usb/core/driver.c
++++ b/drivers/usb/core/driver.c
+@@ -1583,7 +1583,7 @@ int usb_autopm_get_interface_async(struc
+ dev_vdbg(&intf->dev, "%s: cnt %d -> %d\n",
+ __func__, atomic_read(&intf->dev.power.usage_count),
+ status);
+- if (status > 0)
++ if (status > 0 || status == -EINPROGRESS)
+ status = 0;
+ return status;
+ }
--- /dev/null
+From 1bfac90d1b8e63a4d44158c3445d8fda3fb6d5eb Mon Sep 17 00:00:00 2001
+From: Rigbert Hamisch <rigbert@gmx.de>
+Date: Tue, 27 Sep 2011 10:46:43 +0200
+Subject: USB: qcserial: add device ID for "HP un2430 Mobile Broadband Module"
+
+From: Rigbert Hamisch <rigbert@gmx.de>
+
+commit 1bfac90d1b8e63a4d44158c3445d8fda3fb6d5eb upstream.
+
+add device ID for "HP un2430 Mobile Broadband Module"
+
+Signed-off-by: Rigbert Hamisch <rigbert@gmx.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/serial/qcserial.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/usb/serial/qcserial.c
++++ b/drivers/usb/serial/qcserial.c
+@@ -28,6 +28,7 @@ static const struct usb_device_id id_tab
+ {USB_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */
+ {USB_DEVICE(0x03f0, 0x1f1d)}, /* HP un2400 Gobi Modem Device */
+ {USB_DEVICE(0x03f0, 0x201d)}, /* HP un2400 Gobi QDL Device */
++ {USB_DEVICE(0x03f0, 0x371d)}, /* HP un2430 Mobile Broadband Module */
+ {USB_DEVICE(0x04da, 0x250d)}, /* Panasonic Gobi Modem device */
+ {USB_DEVICE(0x04da, 0x250c)}, /* Panasonic Gobi QDL device */
+ {USB_DEVICE(0x413c, 0x8172)}, /* Dell Gobi Modem device */
--- /dev/null
+From 68c79e5756903229fa96826a2493c2265a3b395f Mon Sep 17 00:00:00 2001
+From: Richard Hartmann <richih.mailinglist@gmail.com>
+Date: Tue, 20 Sep 2011 20:50:51 +0200
+Subject: USB: qcserial: Add support for Sierra Wireless MC8355/Gobi 3000
+
+From: Richard Hartmann <richih.mailinglist@gmail.com>
+
+commit 68c79e5756903229fa96826a2493c2265a3b395f upstream.
+
+Simple patch to make qcserial recognize the USB id of the Sierra
+Wireless MC8355 which is based on the Gobi 3000 chip.
+
+Both UMTS and GPS work fine.
+
+Signed-off-by: Richard Hartmann <richih.mailinglist@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/serial/qcserial.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/usb/serial/qcserial.c
++++ b/drivers/usb/serial/qcserial.c
+@@ -83,6 +83,7 @@ static const struct usb_device_id id_tab
+ {USB_DEVICE(0x16d8, 0x8002)}, /* CMDTech Gobi 2000 Modem device (VU922) */
+ {USB_DEVICE(0x05c6, 0x9204)}, /* Gobi 2000 QDL device */
+ {USB_DEVICE(0x05c6, 0x9205)}, /* Gobi 2000 Modem device */
++ {USB_DEVICE(0x1199, 0x9013)}, /* Sierra Wireless Gobi 3000 Modem device (MC8355) */
+ { } /* Terminating entry */
+ };
+ MODULE_DEVICE_TABLE(usb, id_table);