]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Dec 2014 23:33:44 +0000 (15:33 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Dec 2014 23:33:44 +0000 (15:33 -0800)
added patches:
aio-fix-uncorrent-dirty-pages-accouting-when-truncating-aio-ring-buffer.patch
alsa-usb-audio-add-ctrl-message-delay-quirk-for.patch
can-esd_usb2-fix-memory-leak-on-disconnect.patch
staging-r8188eu-add-new-device-id-for-dlink-go-usb-n150.patch
usb-keyspan-fix-overrun-error-reporting.patch
usb-keyspan-fix-tty-line-status-reporting.patch
usb-quirks-add-reset-resume-quirk-for-ms-wireless-laser-mouse-6000.patch
usb-serial-cp210x-add-ids-for-cel-meshconnect-usb-stick.patch
usb-serial-ftdi_sio-add-pids-for-matrix-orbital-products.patch
usb-ssu100-fix-overrun-error-reporting.patch
usb-xhci-don-t-start-a-halted-endpoint-before-its-new-dequeue-is-set.patch
usb-xhci-rework-root-port-wake-bits-if-controller-isn-t-allowed-to-wakeup.patch

13 files changed:
queue-3.14/aio-fix-uncorrent-dirty-pages-accouting-when-truncating-aio-ring-buffer.patch [new file with mode: 0644]
queue-3.14/alsa-usb-audio-add-ctrl-message-delay-quirk-for.patch [new file with mode: 0644]
queue-3.14/can-esd_usb2-fix-memory-leak-on-disconnect.patch [new file with mode: 0644]
queue-3.14/series
queue-3.14/staging-r8188eu-add-new-device-id-for-dlink-go-usb-n150.patch [new file with mode: 0644]
queue-3.14/usb-keyspan-fix-overrun-error-reporting.patch [new file with mode: 0644]
queue-3.14/usb-keyspan-fix-tty-line-status-reporting.patch [new file with mode: 0644]
queue-3.14/usb-quirks-add-reset-resume-quirk-for-ms-wireless-laser-mouse-6000.patch [new file with mode: 0644]
queue-3.14/usb-serial-cp210x-add-ids-for-cel-meshconnect-usb-stick.patch [new file with mode: 0644]
queue-3.14/usb-serial-ftdi_sio-add-pids-for-matrix-orbital-products.patch [new file with mode: 0644]
queue-3.14/usb-ssu100-fix-overrun-error-reporting.patch [new file with mode: 0644]
queue-3.14/usb-xhci-don-t-start-a-halted-endpoint-before-its-new-dequeue-is-set.patch [new file with mode: 0644]
queue-3.14/usb-xhci-rework-root-port-wake-bits-if-controller-isn-t-allowed-to-wakeup.patch [new file with mode: 0644]

diff --git a/queue-3.14/aio-fix-uncorrent-dirty-pages-accouting-when-truncating-aio-ring-buffer.patch b/queue-3.14/aio-fix-uncorrent-dirty-pages-accouting-when-truncating-aio-ring-buffer.patch
new file mode 100644 (file)
index 0000000..d887f82
--- /dev/null
@@ -0,0 +1,169 @@
+From 835f252c6debd204fcd607c79975089b1ecd3472 Mon Sep 17 00:00:00 2001
+From: Gu Zheng <guz.fnst@cn.fujitsu.com>
+Date: Thu, 6 Nov 2014 17:46:21 +0800
+Subject: aio: fix uncorrent dirty pages accouting when truncating AIO ring buffer
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Gu Zheng <guz.fnst@cn.fujitsu.com>
+
+commit 835f252c6debd204fcd607c79975089b1ecd3472 upstream.
+
+https://bugzilla.kernel.org/show_bug.cgi?id=86831
+
+Markus reported that when shutting down mysqld (with AIO support,
+on a ext3 formatted Harddrive) leads to a negative number of dirty pages
+(underrun to the counter). The negative number results in a drastic reduction
+of the write performance because the page cache is not used, because the kernel
+thinks it is still 2 ^ 32 dirty pages open.
+
+Add a warn trace in __dec_zone_state will catch this easily:
+
+static inline void __dec_zone_state(struct zone *zone, enum
+       zone_stat_item item)
+{
+     atomic_long_dec(&zone->vm_stat[item]);
++    WARN_ON_ONCE(item == NR_FILE_DIRTY &&
+       atomic_long_read(&zone->vm_stat[item]) < 0);
+     atomic_long_dec(&vm_stat[item]);
+}
+
+[   21.341632] ------------[ cut here ]------------
+[   21.346294] WARNING: CPU: 0 PID: 309 at include/linux/vmstat.h:242
+cancel_dirty_page+0x164/0x224()
+[   21.355296] Modules linked in: wutbox_cp sata_mv
+[   21.359968] CPU: 0 PID: 309 Comm: kworker/0:1 Not tainted 3.14.21-WuT #80
+[   21.366793] Workqueue: events free_ioctx
+[   21.370760] [<c0016a64>] (unwind_backtrace) from [<c0012f88>]
+(show_stack+0x20/0x24)
+[   21.378562] [<c0012f88>] (show_stack) from [<c03f8ccc>]
+(dump_stack+0x24/0x28)
+[   21.385840] [<c03f8ccc>] (dump_stack) from [<c0023ae4>]
+(warn_slowpath_common+0x84/0x9c)
+[   21.393976] [<c0023ae4>] (warn_slowpath_common) from [<c0023bb8>]
+(warn_slowpath_null+0x2c/0x34)
+[   21.402800] [<c0023bb8>] (warn_slowpath_null) from [<c00c0688>]
+(cancel_dirty_page+0x164/0x224)
+[   21.411524] [<c00c0688>] (cancel_dirty_page) from [<c00c080c>]
+(truncate_inode_page+0x8c/0x158)
+[   21.420272] [<c00c080c>] (truncate_inode_page) from [<c00c0a94>]
+(truncate_inode_pages_range+0x11c/0x53c)
+[   21.429890] [<c00c0a94>] (truncate_inode_pages_range) from
+[<c00c0f6c>] (truncate_pagecache+0x88/0xac)
+[   21.439252] [<c00c0f6c>] (truncate_pagecache) from [<c00c0fec>]
+(truncate_setsize+0x5c/0x74)
+[   21.447731] [<c00c0fec>] (truncate_setsize) from [<c013b3a8>]
+(put_aio_ring_file.isra.14+0x34/0x90)
+[   21.456826] [<c013b3a8>] (put_aio_ring_file.isra.14) from
+[<c013b424>] (aio_free_ring+0x20/0xcc)
+[   21.465660] [<c013b424>] (aio_free_ring) from [<c013b4f4>]
+(free_ioctx+0x24/0x44)
+[   21.473190] [<c013b4f4>] (free_ioctx) from [<c003d8d8>]
+(process_one_work+0x134/0x47c)
+[   21.481132] [<c003d8d8>] (process_one_work) from [<c003e988>]
+(worker_thread+0x130/0x414)
+[   21.489350] [<c003e988>] (worker_thread) from [<c00448ac>]
+(kthread+0xd4/0xec)
+[   21.496621] [<c00448ac>] (kthread) from [<c000ec18>]
+(ret_from_fork+0x14/0x20)
+[   21.503884] ---[ end trace 79c4bf42c038c9a1 ]---
+
+The cause is that we set the aio ring file pages as *DIRTY* via SetPageDirty
+(bypasses the VFS dirty pages increment) when init, and aio fs uses
+*default_backing_dev_info* as the backing dev, which does not disable
+the dirty pages accounting capability.
+So truncating aio ring file will contribute to accounting dirty pages (VFS
+dirty pages decrement), then error occurs.
+
+The original goal is keeping these pages in memory (can not be reclaimed
+or swapped) in life-time via marking it dirty. But thinking more, we have
+already pinned pages via elevating the page's refcount, which can already
+achieve the goal, so the SetPageDirty seems unnecessary.
+
+In order to fix the issue, using the __set_page_dirty_no_writeback instead
+of the nop .set_page_dirty, and dropped the SetPageDirty (don't manually
+set the dirty flags, don't disable set_page_dirty(), rely on default behaviour).
+
+With the above change, the dirty pages accounting can work well. But as we
+known, aio fs is an anonymous one, which should never cause any real write-back,
+we can ignore the dirty pages (write back) accounting by disabling the dirty
+pages (write back) accounting capability. So we introduce an aio private
+backing dev info (disabled the ACCT_DIRTY/WRITEBACK/ACCT_WB capabilities) to
+replace the default one.
+
+Reported-by: Markus Königshaus <m.koenigshaus@wut.de>
+Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
+Acked-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Benjamin LaHaise <bcrl@kvack.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/aio.c |   21 ++++++++++++++-------
+ 1 file changed, 14 insertions(+), 7 deletions(-)
+
+--- a/fs/aio.c
++++ b/fs/aio.c
+@@ -165,6 +165,15 @@ static struct vfsmount *aio_mnt;
+ static const struct file_operations aio_ring_fops;
+ static const struct address_space_operations aio_ctx_aops;
++/* Backing dev info for aio fs.
++ * -no dirty page accounting or writeback happens
++ */
++static struct backing_dev_info aio_fs_backing_dev_info = {
++      .name           = "aiofs",
++      .state          = 0,
++      .capabilities   = BDI_CAP_NO_ACCT_AND_WRITEBACK | BDI_CAP_MAP_COPY,
++};
++
+ static struct file *aio_private_file(struct kioctx *ctx, loff_t nr_pages)
+ {
+       struct qstr this = QSTR_INIT("[aio]", 5);
+@@ -176,6 +185,7 @@ static struct file *aio_private_file(str
+       inode->i_mapping->a_ops = &aio_ctx_aops;
+       inode->i_mapping->private_data = ctx;
++      inode->i_mapping->backing_dev_info = &aio_fs_backing_dev_info;
+       inode->i_size = PAGE_SIZE * nr_pages;
+       path.dentry = d_alloc_pseudo(aio_mnt->mnt_sb, &this);
+@@ -221,6 +231,9 @@ static int __init aio_setup(void)
+       if (IS_ERR(aio_mnt))
+               panic("Failed to create aio fs mount.");
++      if (bdi_init(&aio_fs_backing_dev_info))
++              panic("Failed to init aio fs backing dev info.");
++
+       kiocb_cachep = KMEM_CACHE(kiocb, SLAB_HWCACHE_ALIGN|SLAB_PANIC);
+       kioctx_cachep = KMEM_CACHE(kioctx,SLAB_HWCACHE_ALIGN|SLAB_PANIC);
+@@ -282,11 +295,6 @@ static const struct file_operations aio_
+       .mmap = aio_ring_mmap,
+ };
+-static int aio_set_page_dirty(struct page *page)
+-{
+-      return 0;
+-}
+-
+ #if IS_ENABLED(CONFIG_MIGRATION)
+ static int aio_migratepage(struct address_space *mapping, struct page *new,
+                       struct page *old, enum migrate_mode mode)
+@@ -358,7 +366,7 @@ out:
+ #endif
+ static const struct address_space_operations aio_ctx_aops = {
+-      .set_page_dirty = aio_set_page_dirty,
++      .set_page_dirty = __set_page_dirty_no_writeback,
+ #if IS_ENABLED(CONFIG_MIGRATION)
+       .migratepage    = aio_migratepage,
+ #endif
+@@ -413,7 +421,6 @@ static int aio_setup_ring(struct kioctx
+               pr_debug("pid(%d) page[%d]->count=%d\n",
+                        current->pid, i, page_count(page));
+               SetPageUptodate(page);
+-              SetPageDirty(page);
+               unlock_page(page);
+               ctx->ring_pages[i] = page;
diff --git a/queue-3.14/alsa-usb-audio-add-ctrl-message-delay-quirk-for.patch b/queue-3.14/alsa-usb-audio-add-ctrl-message-delay-quirk-for.patch
new file mode 100644 (file)
index 0000000..a4218e6
--- /dev/null
@@ -0,0 +1,56 @@
+From 6e84a8d7ac3ba246ef44e313e92bc16a1da1b04a Mon Sep 17 00:00:00 2001
+From: Jurgen Kramer <gtmkramer@xs4all.nl>
+Date: Sat, 15 Nov 2014 14:01:21 +0100
+Subject: ALSA: usb-audio: Add ctrl message delay quirk for
+ Marantz/Denon devices
+
+From: Jurgen Kramer <gtmkramer@xs4all.nl>
+
+commit 6e84a8d7ac3ba246ef44e313e92bc16a1da1b04a upstream.
+
+This patch adds a USB control message delay quirk for a few specific Marantz/Denon
+devices. Without the delay the DACs will not work properly and produces the
+following type of messages:
+
+Nov 15 10:09:21 orwell kernel: [   91.342880] usb 3-13: clock source 41 is not valid, cannot use
+Nov 15 10:09:21 orwell kernel: [   91.343775] usb 3-13: clock source 41 is not valid, cannot use
+
+There are likely other Marantz/Denon devices using the same USB module which exhibit the
+same problems. But as this cannot be verified I limited the patch to the devices
+I could test.
+
+The following two devices are covered by this path:
+- Marantz SA-14S1
+- Marantz HD-DAC1
+
+Signed-off-by: Jurgen Kramer <gtmkramer@xs4all.nl>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/usb/quirks.c |   14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+--- a/sound/usb/quirks.c
++++ b/sound/usb/quirks.c
+@@ -1142,6 +1142,20 @@ void snd_usb_ctl_msg_quirk(struct usb_de
+       if ((le16_to_cpu(dev->descriptor.idVendor) == 0x23ba) &&
+           (requesttype & USB_TYPE_MASK) == USB_TYPE_CLASS)
+               mdelay(20);
++
++      /* Marantz/Denon devices with USB DAC functionality need a delay
++       * after each class compliant request
++       */
++      if ((le16_to_cpu(dev->descriptor.idVendor) == 0x154e) &&
++          (requesttype & USB_TYPE_MASK) == USB_TYPE_CLASS) {
++
++              switch (le16_to_cpu(dev->descriptor.idProduct)) {
++              case 0x3005: /* Marantz HD-DAC1 */
++              case 0x3006: /* Marantz SA-14S1 */
++                      mdelay(20);
++                      break;
++              }
++      }
+ }
+ /*
diff --git a/queue-3.14/can-esd_usb2-fix-memory-leak-on-disconnect.patch b/queue-3.14/can-esd_usb2-fix-memory-leak-on-disconnect.patch
new file mode 100644 (file)
index 0000000..fbe11a3
--- /dev/null
@@ -0,0 +1,33 @@
+From efbd50d2f62fc1f69a3dcd153e63ba28cc8eb27f Mon Sep 17 00:00:00 2001
+From: Alexey Khoroshilov <khoroshilov@ispras.ru>
+Date: Sat, 11 Oct 2014 00:31:07 +0400
+Subject: can: esd_usb2: fix memory leak on disconnect
+
+From: Alexey Khoroshilov <khoroshilov@ispras.ru>
+
+commit efbd50d2f62fc1f69a3dcd153e63ba28cc8eb27f upstream.
+
+It seems struct esd_usb2 dev is not deallocated on disconnect. The patch adds
+the missing deallocation.
+
+Found by Linux Driver Verification project (linuxtesting.org).
+
+Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
+Acked-by: Matthias Fuchs <matthias.fuchs@esd.eu>
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/can/usb/esd_usb2.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/net/can/usb/esd_usb2.c
++++ b/drivers/net/can/usb/esd_usb2.c
+@@ -1141,6 +1141,7 @@ static void esd_usb2_disconnect(struct u
+                       }
+               }
+               unlink_all_urbs(dev);
++              kfree(dev);
+       }
+ }
index 9f96d449a67dbe660b89346394baabd5c5a0b442..54132cc678035ea3b7c0214ba9cd5911e0ffa4f1 100644 (file)
@@ -30,3 +30,15 @@ of-base-fix-powerpc-address-parsing-hack.patch
 powerpc-pseries-honor-the-generic-no_64bit_msi-flag.patch
 powerpc-pseries-fix-endiannes-issue-in-rtas-call-from-xmon.patch
 iio-fix-iio_event_code_extract_dir-bit-mask.patch
+staging-r8188eu-add-new-device-id-for-dlink-go-usb-n150.patch
+usb-ssu100-fix-overrun-error-reporting.patch
+usb-keyspan-fix-overrun-error-reporting.patch
+usb-keyspan-fix-tty-line-status-reporting.patch
+usb-serial-cp210x-add-ids-for-cel-meshconnect-usb-stick.patch
+usb-serial-ftdi_sio-add-pids-for-matrix-orbital-products.patch
+usb-quirks-add-reset-resume-quirk-for-ms-wireless-laser-mouse-6000.patch
+usb-xhci-don-t-start-a-halted-endpoint-before-its-new-dequeue-is-set.patch
+usb-xhci-rework-root-port-wake-bits-if-controller-isn-t-allowed-to-wakeup.patch
+can-esd_usb2-fix-memory-leak-on-disconnect.patch
+alsa-usb-audio-add-ctrl-message-delay-quirk-for.patch
+aio-fix-uncorrent-dirty-pages-accouting-when-truncating-aio-ring-buffer.patch
diff --git a/queue-3.14/staging-r8188eu-add-new-device-id-for-dlink-go-usb-n150.patch b/queue-3.14/staging-r8188eu-add-new-device-id-for-dlink-go-usb-n150.patch
new file mode 100644 (file)
index 0000000..118f7d7
--- /dev/null
@@ -0,0 +1,28 @@
+From 6d4556fc0309608f760f1d329df56d77fdd0c31a Mon Sep 17 00:00:00 2001
+From: Larry Finger <Larry.Finger@lwfinger.net>
+Date: Thu, 27 Nov 2014 10:10:21 -0600
+Subject: staging: r8188eu: Add new device ID for DLink GO-USB-N150
+
+From: Larry Finger <Larry.Finger@lwfinger.net>
+
+commit 6d4556fc0309608f760f1d329df56d77fdd0c31a upstream.
+
+The DLink GO-USB-N150 with revision B1 uses this driver.
+
+Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/staging/rtl8188eu/os_dep/usb_intf.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/staging/rtl8188eu/os_dep/usb_intf.c
++++ b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
+@@ -57,6 +57,7 @@ static struct usb_device_id rtw_usb_id_t
+       {USB_DEVICE(0x07b8, 0x8179)}, /* Abocom - Abocom */
+       {USB_DEVICE(0x2001, 0x330F)}, /* DLink DWA-125 REV D1 */
+       {USB_DEVICE(0x2001, 0x3310)}, /* Dlink DWA-123 REV D1 */
++      {USB_DEVICE(0x2001, 0x3311)}, /* DLink GO-USB-N150 REV B1 */
+       {USB_DEVICE(0x0df6, 0x0076)}, /* Sitecom N150 v2 */
+       {}      /* Terminating entry */
+ };
diff --git a/queue-3.14/usb-keyspan-fix-overrun-error-reporting.patch b/queue-3.14/usb-keyspan-fix-overrun-error-reporting.patch
new file mode 100644 (file)
index 0000000..824bd4c
--- /dev/null
@@ -0,0 +1,60 @@
+From 855515a6d3731242d85850a206f2ec084c917338 Mon Sep 17 00:00:00 2001
+From: Johan Hovold <johan@kernel.org>
+Date: Tue, 18 Nov 2014 11:25:20 +0100
+Subject: USB: keyspan: fix overrun-error reporting
+
+From: Johan Hovold <johan@kernel.org>
+
+commit 855515a6d3731242d85850a206f2ec084c917338 upstream.
+
+Fix reporting of overrun errors, which are not associated with a
+character. Instead insert a null character and report only once.
+
+Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
+Signed-off-by: Johan Hovold <johan@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/serial/keyspan.c |   21 +++++++++++----------
+ 1 file changed, 11 insertions(+), 10 deletions(-)
+
+--- a/drivers/usb/serial/keyspan.c
++++ b/drivers/usb/serial/keyspan.c
+@@ -311,12 +311,13 @@ static void      usa26_indat_callback(struct
+               if ((data[0] & 0x80) == 0) {
+                       /* no errors on individual bytes, only
+                          possible overrun err */
+-                      if (data[0] & RXERROR_OVERRUN)
+-                              err = TTY_OVERRUN;
+-                      else
+-                              err = 0;
++                      if (data[0] & RXERROR_OVERRUN) {
++                              tty_insert_flip_char(&port->port, 0,
++                                                              TTY_OVERRUN);
++                      }
+                       for (i = 1; i < urb->actual_length ; ++i)
+-                              tty_insert_flip_char(&port->port, data[i], err);
++                              tty_insert_flip_char(&port->port, data[i],
++                                                              TTY_NORMAL);
+               } else {
+                       /* some bytes had errors, every byte has status */
+                       dev_dbg(&port->dev, "%s - RX error!!!!\n", __func__);
+@@ -790,13 +791,13 @@ static void usa90_indat_callback(struct
+                       if ((data[0] & 0x80) == 0) {
+                               /* no errors on individual bytes, only
+                                  possible overrun err*/
+-                              if (data[0] & RXERROR_OVERRUN)
+-                                      err = TTY_OVERRUN;
+-                              else
+-                                      err = 0;
++                              if (data[0] & RXERROR_OVERRUN) {
++                                      tty_insert_flip_char(&port->port, 0,
++                                                              TTY_OVERRUN);
++                              }
+                               for (i = 1; i < urb->actual_length ; ++i)
+                                       tty_insert_flip_char(&port->port,
+-                                                      data[i], err);
++                                                      data[i], TTY_NORMAL);
+                       }  else {
+                       /* some bytes had errors, every byte has status */
+                               dev_dbg(&port->dev, "%s - RX error!!!!\n", __func__);
diff --git a/queue-3.14/usb-keyspan-fix-tty-line-status-reporting.patch b/queue-3.14/usb-keyspan-fix-tty-line-status-reporting.patch
new file mode 100644 (file)
index 0000000..ea9458d
--- /dev/null
@@ -0,0 +1,135 @@
+From 5d1678a33c731b56e245e888fdae5e88efce0997 Mon Sep 17 00:00:00 2001
+From: Johan Hovold <johan@kernel.org>
+Date: Tue, 18 Nov 2014 11:25:19 +0100
+Subject: USB: keyspan: fix tty line-status reporting
+
+From: Johan Hovold <johan@kernel.org>
+
+commit 5d1678a33c731b56e245e888fdae5e88efce0997 upstream.
+
+Fix handling of TTY error flags, which are not bitmasks and must
+specifically not be ORed together as this prevents the line discipline
+from recognising them.
+
+Also insert null characters when reporting overrun errors as these are
+not associated with the received character.
+
+Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
+Signed-off-by: Johan Hovold <johan@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/serial/keyspan.c |   76 +++++++++++++++++++++++++++----------------
+ 1 file changed, 48 insertions(+), 28 deletions(-)
+
+--- a/drivers/usb/serial/keyspan.c
++++ b/drivers/usb/serial/keyspan.c
+@@ -322,14 +322,19 @@ static void      usa26_indat_callback(struct
+                       /* some bytes had errors, every byte has status */
+                       dev_dbg(&port->dev, "%s - RX error!!!!\n", __func__);
+                       for (i = 0; i + 1 < urb->actual_length; i += 2) {
+-                              int stat = data[i], flag = 0;
+-                              if (stat & RXERROR_OVERRUN)
+-                                      flag |= TTY_OVERRUN;
+-                              if (stat & RXERROR_FRAMING)
+-                                      flag |= TTY_FRAME;
+-                              if (stat & RXERROR_PARITY)
+-                                      flag |= TTY_PARITY;
++                              int stat = data[i];
++                              int flag = TTY_NORMAL;
++
++                              if (stat & RXERROR_OVERRUN) {
++                                      tty_insert_flip_char(&port->port, 0,
++                                                              TTY_OVERRUN);
++                              }
+                               /* XXX should handle break (0x10) */
++                              if (stat & RXERROR_PARITY)
++                                      flag = TTY_PARITY;
++                              else if (stat & RXERROR_FRAMING)
++                                      flag = TTY_FRAME;
++
+                               tty_insert_flip_char(&port->port, data[i+1],
+                                               flag);
+                       }
+@@ -667,14 +672,19 @@ static void      usa49_indat_callback(struct
+               } else {
+                       /* some bytes had errors, every byte has status */
+                       for (i = 0; i + 1 < urb->actual_length; i += 2) {
+-                              int stat = data[i], flag = 0;
+-                              if (stat & RXERROR_OVERRUN)
+-                                      flag |= TTY_OVERRUN;
+-                              if (stat & RXERROR_FRAMING)
+-                                      flag |= TTY_FRAME;
+-                              if (stat & RXERROR_PARITY)
+-                                      flag |= TTY_PARITY;
++                              int stat = data[i];
++                              int flag = TTY_NORMAL;
++
++                              if (stat & RXERROR_OVERRUN) {
++                                      tty_insert_flip_char(&port->port, 0,
++                                                              TTY_OVERRUN);
++                              }
+                               /* XXX should handle break (0x10) */
++                              if (stat & RXERROR_PARITY)
++                                      flag = TTY_PARITY;
++                              else if (stat & RXERROR_FRAMING)
++                                      flag = TTY_FRAME;
++
+                               tty_insert_flip_char(&port->port, data[i+1],
+                                               flag);
+                       }
+@@ -731,15 +741,19 @@ static void usa49wg_indat_callback(struc
+                        */
+                       for (x = 0; x + 1 < len &&
+                                   i + 1 < urb->actual_length; x += 2) {
+-                              int stat = data[i], flag = 0;
++                              int stat = data[i];
++                              int flag = TTY_NORMAL;
+-                              if (stat & RXERROR_OVERRUN)
+-                                      flag |= TTY_OVERRUN;
+-                              if (stat & RXERROR_FRAMING)
+-                                      flag |= TTY_FRAME;
+-                              if (stat & RXERROR_PARITY)
+-                                      flag |= TTY_PARITY;
++                              if (stat & RXERROR_OVERRUN) {
++                                      tty_insert_flip_char(&port->port, 0,
++                                                              TTY_OVERRUN);
++                              }
+                               /* XXX should handle break (0x10) */
++                              if (stat & RXERROR_PARITY)
++                                      flag = TTY_PARITY;
++                              else if (stat & RXERROR_FRAMING)
++                                      flag = TTY_FRAME;
++
+                               tty_insert_flip_char(&port->port, data[i+1],
+                                                    flag);
+                               i += 2;
+@@ -802,14 +816,20 @@ static void usa90_indat_callback(struct
+                       /* some bytes had errors, every byte has status */
+                               dev_dbg(&port->dev, "%s - RX error!!!!\n", __func__);
+                               for (i = 0; i + 1 < urb->actual_length; i += 2) {
+-                                      int stat = data[i], flag = 0;
+-                                      if (stat & RXERROR_OVERRUN)
+-                                              flag |= TTY_OVERRUN;
+-                                      if (stat & RXERROR_FRAMING)
+-                                              flag |= TTY_FRAME;
+-                                      if (stat & RXERROR_PARITY)
+-                                              flag |= TTY_PARITY;
++                                      int stat = data[i];
++                                      int flag = TTY_NORMAL;
++
++                                      if (stat & RXERROR_OVERRUN) {
++                                              tty_insert_flip_char(
++                                                              &port->port, 0,
++                                                              TTY_OVERRUN);
++                                      }
+                                       /* XXX should handle break (0x10) */
++                                      if (stat & RXERROR_PARITY)
++                                              flag = TTY_PARITY;
++                                      else if (stat & RXERROR_FRAMING)
++                                              flag = TTY_FRAME;
++
+                                       tty_insert_flip_char(&port->port,
+                                                       data[i+1], flag);
+                               }
diff --git a/queue-3.14/usb-quirks-add-reset-resume-quirk-for-ms-wireless-laser-mouse-6000.patch b/queue-3.14/usb-quirks-add-reset-resume-quirk-for-ms-wireless-laser-mouse-6000.patch
new file mode 100644 (file)
index 0000000..1ff1b7c
--- /dev/null
@@ -0,0 +1,32 @@
+From 263e80b43559a6103e178a9176938ce171b23872 Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede@redhat.com>
+Date: Mon, 24 Nov 2014 11:22:38 +0100
+Subject: usb-quirks: Add reset-resume quirk for MS Wireless Laser Mouse 6000
+
+From: Hans de Goede <hdegoede@redhat.com>
+
+commit 263e80b43559a6103e178a9176938ce171b23872 upstream.
+
+This wireless mouse receiver needs a reset-resume quirk to properly come
+out of reset.
+
+BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1165206
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/core/quirks.c |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/usb/core/quirks.c
++++ b/drivers/usb/core/quirks.c
+@@ -44,6 +44,9 @@ static const struct usb_device_id usb_qu
+       /* Creative SB Audigy 2 NX */
+       { USB_DEVICE(0x041e, 0x3020), .driver_info = USB_QUIRK_RESET_RESUME },
++      /* Microsoft Wireless Laser Mouse 6000 Receiver */
++      { USB_DEVICE(0x045e, 0x00e1), .driver_info = USB_QUIRK_RESET_RESUME },
++
+       /* Microsoft LifeCam-VX700 v2.0 */
+       { USB_DEVICE(0x045e, 0x0770), .driver_info = USB_QUIRK_RESET_RESUME },
diff --git a/queue-3.14/usb-serial-cp210x-add-ids-for-cel-meshconnect-usb-stick.patch b/queue-3.14/usb-serial-cp210x-add-ids-for-cel-meshconnect-usb-stick.patch
new file mode 100644 (file)
index 0000000..5e9be92
--- /dev/null
@@ -0,0 +1,27 @@
+From ffcfe30ebd8dd703d0fc4324ffe56ea21f5479f4 Mon Sep 17 00:00:00 2001
+From: Preston Fick <pffick@gmail.com>
+Date: Fri, 7 Nov 2014 23:26:11 -0600
+Subject: USB: serial: cp210x: add IDs for CEL MeshConnect USB Stick
+
+From: Preston Fick <pffick@gmail.com>
+
+commit ffcfe30ebd8dd703d0fc4324ffe56ea21f5479f4 upstream.
+
+Signed-off-by: Preston Fick <pffick@gmail.com>
+Signed-off-by: Johan Hovold <johan@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/serial/cp210x.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/usb/serial/cp210x.c
++++ b/drivers/usb/serial/cp210x.c
+@@ -120,6 +120,7 @@ static const struct usb_device_id id_tab
+       { USB_DEVICE(0x10C4, 0x85F8) }, /* Virtenio Preon32 */
+       { USB_DEVICE(0x10C4, 0x8664) }, /* AC-Services CAN-IF */
+       { USB_DEVICE(0x10C4, 0x8665) }, /* AC-Services OBD-IF */
++      { USB_DEVICE(0x10C4, 0x8875) }, /* CEL MeshConnect USB Stick */
+       { USB_DEVICE(0x10C4, 0x88A4) }, /* MMB Networks ZigBee USB Device */
+       { USB_DEVICE(0x10C4, 0x88A5) }, /* Planet Innovation Ingeni ZigBee USB Device */
+       { USB_DEVICE(0x10C4, 0x8946) }, /* Ketra N1 Wireless Interface */
diff --git a/queue-3.14/usb-serial-ftdi_sio-add-pids-for-matrix-orbital-products.patch b/queue-3.14/usb-serial-ftdi_sio-add-pids-for-matrix-orbital-products.patch
new file mode 100644 (file)
index 0000000..9b6684a
--- /dev/null
@@ -0,0 +1,118 @@
+From 204ec6e07ea7aff863df0f7c53301f9cbbfbb9d3 Mon Sep 17 00:00:00 2001
+From: Troy Clark <tclark@matrixorbital.ca>
+Date: Mon, 17 Nov 2014 14:33:17 -0800
+Subject: usb: serial: ftdi_sio: add PIDs for Matrix Orbital products
+
+From: Troy Clark <tclark@matrixorbital.ca>
+
+commit 204ec6e07ea7aff863df0f7c53301f9cbbfbb9d3 upstream.
+
+Add PIDs for new Matrix Orbital GTT series products.
+
+Signed-off-by: Troy Clark <tclark@matrixorbital.ca>
+[johan: shorten commit message ]
+Signed-off-by: Johan Hovold <johan@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/serial/ftdi_sio.c     |   33 ++++++++++++++++++++++++++++++++
+ drivers/usb/serial/ftdi_sio_ids.h |   39 ++++++++++++++++++++++++++++++++++----
+ 2 files changed, 68 insertions(+), 4 deletions(-)
+
+--- a/drivers/usb/serial/ftdi_sio.c
++++ b/drivers/usb/serial/ftdi_sio.c
+@@ -483,6 +483,39 @@ static const struct usb_device_id id_tab
+       { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FD_PID) },
+       { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FE_PID) },
+       { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FF_PID) },
++      { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_4701_PID) },
++      { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9300_PID) },
++      { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9301_PID) },
++      { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9302_PID) },
++      { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9303_PID) },
++      { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9304_PID) },
++      { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9305_PID) },
++      { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9306_PID) },
++      { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9307_PID) },
++      { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9308_PID) },
++      { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9309_PID) },
++      { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930A_PID) },
++      { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930B_PID) },
++      { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930C_PID) },
++      { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930D_PID) },
++      { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930E_PID) },
++      { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930F_PID) },
++      { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9310_PID) },
++      { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9311_PID) },
++      { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9312_PID) },
++      { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9313_PID) },
++      { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9314_PID) },
++      { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9315_PID) },
++      { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9316_PID) },
++      { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9317_PID) },
++      { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9318_PID) },
++      { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9319_PID) },
++      { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931A_PID) },
++      { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931B_PID) },
++      { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931C_PID) },
++      { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931D_PID) },
++      { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931E_PID) },
++      { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931F_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_PERLE_ULTRAPORT_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_PIEGROUP_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_TNC_X_PID) },
+--- a/drivers/usb/serial/ftdi_sio_ids.h
++++ b/drivers/usb/serial/ftdi_sio_ids.h
+@@ -926,8 +926,8 @@
+ #define BAYER_CONTOUR_CABLE_PID        0x6001
+ /*
+- * The following are the values for the Matrix Orbital FTDI Range
+- * Anything in this range will use an FT232RL.
++ * Matrix Orbital Intelligent USB displays.
++ * http://www.matrixorbital.com
+  */
+ #define MTXORB_VID                    0x1B3D
+ #define MTXORB_FTDI_RANGE_0100_PID    0x0100
+@@ -1186,8 +1186,39 @@
+ #define MTXORB_FTDI_RANGE_01FD_PID    0x01FD
+ #define MTXORB_FTDI_RANGE_01FE_PID    0x01FE
+ #define MTXORB_FTDI_RANGE_01FF_PID    0x01FF
+-
+-
++#define MTXORB_FTDI_RANGE_4701_PID    0x4701
++#define MTXORB_FTDI_RANGE_9300_PID    0x9300
++#define MTXORB_FTDI_RANGE_9301_PID    0x9301
++#define MTXORB_FTDI_RANGE_9302_PID    0x9302
++#define MTXORB_FTDI_RANGE_9303_PID    0x9303
++#define MTXORB_FTDI_RANGE_9304_PID    0x9304
++#define MTXORB_FTDI_RANGE_9305_PID    0x9305
++#define MTXORB_FTDI_RANGE_9306_PID    0x9306
++#define MTXORB_FTDI_RANGE_9307_PID    0x9307
++#define MTXORB_FTDI_RANGE_9308_PID    0x9308
++#define MTXORB_FTDI_RANGE_9309_PID    0x9309
++#define MTXORB_FTDI_RANGE_930A_PID    0x930A
++#define MTXORB_FTDI_RANGE_930B_PID    0x930B
++#define MTXORB_FTDI_RANGE_930C_PID    0x930C
++#define MTXORB_FTDI_RANGE_930D_PID    0x930D
++#define MTXORB_FTDI_RANGE_930E_PID    0x930E
++#define MTXORB_FTDI_RANGE_930F_PID    0x930F
++#define MTXORB_FTDI_RANGE_9310_PID    0x9310
++#define MTXORB_FTDI_RANGE_9311_PID    0x9311
++#define MTXORB_FTDI_RANGE_9312_PID    0x9312
++#define MTXORB_FTDI_RANGE_9313_PID    0x9313
++#define MTXORB_FTDI_RANGE_9314_PID    0x9314
++#define MTXORB_FTDI_RANGE_9315_PID    0x9315
++#define MTXORB_FTDI_RANGE_9316_PID    0x9316
++#define MTXORB_FTDI_RANGE_9317_PID    0x9317
++#define MTXORB_FTDI_RANGE_9318_PID    0x9318
++#define MTXORB_FTDI_RANGE_9319_PID    0x9319
++#define MTXORB_FTDI_RANGE_931A_PID    0x931A
++#define MTXORB_FTDI_RANGE_931B_PID    0x931B
++#define MTXORB_FTDI_RANGE_931C_PID    0x931C
++#define MTXORB_FTDI_RANGE_931D_PID    0x931D
++#define MTXORB_FTDI_RANGE_931E_PID    0x931E
++#define MTXORB_FTDI_RANGE_931F_PID    0x931F
+ /*
+  * The Mobility Lab (TML)
diff --git a/queue-3.14/usb-ssu100-fix-overrun-error-reporting.patch b/queue-3.14/usb-ssu100-fix-overrun-error-reporting.patch
new file mode 100644 (file)
index 0000000..a5d7ea7
--- /dev/null
@@ -0,0 +1,49 @@
+From 75bcbf29c284dd0154c3e895a0bd1ef0e796160e Mon Sep 17 00:00:00 2001
+From: Johan Hovold <johan@kernel.org>
+Date: Tue, 18 Nov 2014 11:25:21 +0100
+Subject: USB: ssu100: fix overrun-error reporting
+
+From: Johan Hovold <johan@kernel.org>
+
+commit 75bcbf29c284dd0154c3e895a0bd1ef0e796160e upstream.
+
+Fix reporting of overrun errors, which should only be reported once
+using the inserted null character.
+
+Fixes: 6b8f1ca5581b ("USB: ssu100: set tty_flags in ssu100_process_packet")
+Signed-off-by: Johan Hovold <johan@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/serial/ssu100.c |   11 +++--------
+ 1 file changed, 3 insertions(+), 8 deletions(-)
+
+--- a/drivers/usb/serial/ssu100.c
++++ b/drivers/usb/serial/ssu100.c
+@@ -490,10 +490,9 @@ static void ssu100_update_lsr(struct usb
+                       if (*tty_flag == TTY_NORMAL)
+                               *tty_flag = TTY_FRAME;
+               }
+-              if (lsr & UART_LSR_OE){
++              if (lsr & UART_LSR_OE) {
+                       port->icount.overrun++;
+-                      if (*tty_flag == TTY_NORMAL)
+-                              *tty_flag = TTY_OVERRUN;
++                      tty_insert_flip_char(&port->port, 0, TTY_OVERRUN);
+               }
+       }
+@@ -511,12 +510,8 @@ static void ssu100_process_read_urb(stru
+       if ((len >= 4) &&
+           (packet[0] == 0x1b) && (packet[1] == 0x1b) &&
+           ((packet[2] == 0x00) || (packet[2] == 0x01))) {
+-              if (packet[2] == 0x00) {
++              if (packet[2] == 0x00)
+                       ssu100_update_lsr(port, packet[3], &flag);
+-                      if (flag == TTY_OVERRUN)
+-                              tty_insert_flip_char(&port->port, 0,
+-                                              TTY_OVERRUN);
+-              }
+               if (packet[2] == 0x01)
+                       ssu100_update_msr(port, packet[3]);
diff --git a/queue-3.14/usb-xhci-don-t-start-a-halted-endpoint-before-its-new-dequeue-is-set.patch b/queue-3.14/usb-xhci-don-t-start-a-halted-endpoint-before-its-new-dequeue-is-set.patch
new file mode 100644 (file)
index 0000000..981d3d1
--- /dev/null
@@ -0,0 +1,44 @@
+From c3492dbfa1050debf23a5b5cd2bc7514c5b37896 Mon Sep 17 00:00:00 2001
+From: Mathias Nyman <mathias.nyman@linux.intel.com>
+Date: Tue, 18 Nov 2014 11:27:11 +0200
+Subject: USB: xhci: don't start a halted endpoint before its new dequeue is set
+
+From: Mathias Nyman <mathias.nyman@linux.intel.com>
+
+commit c3492dbfa1050debf23a5b5cd2bc7514c5b37896 upstream.
+
+A halted endpoint ring must first be reset, then move the ring
+dequeue pointer past the problematic TRB. If we start the ring too
+early after reset, but before moving the dequeue pointer we
+will end up executing the same problematic TRB again.
+
+As we always issue a set transfer dequeue command after a reset
+endpoint command we can skip starting endpoint rings at reset endpoint
+command completion.
+
+Without this fix we end up trying to handle the same faulty TD for
+contol endpoints. causing timeout, and failing testusb ctrl_out write
+tests.
+
+Fixes: e9df17e (USB: xhci: Correct assumptions about number of rings per endpoint.)
+Tested-by: Felipe Balbi <balbi@ti.com>
+Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/host/xhci-ring.c |    3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/drivers/usb/host/xhci-ring.c
++++ b/drivers/usb/host/xhci-ring.c
+@@ -1180,9 +1180,8 @@ static void xhci_handle_cmd_reset_ep(str
+                               false);
+               xhci_ring_cmd_db(xhci);
+       } else {
+-              /* Clear our internal halted state and restart the ring(s) */
++              /* Clear our internal halted state */
+               xhci->devs[slot_id]->eps[ep_index].ep_state &= ~EP_HALTED;
+-              ring_doorbell_for_active_rings(xhci, slot_id, ep_index);
+       }
+ }
diff --git a/queue-3.14/usb-xhci-rework-root-port-wake-bits-if-controller-isn-t-allowed-to-wakeup.patch b/queue-3.14/usb-xhci-rework-root-port-wake-bits-if-controller-isn-t-allowed-to-wakeup.patch
new file mode 100644 (file)
index 0000000..79ca2c8
--- /dev/null
@@ -0,0 +1,143 @@
+From a1377e5397ab321e21b793ec8cd2b6f12bd3c718 Mon Sep 17 00:00:00 2001
+From: Lu Baolu <baolu.lu@linux.intel.com>
+Date: Tue, 18 Nov 2014 11:27:14 +0200
+Subject: usb: xhci: rework root port wake bits if controller isn't allowed to wakeup
+
+From: Lu Baolu <baolu.lu@linux.intel.com>
+
+commit a1377e5397ab321e21b793ec8cd2b6f12bd3c718 upstream.
+
+When system is being suspended, if host device is not allowed to do wakeup,
+xhci_suspend() needs to clear all root port wake on bits. Otherwise, some
+platforms may generate spurious wakeup, even if PCI PME# is disabled.
+
+The initial commit ff8cbf250b44 ("xhci: clear root port wake on bits"),
+which also got into stable, turned out to not work correctly and had to
+be reverted, and is now rewritten.
+
+Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
+Suggested-by: Alan Stern <stern@rowland.harvard.edu>
+Acked-by: Alan Stern <stern@rowland.harvard.edu>
+[Mathias Nyman: reword commit message]
+Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/host/xhci-pci.c  |    2 +-
+ drivers/usb/host/xhci-plat.c |   10 +++++++++-
+ drivers/usb/host/xhci.c      |   42 +++++++++++++++++++++++++++++++++++++++++-
+ drivers/usb/host/xhci.h      |    2 +-
+ 4 files changed, 52 insertions(+), 4 deletions(-)
+
+--- a/drivers/usb/host/xhci-pci.c
++++ b/drivers/usb/host/xhci-pci.c
+@@ -281,7 +281,7 @@ static int xhci_pci_suspend(struct usb_h
+       if (xhci_compliance_mode_recovery_timer_quirk_check())
+               pdev->no_d3cold = true;
+-      return xhci_suspend(xhci);
++      return xhci_suspend(xhci, do_wakeup);
+ }
+ static int xhci_pci_resume(struct usb_hcd *hcd, bool hibernated)
+--- a/drivers/usb/host/xhci-plat.c
++++ b/drivers/usb/host/xhci-plat.c
+@@ -205,7 +205,15 @@ static int xhci_plat_suspend(struct devi
+       struct usb_hcd  *hcd = dev_get_drvdata(dev);
+       struct xhci_hcd *xhci = hcd_to_xhci(hcd);
+-      return xhci_suspend(xhci);
++      /*
++       * xhci_suspend() needs `do_wakeup` to know whether host is allowed
++       * to do wakeup during suspend. Since xhci_plat_suspend is currently
++       * only designed for system suspend, device_may_wakeup() is enough
++       * to dertermine whether host is allowed to do wakeup. Need to
++       * reconsider this when xhci_plat_suspend enlarges its scope, e.g.,
++       * also applies to runtime suspend.
++       */
++      return xhci_suspend(xhci, device_may_wakeup(dev));
+ }
+ static int xhci_plat_resume(struct device *dev)
+--- a/drivers/usb/host/xhci.c
++++ b/drivers/usb/host/xhci.c
+@@ -35,6 +35,8 @@
+ #define DRIVER_AUTHOR "Sarah Sharp"
+ #define DRIVER_DESC "'eXtensible' Host Controller (xHC) Driver"
++#define       PORT_WAKE_BITS  (PORT_WKOC_E | PORT_WKDISC_E | PORT_WKCONN_E)
++
+ /* Some 0.95 hardware can't handle the chain bit on a Link TRB being cleared */
+ static int link_quirk;
+ module_param(link_quirk, int, S_IRUGO | S_IWUSR);
+@@ -842,13 +844,47 @@ static void xhci_clear_command_ring(stru
+       xhci_set_cmd_ring_deq(xhci);
+ }
++static void xhci_disable_port_wake_on_bits(struct xhci_hcd *xhci)
++{
++      int port_index;
++      __le32 __iomem **port_array;
++      unsigned long flags;
++      u32 t1, t2;
++
++      spin_lock_irqsave(&xhci->lock, flags);
++
++      /* disble usb3 ports Wake bits*/
++      port_index = xhci->num_usb3_ports;
++      port_array = xhci->usb3_ports;
++      while (port_index--) {
++              t1 = readl(port_array[port_index]);
++              t1 = xhci_port_state_to_neutral(t1);
++              t2 = t1 & ~PORT_WAKE_BITS;
++              if (t1 != t2)
++                      writel(t2, port_array[port_index]);
++      }
++
++      /* disble usb2 ports Wake bits*/
++      port_index = xhci->num_usb2_ports;
++      port_array = xhci->usb2_ports;
++      while (port_index--) {
++              t1 = readl(port_array[port_index]);
++              t1 = xhci_port_state_to_neutral(t1);
++              t2 = t1 & ~PORT_WAKE_BITS;
++              if (t1 != t2)
++                      writel(t2, port_array[port_index]);
++      }
++
++      spin_unlock_irqrestore(&xhci->lock, flags);
++}
++
+ /*
+  * Stop HC (not bus-specific)
+  *
+  * This is called when the machine transition into S3/S4 mode.
+  *
+  */
+-int xhci_suspend(struct xhci_hcd *xhci)
++int xhci_suspend(struct xhci_hcd *xhci, bool do_wakeup)
+ {
+       int                     rc = 0;
+       unsigned int            delay = XHCI_MAX_HALT_USEC;
+@@ -859,6 +895,10 @@ int xhci_suspend(struct xhci_hcd *xhci)
+                       xhci->shared_hcd->state != HC_STATE_SUSPENDED)
+               return -EINVAL;
++      /* Clear root port wake on bits if wakeup not allowed. */
++      if (!do_wakeup)
++              xhci_disable_port_wake_on_bits(xhci);
++
+       /* Don't poll the roothubs on bus suspend. */
+       xhci_dbg(xhci, "%s: stopping port polling.\n", __func__);
+       clear_bit(HCD_FLAG_POLL_RH, &hcd->flags);
+--- a/drivers/usb/host/xhci.h
++++ b/drivers/usb/host/xhci.h
+@@ -1760,7 +1760,7 @@ void xhci_shutdown(struct usb_hcd *hcd);
+ int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks);
+ #ifdef        CONFIG_PM
+-int xhci_suspend(struct xhci_hcd *xhci);
++int xhci_suspend(struct xhci_hcd *xhci, bool do_wakeup);
+ int xhci_resume(struct xhci_hcd *xhci, bool hibernated);
+ #else
+ #define       xhci_suspend    NULL