--- /dev/null
+From ebebd49a8eab5e9aa1b1f8f1614ccc3c2120f886 Mon Sep 17 00:00:00 2001
+From: Stephen Hurd <shurd@broadcom.com>
+Date: Thu, 17 Jan 2013 14:14:53 -0800
+Subject: 8250/16?50: Add support for Broadcom TruManage redirected serial port
+
+From: Stephen Hurd <shurd@broadcom.com>
+
+commit ebebd49a8eab5e9aa1b1f8f1614ccc3c2120f886 upstream.
+
+Add support for the UART device present in Broadcom TruManage capable
+NetXtreme chips (ie: 5761m 5762, and 5725).
+
+This implementation has a hidden transmit FIFO, so running in single-byte
+interrupt mode results in too many interrupts. The UART_CAP_HFIFO
+capability was added to track this. It continues to reload the THR as long
+as the THRE and TSRE bits are set in the LSR up to a specified limit (1024
+is used here).
+
+Signed-off-by: Stephen Hurd <shurd@broadcom.com>
+Signed-off-by: Michael Chan <mchan@broadcom.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/tty/serial/8250/8250.c | 11 ++++++++++
+ drivers/tty/serial/8250/8250.h | 1
+ drivers/tty/serial/8250/8250_pci.c | 38 +++++++++++++++++++++++++++++++++++++
+ include/uapi/linux/serial_core.h | 4 ++-
+ 4 files changed, 53 insertions(+), 1 deletion(-)
+
+--- a/drivers/tty/serial/8250/8250.c
++++ b/drivers/tty/serial/8250/8250.c
+@@ -290,6 +290,12 @@ static const struct serial8250_config ua
+ UART_FCR_R_TRIG_00 | UART_FCR_T_TRIG_00,
+ .flags = UART_CAP_FIFO,
+ },
++ [PORT_BRCM_TRUMANAGE] = {
++ .name = "TruManage",
++ .fifo_size = 1,
++ .tx_loadsz = 1024,
++ .flags = UART_CAP_HFIFO,
++ },
+ [PORT_8250_CIR] = {
+ .name = "CIR port"
+ }
+@@ -1441,6 +1447,11 @@ void serial8250_tx_chars(struct uart_825
+ port->icount.tx++;
+ if (uart_circ_empty(xmit))
+ break;
++ if (up->capabilities & UART_CAP_HFIFO) {
++ if ((serial_port_in(port, UART_LSR) & BOTH_EMPTY) !=
++ BOTH_EMPTY)
++ break;
++ }
+ } while (--count > 0);
+
+ if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
+--- a/drivers/tty/serial/8250/8250.h
++++ b/drivers/tty/serial/8250/8250.h
+@@ -40,6 +40,7 @@ struct serial8250_config {
+ #define UART_CAP_AFE (1 << 11) /* MCR-based hw flow control */
+ #define UART_CAP_UUE (1 << 12) /* UART needs IER bit 6 set (Xscale) */
+ #define UART_CAP_RTOIE (1 << 13) /* UART needs IER bit 4 set (Xscale, Tegra) */
++#define UART_CAP_HFIFO (1 << 14) /* UART has a "hidden" FIFO */
+
+ #define UART_BUG_QUOT (1 << 0) /* UART has buggy quot LSB */
+ #define UART_BUG_TXEN (1 << 1) /* UART has buggy TX IIR status */
+--- a/drivers/tty/serial/8250/8250_pci.c
++++ b/drivers/tty/serial/8250/8250_pci.c
+@@ -1085,6 +1085,18 @@ pci_omegapci_setup(struct serial_private
+ return setup_port(priv, port, 2, idx * 8, 0);
+ }
+
++static int
++pci_brcm_trumanage_setup(struct serial_private *priv,
++ const struct pciserial_board *board,
++ struct uart_8250_port *port, int idx)
++{
++ int ret = pci_default_setup(priv, board, port, idx);
++
++ port->port.type = PORT_BRCM_TRUMANAGE;
++ port->port.flags = (port->port.flags | UPF_FIXED_PORT | UPF_FIXED_TYPE);
++ return ret;
++}
++
+ static int skip_tx_en_setup(struct serial_private *priv,
+ const struct pciserial_board *board,
+ struct uart_8250_port *port, int idx)
+@@ -1213,6 +1225,7 @@ pci_wch_ch353_setup(struct serial_privat
+ #define PCI_VENDOR_ID_AGESTAR 0x5372
+ #define PCI_DEVICE_ID_AGESTAR_9375 0x6872
+ #define PCI_VENDOR_ID_ASIX 0x9710
++#define PCI_DEVICE_ID_BROADCOM_TRUMANAGE 0x160a
+
+ /* Unknown vendors/cards - this should not be in linux/pci_ids.h */
+ #define PCI_SUBDEVICE_ID_UNKNOWN_0x1584 0x1584
+@@ -1788,6 +1801,17 @@ static struct pci_serial_quirk pci_seria
+ .setup = pci_asix_setup,
+ },
+ /*
++ * Broadcom TruManage (NetXtreme)
++ */
++ {
++ .vendor = PCI_VENDOR_ID_BROADCOM,
++ .device = PCI_DEVICE_ID_BROADCOM_TRUMANAGE,
++ .subvendor = PCI_ANY_ID,
++ .subdevice = PCI_ANY_ID,
++ .setup = pci_brcm_trumanage_setup,
++ },
++
++ /*
+ * Default "match everything" terminator entry
+ */
+ {
+@@ -1975,6 +1999,7 @@ enum pci_board_num_t {
+ pbn_ce4100_1_115200,
+ pbn_omegapci,
+ pbn_NETMOS9900_2s_115200,
++ pbn_brcm_trumanage,
+ };
+
+ /*
+@@ -2674,6 +2699,12 @@ static struct pciserial_board pci_boards
+ .num_ports = 2,
+ .base_baud = 115200,
+ },
++ [pbn_brcm_trumanage] = {
++ .flags = FL_BASE0,
++ .num_ports = 1,
++ .reg_shift = 2,
++ .base_baud = 115200,
++ },
+ };
+
+ static const struct pci_device_id blacklist[] = {
+@@ -4238,6 +4269,13 @@ static struct pci_device_id serial_pci_t
+ pbn_omegapci },
+
+ /*
++ * Broadcom TruManage
++ */
++ { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_BROADCOM_TRUMANAGE,
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0,
++ pbn_brcm_trumanage },
++
++ /*
+ * AgeStar as-prs2-009
+ */
+ { PCI_VENDOR_ID_AGESTAR, PCI_DEVICE_ID_AGESTAR_9375,
+--- a/include/uapi/linux/serial_core.h
++++ b/include/uapi/linux/serial_core.h
+@@ -49,7 +49,9 @@
+ #define PORT_XR17D15X 21 /* Exar XR17D15x UART */
+ #define PORT_LPC3220 22 /* NXP LPC32xx SoC "Standard" UART */
+ #define PORT_8250_CIR 23 /* CIR infrared port, has its own driver */
+-#define PORT_MAX_8250 23 /* max port ID */
++#define PORT_XR17V35X 24 /* Exar XR17V35x UARTs */
++#define PORT_BRCM_TRUMANAGE 24
++#define PORT_MAX_8250 25 /* max port ID */
+
+ /*
+ * ARM specific type numbers. These are not currently guaranteed
--- /dev/null
+From a6833214cfc6fa8a7c59426af77794cc190c6cfc Mon Sep 17 00:00:00 2001
+From: Steffen Trumtrar <s.trumtrar@pengutronix.de>
+Date: Thu, 13 Dec 2012 14:27:43 +0100
+Subject: mxs: uart: fix setting RTS from software
+
+From: Steffen Trumtrar <s.trumtrar@pengutronix.de>
+
+commit a6833214cfc6fa8a7c59426af77794cc190c6cfc upstream.
+
+With the patch "serial: mxs-auart: fix the wrong RTS hardware flow control" the
+mainline mxs-uart driver now sets RTSEN only when hardware flow control is
+enabled via software. It is not possible any longer to set RTS manually via
+software. However, the manual modification is a valid operation.
+Regain the possibility to set RTS via software and only set RTSEN when hardware
+flow control is explicitly enabled via settermios cflag CRTSCTS.
+
+Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
+Reviewed-by: Huang Shijie <b32955@freescale.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/tty/serial/mxs-auart.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/tty/serial/mxs-auart.c
++++ b/drivers/tty/serial/mxs-auart.c
+@@ -260,10 +260,12 @@ static void mxs_auart_set_mctrl(struct u
+
+ u32 ctrl = readl(u->membase + AUART_CTRL2);
+
+- ctrl &= ~AUART_CTRL2_RTSEN;
++ ctrl &= ~(AUART_CTRL2_RTSEN | AUART_CTRL2_RTS);
+ if (mctrl & TIOCM_RTS) {
+ if (tty_port_cts_enabled(&u->state->port))
+ ctrl |= AUART_CTRL2_RTSEN;
++ else
++ ctrl |= AUART_CTRL2_RTS;
+ }
+
+ s->ctrl = mctrl;
--- /dev/null
+From ded2f295a36d17838fe97e80d7b6ea83381474f8 Mon Sep 17 00:00:00 2001
+From: Jiri Slaby <jslaby@suse.cz>
+Date: Fri, 11 Jan 2013 12:06:27 +0100
+Subject: pty: return EINVAL for TIOCGPTN for BSD ptys
+
+From: Jiri Slaby <jslaby@suse.cz>
+
+commit ded2f295a36d17838fe97e80d7b6ea83381474f8 upstream.
+
+Commit bbb63c514a3464342967237a51a21ea8f61ab951 (drivers:tty:fix up
+ENOIOCTLCMD error handling) changed the default return value from tty
+ioctl to be ENOTTY and not EINVAL. This is appropriate.
+
+But in case of TIOCGPTN for the old BSD ptys glibc started failing
+because it expects EINVAL to be returned. Only then it continues to
+obtain the pts name the other way around.
+
+So fix this case by explicit return of EINVAL in this case.
+
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+Reported-by: Florian Westphal <fw@strlen.de>
+Cc: Alan Cox <alan@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/tty/pty.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/tty/pty.c
++++ b/drivers/tty/pty.c
+@@ -395,6 +395,8 @@ static int pty_bsd_ioctl(struct tty_stru
+ return pty_set_lock(tty, (int __user *) arg);
+ case TIOCSIG: /* Send signal to other side of pty */
+ return pty_signal(tty, (int) arg);
++ case TIOCGPTN: /* TTY returns ENOTTY, but glibc expects EINVAL here */
++ return -EINVAL;
+ }
+ return -ENOIOCTLCMD;
+ }
--- /dev/null
+From 014b9b4ce84281ccb3d723c792bed19815f3571a Mon Sep 17 00:00:00 2001
+From: chao bi <chao.bi@intel.com>
+Date: Wed, 12 Dec 2012 11:40:56 +0800
+Subject: serial:ifx6x60:Delete SPI timer when shut down port
+
+From: chao bi <chao.bi@intel.com>
+
+commit 014b9b4ce84281ccb3d723c792bed19815f3571a upstream.
+
+When shut down SPI port, it's possible that MRDY has been asserted and a SPI
+timer was activated waiting for SRDY assert, in the case, it needs to delete
+this timer.
+
+Signed-off-by: Chen Jun <jun.d.chen@intel.com>
+Signed-off-by: channing <chao.bi@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/tty/serial/ifx6x60.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/tty/serial/ifx6x60.c
++++ b/drivers/tty/serial/ifx6x60.c
+@@ -552,6 +552,7 @@ static void ifx_port_shutdown(struct tty
+ container_of(port, struct ifx_spi_device, tty_port);
+
+ mrdy_set_low(ifx_dev);
++ del_timer(&ifx_dev->spi_timer);
+ clear_bit(IFX_SPI_STATE_TIMER_PENDING, &ifx_dev->flags);
+ tasklet_kill(&ifx_dev->io_work_tasklet);
+ }
igb-release-already-assigned-msi-x-interrupts-if-setup-fails.patch
xen-grant-table-correctly-initialize-grant-table-version-1.patch
xen-fix-stack-corruption-in-xen_failsafe_callback-for-32bit-pvops-guests.patch
+usb-io_ti-fix-null-dereference-in-chase_port.patch
+usb-option-add-tp-link-hsupa-modem-ma180.patch
+usb-option-blacklist-network-interface-on-onda-mt8205-4g-lte.patch
+serial-ifx6x60-delete-spi-timer-when-shut-down-port.patch
+tty-serial-vt8500-fix-return-value-check-in-vt8500_serial_probe.patch
+tty-8250_dw-fix-inverted-arguments-to-serial_out-in-irq-handler.patch
+8250-16-50-add-support-for-broadcom-trumanage-redirected-serial-port.patch
+staging-wlan-ng-fix-clamping-of-returned-ssid-length.patch
+staging-vt6656-fix-inconsistent-structure-packing.patch
+mxs-uart-fix-setting-rts-from-software.patch
+pty-return-einval-for-tiocgptn-for-bsd-ptys.patch
--- /dev/null
+From 1ee4c55fc9620451b2a825d793042a7e0775391b Mon Sep 17 00:00:00 2001
+From: Ben Hutchings <ben@decadent.org.uk>
+Date: Mon, 14 Jan 2013 01:29:17 +0000
+Subject: staging: vt6656: Fix inconsistent structure packing
+
+From: Ben Hutchings <ben@decadent.org.uk>
+
+commit 1ee4c55fc9620451b2a825d793042a7e0775391b upstream.
+
+vt6656 has several headers that use the #pragma pack(1) directive to
+enable structure packing, but never disable it. The layout of
+structures defined in other headers can then depend on which order the
+various headers are included in, breaking the One Definition Rule.
+
+In practice this resulted in crashes on x86_64 until the order of header
+inclusion was changed for some files in commit 11d404cb56ecd ('staging:
+vt6656: fix headers and add cfg80211.'). But we need a proper fix that
+won't be affected by future changes to the order of inclusion.
+
+This removes the #pragma pack(1) directives and adds __packed to the
+structure definitions for which packing appears to have been intended.
+
+Reported-and-tested-by: Malcolm Priestley <tvboxspy@gmail.com>
+Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/staging/vt6656/bssdb.h | 1 -
+ drivers/staging/vt6656/int.h | 1 -
+ drivers/staging/vt6656/iocmd.h | 33 ++++++++++++++++-----------------
+ drivers/staging/vt6656/iowpa.h | 8 +++-----
+ 4 files changed, 19 insertions(+), 24 deletions(-)
+
+--- a/drivers/staging/vt6656/bssdb.h
++++ b/drivers/staging/vt6656/bssdb.h
+@@ -90,7 +90,6 @@ typedef struct tagSRSNCapObject {
+ } SRSNCapObject, *PSRSNCapObject;
+
+ // BSS info(AP)
+-#pragma pack(1)
+ typedef struct tagKnownBSS {
+ // BSS info
+ BOOL bActive;
+--- a/drivers/staging/vt6656/int.h
++++ b/drivers/staging/vt6656/int.h
+@@ -34,7 +34,6 @@
+ #include "device.h"
+
+ /*--------------------- Export Definitions -------------------------*/
+-#pragma pack(1)
+ typedef struct tagSINTData {
+ BYTE byTSR0;
+ BYTE byPkt0;
+--- a/drivers/staging/vt6656/iocmd.h
++++ b/drivers/staging/vt6656/iocmd.h
+@@ -95,13 +95,12 @@ typedef enum tagWZONETYPE {
+ // Ioctl interface structure
+ // Command structure
+ //
+-#pragma pack(1)
+ typedef struct tagSCmdRequest {
+ u8 name[16];
+ void *data;
+ u16 wResult;
+ u16 wCmdCode;
+-} SCmdRequest, *PSCmdRequest;
++} __packed SCmdRequest, *PSCmdRequest;
+
+ //
+ // Scan
+@@ -111,7 +110,7 @@ typedef struct tagSCmdScan {
+
+ u8 ssid[SSID_MAXLEN + 2];
+
+-} SCmdScan, *PSCmdScan;
++} __packed SCmdScan, *PSCmdScan;
+
+ //
+ // BSS Join
+@@ -126,7 +125,7 @@ typedef struct tagSCmdBSSJoin {
+ BOOL bPSEnable;
+ BOOL bShareKeyAuth;
+
+-} SCmdBSSJoin, *PSCmdBSSJoin;
++} __packed SCmdBSSJoin, *PSCmdBSSJoin;
+
+ //
+ // Zonetype Setting
+@@ -137,7 +136,7 @@ typedef struct tagSCmdZoneTypeSet {
+ BOOL bWrite;
+ WZONETYPE ZoneType;
+
+-} SCmdZoneTypeSet, *PSCmdZoneTypeSet;
++} __packed SCmdZoneTypeSet, *PSCmdZoneTypeSet;
+
+ typedef struct tagSWPAResult {
+ char ifname[100];
+@@ -145,7 +144,7 @@ typedef struct tagSWPAResult {
+ u8 key_mgmt;
+ u8 eap_type;
+ BOOL authenticated;
+-} SWPAResult, *PSWPAResult;
++} __packed SWPAResult, *PSWPAResult;
+
+ typedef struct tagSCmdStartAP {
+
+@@ -157,7 +156,7 @@ typedef struct tagSCmdStartAP {
+ BOOL bShareKeyAuth;
+ u8 byBasicRate;
+
+-} SCmdStartAP, *PSCmdStartAP;
++} __packed SCmdStartAP, *PSCmdStartAP;
+
+ typedef struct tagSCmdSetWEP {
+
+@@ -167,7 +166,7 @@ typedef struct tagSCmdSetWEP {
+ BOOL bWepKeyAvailable[WEP_NKEYS];
+ u32 auWepKeyLength[WEP_NKEYS];
+
+-} SCmdSetWEP, *PSCmdSetWEP;
++} __packed SCmdSetWEP, *PSCmdSetWEP;
+
+ typedef struct tagSBSSIDItem {
+
+@@ -180,14 +179,14 @@ typedef struct tagSBSSIDItem {
+ BOOL bWEPOn;
+ u32 uRSSI;
+
+-} SBSSIDItem;
++} __packed SBSSIDItem;
+
+
+ typedef struct tagSBSSIDList {
+
+ u32 uItem;
+ SBSSIDItem sBSSIDList[0];
+-} SBSSIDList, *PSBSSIDList;
++} __packed SBSSIDList, *PSBSSIDList;
+
+
+ typedef struct tagSNodeItem {
+@@ -208,7 +207,7 @@ typedef struct tagSNodeItem {
+ u32 uTxAttempts;
+ u16 wFailureRatio;
+
+-} SNodeItem;
++} __packed SNodeItem;
+
+
+ typedef struct tagSNodeList {
+@@ -216,7 +215,7 @@ typedef struct tagSNodeList {
+ u32 uItem;
+ SNodeItem sNodeList[0];
+
+-} SNodeList, *PSNodeList;
++} __packed SNodeList, *PSNodeList;
+
+
+ typedef struct tagSCmdLinkStatus {
+@@ -229,7 +228,7 @@ typedef struct tagSCmdLinkStatus {
+ u32 uChannel;
+ u32 uLinkRate;
+
+-} SCmdLinkStatus, *PSCmdLinkStatus;
++} __packed SCmdLinkStatus, *PSCmdLinkStatus;
+
+ //
+ // 802.11 counter
+@@ -247,7 +246,7 @@ typedef struct tagSDot11MIBCount {
+ u32 ReceivedFragmentCount;
+ u32 MulticastReceivedFrameCount;
+ u32 FCSErrorCount;
+-} SDot11MIBCount, *PSDot11MIBCount;
++} __packed SDot11MIBCount, *PSDot11MIBCount;
+
+
+
+@@ -355,13 +354,13 @@ typedef struct tagSStatMIBCount {
+ u32 ullTxBroadcastBytes[2];
+ u32 ullTxMulticastBytes[2];
+ u32 ullTxDirectedBytes[2];
+-} SStatMIBCount, *PSStatMIBCount;
++} __packed SStatMIBCount, *PSStatMIBCount;
+
+ typedef struct tagSCmdValue {
+
+ u32 dwValue;
+
+-} SCmdValue, *PSCmdValue;
++} __packed SCmdValue, *PSCmdValue;
+
+ //
+ // hostapd & viawget ioctl related
+@@ -431,7 +430,7 @@ struct viawget_hostapd_param {
+ u8 ssid[32];
+ } scan_req;
+ } u;
+-};
++} __packed;
+
+ /*--------------------- Export Classes ----------------------------*/
+
+--- a/drivers/staging/vt6656/iowpa.h
++++ b/drivers/staging/vt6656/iowpa.h
+@@ -67,12 +67,11 @@ enum {
+
+
+
+-#pragma pack(1)
+ typedef struct viawget_wpa_header {
+ u8 type;
+ u16 req_ie_len;
+ u16 resp_ie_len;
+-} viawget_wpa_header;
++} __packed viawget_wpa_header;
+
+ struct viawget_wpa_param {
+ u32 cmd;
+@@ -113,9 +112,8 @@ struct viawget_wpa_param {
+ u8 *buf;
+ } scan_results;
+ } u;
+-};
++} __packed;
+
+-#pragma pack(1)
+ struct viawget_scan_result {
+ u8 bssid[6];
+ u8 ssid[32];
+@@ -130,7 +128,7 @@ struct viawget_scan_result {
+ int noise;
+ int level;
+ int maxrate;
+-};
++} __packed;
+
+ /*--------------------- Export Classes ----------------------------*/
+
--- /dev/null
+From 811a37effdb11e54e1ff1ddaa944286c88f58487 Mon Sep 17 00:00:00 2001
+From: Tormod Volden <debian.tormod@gmail.com>
+Date: Wed, 9 Jan 2013 22:23:32 +0100
+Subject: staging: wlan-ng: Fix clamping of returned SSID length
+
+From: Tormod Volden <debian.tormod@gmail.com>
+
+commit 811a37effdb11e54e1ff1ddaa944286c88f58487 upstream.
+
+Commit 2e254212 broke listing of available network names, since it
+clamped the length of the returned SSID to WLAN_BSSID_LEN (6) instead of
+WLAN_SSID_MAXLEN (32).
+
+https://bugzilla.kernel.org/show_bug.cgi?id=52501
+
+Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/staging/wlan-ng/prism2mgmt.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/staging/wlan-ng/prism2mgmt.c
++++ b/drivers/staging/wlan-ng/prism2mgmt.c
+@@ -406,7 +406,7 @@ int prism2mgmt_scan_results(wlandevice_t
+ /* SSID */
+ req->ssid.status = P80211ENUM_msgitem_status_data_ok;
+ req->ssid.data.len = le16_to_cpu(item->ssid.len);
+- req->ssid.data.len = min_t(u16, req->ssid.data.len, WLAN_BSSID_LEN);
++ req->ssid.data.len = min_t(u16, req->ssid.data.len, WLAN_SSID_MAXLEN);
+ memcpy(req->ssid.data.data, item->ssid.data, req->ssid.data.len);
+
+ /* supported rates */
--- /dev/null
+From 68e56cb3a068f9c30971c6117fbbd1e32918e49e Mon Sep 17 00:00:00 2001
+From: Maxime Ripard <maxime.ripard@free-electrons.com>
+Date: Mon, 14 Jan 2013 20:09:26 +0100
+Subject: tty: 8250_dw: Fix inverted arguments to serial_out in IRQ handler
+
+From: Maxime Ripard <maxime.ripard@free-electrons.com>
+
+commit 68e56cb3a068f9c30971c6117fbbd1e32918e49e upstream.
+
+Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/tty/serial/8250/8250_dw.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/tty/serial/8250/8250_dw.c
++++ b/drivers/tty/serial/8250/8250_dw.c
+@@ -79,7 +79,7 @@ static int dw8250_handle_irq(struct uart
+ } else if ((iir & UART_IIR_BUSY) == UART_IIR_BUSY) {
+ /* Clear the USR and write the LCR again. */
+ (void)p->serial_in(p, UART_USR);
+- p->serial_out(p, d->last_lcr, UART_LCR);
++ p->serial_out(p, UART_LCR, d->last_lcr);
+
+ return 1;
+ }
--- /dev/null
+From a6dd114e16cbc4410049a90a8a67b967333d108d Mon Sep 17 00:00:00 2001
+From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
+Date: Sun, 2 Dec 2012 05:10:44 -0500
+Subject: tty: serial: vt8500: fix return value check in vt8500_serial_probe()
+
+From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
+
+commit a6dd114e16cbc4410049a90a8a67b967333d108d upstream.
+
+In case of error, function of_clk_get() returns ERR_PTR()
+and never returns NULL. The NULL test in the return value
+check should be replaced with IS_ERR().
+
+Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
+Acked-by: Tony Prisk <linux@prisktech.co.nz>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/tty/serial/vt8500_serial.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/tty/serial/vt8500_serial.c
++++ b/drivers/tty/serial/vt8500_serial.c
+@@ -604,7 +604,7 @@ static int __devinit vt8500_serial_probe
+ vt8500_port->uart.flags = UPF_IOREMAP | UPF_BOOT_AUTOCONF;
+
+ vt8500_port->clk = of_clk_get(pdev->dev.of_node, 0);
+- if (vt8500_port->clk) {
++ if (!IS_ERR(vt8500_port->clk)) {
+ vt8500_port->uart.uartclk = clk_get_rate(vt8500_port->clk);
+ } else {
+ /* use the default of 24Mhz if not specified and warn */
--- /dev/null
+From 1ee0a224bc9aad1de496c795f96bc6ba2c394811 Mon Sep 17 00:00:00 2001
+From: Wolfgang Frisch <wfpub@roembden.net>
+Date: Thu, 17 Jan 2013 01:07:02 +0100
+Subject: USB: io_ti: Fix NULL dereference in chase_port()
+
+From: Wolfgang Frisch <wfpub@roembden.net>
+
+commit 1ee0a224bc9aad1de496c795f96bc6ba2c394811 upstream.
+
+The tty is NULL when the port is hanging up.
+chase_port() needs to check for this.
+
+This patch is intended for stable series.
+The behavior was observed and tested in Linux 3.2 and 3.7.1.
+
+Johan Hovold submitted a more elaborate patch for the mainline kernel.
+
+[ 56.277883] usb 1-1: edge_bulk_in_callback - nonzero read bulk status received: -84
+[ 56.278811] usb 1-1: USB disconnect, device number 3
+[ 56.278856] usb 1-1: edge_bulk_in_callback - stopping read!
+[ 56.279562] BUG: unable to handle kernel NULL pointer dereference at 00000000000001c8
+[ 56.280536] IP: [<ffffffff8144e62a>] _raw_spin_lock_irqsave+0x19/0x35
+[ 56.281212] PGD 1dc1b067 PUD 1e0f7067 PMD 0
+[ 56.282085] Oops: 0002 [#1] SMP
+[ 56.282744] Modules linked in:
+[ 56.283512] CPU 1
+[ 56.283512] Pid: 25, comm: khubd Not tainted 3.7.1 #1 innotek GmbH VirtualBox/VirtualBox
+[ 56.283512] RIP: 0010:[<ffffffff8144e62a>] [<ffffffff8144e62a>] _raw_spin_lock_irqsave+0x19/0x35
+[ 56.283512] RSP: 0018:ffff88001fa99ab0 EFLAGS: 00010046
+[ 56.283512] RAX: 0000000000000046 RBX: 00000000000001c8 RCX: 0000000000640064
+[ 56.283512] RDX: 0000000000010000 RSI: ffff88001fa99b20 RDI: 00000000000001c8
+[ 56.283512] RBP: ffff88001fa99b20 R08: 0000000000000000 R09: 0000000000000000
+[ 56.283512] R10: 0000000000000000 R11: ffffffff812fcb4c R12: ffff88001ddf53c0
+[ 56.283512] R13: 0000000000000000 R14: 00000000000001c8 R15: ffff88001e19b9f4
+[ 56.283512] FS: 0000000000000000(0000) GS:ffff88001fd00000(0000) knlGS:0000000000000000
+[ 56.283512] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
+[ 56.283512] CR2: 00000000000001c8 CR3: 000000001dc51000 CR4: 00000000000006e0
+[ 56.283512] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
+[ 56.283512] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
+[ 56.283512] Process khubd (pid: 25, threadinfo ffff88001fa98000, task ffff88001fa94f80)
+[ 56.283512] Stack:
+[ 56.283512] 0000000000000046 00000000000001c8 ffffffff810578ec ffffffff812fcb4c
+[ 56.283512] ffff88001e19b980 0000000000002710 ffffffff812ffe81 0000000000000001
+[ 56.283512] ffff88001fa94f80 0000000000000202 ffffffff00000001 0000000000000296
+[ 56.283512] Call Trace:
+[ 56.283512] [<ffffffff810578ec>] ? add_wait_queue+0x12/0x3c
+[ 56.283512] [<ffffffff812fcb4c>] ? usb_serial_port_work+0x28/0x28
+[ 56.283512] [<ffffffff812ffe81>] ? chase_port+0x84/0x2d6
+[ 56.283512] [<ffffffff81063f27>] ? try_to_wake_up+0x199/0x199
+[ 56.283512] [<ffffffff81263a5c>] ? tty_ldisc_hangup+0x222/0x298
+[ 56.283512] [<ffffffff81300171>] ? edge_close+0x64/0x129
+[ 56.283512] [<ffffffff810612f7>] ? __wake_up+0x35/0x46
+[ 56.283512] [<ffffffff8106135b>] ? should_resched+0x5/0x23
+[ 56.283512] [<ffffffff81264916>] ? tty_port_shutdown+0x39/0x44
+[ 56.283512] [<ffffffff812fcb4c>] ? usb_serial_port_work+0x28/0x28
+[ 56.283512] [<ffffffff8125d38c>] ? __tty_hangup+0x307/0x351
+[ 56.283512] [<ffffffff812e6ddc>] ? usb_hcd_flush_endpoint+0xde/0xed
+[ 56.283512] [<ffffffff8144e625>] ? _raw_spin_lock_irqsave+0x14/0x35
+[ 56.283512] [<ffffffff812fd361>] ? usb_serial_disconnect+0x57/0xc2
+[ 56.283512] [<ffffffff812ea99b>] ? usb_unbind_interface+0x5c/0x131
+[ 56.283512] [<ffffffff8128d738>] ? __device_release_driver+0x7f/0xd5
+[ 56.283512] [<ffffffff8128d9cd>] ? device_release_driver+0x1a/0x25
+[ 56.283512] [<ffffffff8128d393>] ? bus_remove_device+0xd2/0xe7
+[ 56.283512] [<ffffffff8128b7a3>] ? device_del+0x119/0x167
+[ 56.283512] [<ffffffff812e8d9d>] ? usb_disable_device+0x6a/0x180
+[ 56.283512] [<ffffffff812e2ae0>] ? usb_disconnect+0x81/0xe6
+[ 56.283512] [<ffffffff812e4435>] ? hub_thread+0x577/0xe82
+[ 56.283512] [<ffffffff8144daa7>] ? __schedule+0x490/0x4be
+[ 56.283512] [<ffffffff8105798f>] ? abort_exclusive_wait+0x79/0x79
+[ 56.283512] [<ffffffff812e3ebe>] ? usb_remote_wakeup+0x2f/0x2f
+[ 56.283512] [<ffffffff812e3ebe>] ? usb_remote_wakeup+0x2f/0x2f
+[ 56.283512] [<ffffffff810570b4>] ? kthread+0x81/0x89
+[ 56.283512] [<ffffffff81057033>] ? __kthread_parkme+0x5c/0x5c
+[ 56.283512] [<ffffffff8145387c>] ? ret_from_fork+0x7c/0xb0
+[ 56.283512] [<ffffffff81057033>] ? __kthread_parkme+0x5c/0x5c
+[ 56.283512] Code: 8b 7c 24 08 e8 17 0b c3 ff 48 8b 04 24 48 83 c4 10 c3 53 48 89 fb 41 50 e8 e0 0a c3 ff 48 89 04 24 e8 e7 0a c3 ff ba 00 00 01 00
+<f0> 0f c1 13 48 8b 04 24 89 d1 c1 ea 10 66 39 d1 74 07 f3 90 66
+[ 56.283512] RIP [<ffffffff8144e62a>] _raw_spin_lock_irqsave+0x19/0x35
+[ 56.283512] RSP <ffff88001fa99ab0>
+[ 56.283512] CR2: 00000000000001c8
+[ 56.283512] ---[ end trace 49714df27e1679ce ]---
+
+Signed-off-by: Wolfgang Frisch <wfpub@roembden.net>
+Cc: Johan Hovold <jhovold@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/serial/io_ti.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/usb/serial/io_ti.c
++++ b/drivers/usb/serial/io_ti.c
+@@ -534,6 +534,9 @@ static void chase_port(struct edgeport_p
+ wait_queue_t wait;
+ unsigned long flags;
+
++ if (!tty)
++ return;
++
+ if (!timeout)
+ timeout = (HZ * EDGE_CLOSING_WAIT)/100;
+
--- /dev/null
+From 99beb2e9687ffd61c92a9875141eabe6f57a71b9 Mon Sep 17 00:00:00 2001
+From: Bjørn Mork <bjorn@mork.no>
+Date: Tue, 15 Jan 2013 10:29:49 +0100
+Subject: USB: option: add TP-LINK HSUPA Modem MA180
+
+From: Bjørn Mork <bjorn@mork.no>
+
+commit 99beb2e9687ffd61c92a9875141eabe6f57a71b9 upstream.
+
+The driver description files gives these names to the vendor specific
+functions on this modem:
+
+ Diagnostics VID_2357&PID_0201&MI_00
+ NMEA VID_2357&PID_0201&MI_01
+ Modem VID_2357&PID_0201&MI_03
+ Networkcard VID_2357&PID_0201&MI_04
+
+Reported-by: Thomas Schäfer <tschaefer@t-online.de>
+Signed-off-by: Bjørn Mork <bjorn@mork.no>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/serial/option.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/drivers/usb/serial/option.c
++++ b/drivers/usb/serial/option.c
+@@ -450,6 +450,10 @@ static void option_instat_callback(struc
+ #define PETATEL_VENDOR_ID 0x1ff4
+ #define PETATEL_PRODUCT_NP10T 0x600e
+
++/* TP-LINK Incorporated products */
++#define TPLINK_VENDOR_ID 0x2357
++#define TPLINK_PRODUCT_MA180 0x0201
++
+ /* some devices interfaces need special handling due to a number of reasons */
+ enum option_blacklist_reason {
+ OPTION_BLACKLIST_NONE = 0,
+@@ -1312,6 +1316,8 @@ static const struct usb_device_id option
+ { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM2, 0xff, 0x00, 0x00) },
+ { USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MEN200) },
+ { USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T) },
++ { USB_DEVICE(TPLINK_VENDOR_ID, TPLINK_PRODUCT_MA180),
++ .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
+ { } /* Terminating entry */
+ };
+ MODULE_DEVICE_TABLE(usb, option_ids);
--- /dev/null
+From 2291dff02e5f8c708a46a7c4c888f2c467e26642 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= <bjorn@mork.no>
+Date: Thu, 17 Jan 2013 15:14:22 +0100
+Subject: USB: option: blacklist network interface on ONDA MT8205 4G LTE
+
+Signed-off-by: Bjørn Mork <bjorn@mork.no>
+
+commit 2291dff02e5f8c708a46a7c4c888f2c467e26642 upstream.
+
+The driver description files gives these names to the vendor specific
+functions on this modem:
+
+ Diag VID_19D2&PID_0265&MI_00
+ NMEA VID_19D2&PID_0265&MI_01
+ AT cmd VID_19D2&PID_0265&MI_02
+ Modem VID_19D2&PID_0265&MI_03
+ Net VID_19D2&PID_0265&MI_04
+
+Signed-off-by: Bjørn Mork <bjorn@mork.no>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/serial/option.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/usb/serial/option.c
++++ b/drivers/usb/serial/option.c
+@@ -935,7 +935,8 @@ static const struct usb_device_id option
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0254, 0xff, 0xff, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0257, 0xff, 0xff, 0xff), /* ZTE MF821 */
+ .driver_info = (kernel_ulong_t)&net_intf3_blacklist },
+- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0265, 0xff, 0xff, 0xff) },
++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0265, 0xff, 0xff, 0xff), /* ONDA MT8205 */
++ .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0284, 0xff, 0xff, 0xff), /* ZTE MF880 */
+ .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0317, 0xff, 0xff, 0xff) },