]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.17-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Dec 2014 23:33:51 +0000 (15:33 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Dec 2014 23:33:51 +0000 (15:33 -0800)
added patches:
aio-fix-uncorrent-dirty-pages-accouting-when-truncating-aio-ring-buffer.patch
alsa-hda-limit-40bit-dma-for-amd-hdmi-controllers.patch
alsa-hda-one-more-hp-machine-needs-to-change-mute-led-quirk.patch
alsa-usb-audio-add-ctrl-message-delay-quirk-for.patch
btrfs-fix-lockups-from-btrfs_clear_path_blocking.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-uas-add-no-uas-quirk-for-hitachi-usb-3-enclosures-4971-1012.patch
usb-xhci-don-t-start-a-halted-endpoint-before-its-new-dequeue-is-set.patch
usb-xhci-reset-a-halted-endpoint-immediately-when-we-encounter-a-stall.patch
usb-xhci-rework-root-port-wake-bits-if-controller-isn-t-allowed-to-wakeup.patch

18 files changed:
queue-3.17/aio-fix-uncorrent-dirty-pages-accouting-when-truncating-aio-ring-buffer.patch [new file with mode: 0644]
queue-3.17/alsa-hda-limit-40bit-dma-for-amd-hdmi-controllers.patch [new file with mode: 0644]
queue-3.17/alsa-hda-one-more-hp-machine-needs-to-change-mute-led-quirk.patch [new file with mode: 0644]
queue-3.17/alsa-usb-audio-add-ctrl-message-delay-quirk-for.patch [new file with mode: 0644]
queue-3.17/btrfs-fix-lockups-from-btrfs_clear_path_blocking.patch [new file with mode: 0644]
queue-3.17/can-esd_usb2-fix-memory-leak-on-disconnect.patch [new file with mode: 0644]
queue-3.17/series
queue-3.17/staging-r8188eu-add-new-device-id-for-dlink-go-usb-n150.patch [new file with mode: 0644]
queue-3.17/usb-keyspan-fix-overrun-error-reporting.patch [new file with mode: 0644]
queue-3.17/usb-keyspan-fix-tty-line-status-reporting.patch [new file with mode: 0644]
queue-3.17/usb-quirks-add-reset-resume-quirk-for-ms-wireless-laser-mouse-6000.patch [new file with mode: 0644]
queue-3.17/usb-serial-cp210x-add-ids-for-cel-meshconnect-usb-stick.patch [new file with mode: 0644]
queue-3.17/usb-serial-ftdi_sio-add-pids-for-matrix-orbital-products.patch [new file with mode: 0644]
queue-3.17/usb-ssu100-fix-overrun-error-reporting.patch [new file with mode: 0644]
queue-3.17/usb-uas-add-no-uas-quirk-for-hitachi-usb-3-enclosures-4971-1012.patch [new file with mode: 0644]
queue-3.17/usb-xhci-don-t-start-a-halted-endpoint-before-its-new-dequeue-is-set.patch [new file with mode: 0644]
queue-3.17/usb-xhci-reset-a-halted-endpoint-immediately-when-we-encounter-a-stall.patch [new file with mode: 0644]
queue-3.17/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.17/aio-fix-uncorrent-dirty-pages-accouting-when-truncating-aio-ring-buffer.patch b/queue-3.17/aio-fix-uncorrent-dirty-pages-accouting-when-truncating-aio-ring-buffer.patch
new file mode 100644 (file)
index 0000000..e0829d2
--- /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);
+@@ -220,6 +230,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);
+@@ -281,11 +294,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)
+@@ -357,7 +365,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
+@@ -412,7 +420,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.17/alsa-hda-limit-40bit-dma-for-amd-hdmi-controllers.patch b/queue-3.17/alsa-hda-limit-40bit-dma-for-amd-hdmi-controllers.patch
new file mode 100644 (file)
index 0000000..6c6d426
--- /dev/null
@@ -0,0 +1,63 @@
+From 413cbf469a19e7662ba5025695bf5a573927105a Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Wed, 1 Oct 2014 10:30:53 +0200
+Subject: ALSA: hda - Limit 40bit DMA for AMD HDMI controllers
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 413cbf469a19e7662ba5025695bf5a573927105a upstream.
+
+AMD/ATI HDMI controller chip models, we already have a filter to lower
+to 32bit DMA, but the rest are supposed to be working with 64bit
+although the hardware doesn't really work with 63bit but only with 40
+or 48bit DMA.  In this patch, we take 40bit DMA for safety for the
+AMD/ATI controllers as the graphics drivers does.
+
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/hda/hda_intel.c |   14 +++++++++++---
+ 1 file changed, 11 insertions(+), 3 deletions(-)
+
+--- a/sound/pci/hda/hda_intel.c
++++ b/sound/pci/hda/hda_intel.c
+@@ -1484,6 +1484,7 @@ static int azx_first_init(struct azx *ch
+       struct snd_card *card = chip->card;
+       int err;
+       unsigned short gcap;
++      unsigned int dma_bits = 64;
+ #if BITS_PER_LONG != 64
+       /* Fix up base address on ULI M5461 */
+@@ -1520,9 +1521,14 @@ static int azx_first_init(struct azx *ch
+       gcap = azx_readw(chip, GCAP);
+       dev_dbg(card->dev, "chipset global capabilities = 0x%x\n", gcap);
++      /* AMD devices support 40 or 48bit DMA, take the safe one */
++      if (chip->pci->vendor == PCI_VENDOR_ID_AMD)
++              dma_bits = 40;
++
+       /* disable SB600 64bit support for safety */
+       if (chip->pci->vendor == PCI_VENDOR_ID_ATI) {
+               struct pci_dev *p_smbus;
++              dma_bits = 40;
+               p_smbus = pci_get_device(PCI_VENDOR_ID_ATI,
+                                        PCI_DEVICE_ID_ATI_SBX00_SMBUS,
+                                        NULL);
+@@ -1552,9 +1558,11 @@ static int azx_first_init(struct azx *ch
+       }
+       /* allow 64bit DMA address if supported by H/W */
+-      if ((gcap & AZX_GCAP_64OK) && !pci_set_dma_mask(pci, DMA_BIT_MASK(64)))
+-              pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(64));
+-      else {
++      if (!(gcap & AZX_GCAP_64OK))
++              dma_bits = 32;
++      if (!pci_set_dma_mask(pci, DMA_BIT_MASK(dma_bits))) {
++              pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(dma_bits));
++      } else {
+               pci_set_dma_mask(pci, DMA_BIT_MASK(32));
+               pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(32));
+       }
diff --git a/queue-3.17/alsa-hda-one-more-hp-machine-needs-to-change-mute-led-quirk.patch b/queue-3.17/alsa-hda-one-more-hp-machine-needs-to-change-mute-led-quirk.patch
new file mode 100644 (file)
index 0000000..b6cd063
--- /dev/null
@@ -0,0 +1,37 @@
+From 911f632c701d9f15a54076cbaca82e7defb339e0 Mon Sep 17 00:00:00 2001
+From: Hui Wang <hui.wang@canonical.com>
+Date: Fri, 21 Nov 2014 17:05:01 +0800
+Subject: ALSA: hda - One more HP machine needs to change mute led quirk
+
+From: Hui Wang <hui.wang@canonical.com>
+
+commit 911f632c701d9f15a54076cbaca82e7defb339e0 upstream.
+
+The machine originally use the quirk ALC269_FIXUP_HP_GPIO_MIC1_LED,
+but the LED doesn't work at all.
+
+After this change, the machine will change to use
+ALC269_FIXUP_HP_MUTE_LED_MIC1 through pin_fixup_tbl[], and the LED
+works well.
+
+BugLink: https://bugs.launchpad.net/bugs/1389497
+Tested-by: TieFu Chen <tienfu.chen@canonical.com>
+Cc: Kailang Yang <kailang@realtek.com>
+Signed-off-by: Hui Wang <hui.wang@canonical.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/hda/patch_realtek.c |    1 -
+ 1 file changed, 1 deletion(-)
+
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -5007,7 +5007,6 @@ static const struct snd_pci_quirk alc269
+       SND_PCI_QUIRK(0x103c, 0x2223, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
+       SND_PCI_QUIRK(0x103c, 0x2224, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
+       SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
+-      SND_PCI_QUIRK(0x103c, 0x2246, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
+       SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
+       SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
+       SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
diff --git a/queue-3.17/alsa-usb-audio-add-ctrl-message-delay-quirk-for.patch b/queue-3.17/alsa-usb-audio-add-ctrl-message-delay-quirk-for.patch
new file mode 100644 (file)
index 0000000..e45210d
--- /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
+@@ -1146,6 +1146,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.17/btrfs-fix-lockups-from-btrfs_clear_path_blocking.patch b/queue-3.17/btrfs-fix-lockups-from-btrfs_clear_path_blocking.patch
new file mode 100644 (file)
index 0000000..e466ceb
--- /dev/null
@@ -0,0 +1,140 @@
+From f82c458a2c3ffb94b431fc6ad791a79df1b3713e Mon Sep 17 00:00:00 2001
+From: Chris Mason <clm@fb.com>
+Date: Wed, 19 Nov 2014 10:25:09 -0800
+Subject: btrfs: fix lockups from btrfs_clear_path_blocking
+
+From: Chris Mason <clm@fb.com>
+
+commit f82c458a2c3ffb94b431fc6ad791a79df1b3713e upstream.
+
+The fair reader/writer locks mean that btrfs_clear_path_blocking needs
+to strictly follow lock ordering rules even when we already have
+blocking locks on a given path.
+
+Before we can clear a blocking lock on the path, we need to make sure
+all of the locks have been converted to blocking.  This will remove lock
+inversions against anyone spinning in write_lock() against the buffers
+we're trying to get read locks on.  These inversions didn't exist before
+the fair read/writer locks, but now we need to be more careful.
+
+We papered over this deadlock in the past by changing
+btrfs_try_read_lock() to be a true trylock against both the spinlock and
+the blocking lock.  This was slower, and not sufficient to fix all the
+deadlocks.  This patch adds a btrfs_tree_read_lock_atomic(), which
+basically means get the spinlock but trylock on the blocking lock.
+
+Signed-off-by: Chris Mason <clm@fb.com>
+Signed-off-by: Josef Bacik <jbacik@fb.com>
+Reported-by: Patrick Schmid <schmid@phys.ethz.ch>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/btrfs/ctree.c   |   14 ++------------
+ fs/btrfs/locking.c |   24 +++++++++++++++++++++---
+ fs/btrfs/locking.h |    2 ++
+ 3 files changed, 25 insertions(+), 15 deletions(-)
+
+--- a/fs/btrfs/ctree.c
++++ b/fs/btrfs/ctree.c
+@@ -80,13 +80,6 @@ noinline void btrfs_clear_path_blocking(
+ {
+       int i;
+-#ifdef CONFIG_DEBUG_LOCK_ALLOC
+-      /* lockdep really cares that we take all of these spinlocks
+-       * in the right order.  If any of the locks in the path are not
+-       * currently blocking, it is going to complain.  So, make really
+-       * really sure by forcing the path to blocking before we clear
+-       * the path blocking.
+-       */
+       if (held) {
+               btrfs_set_lock_blocking_rw(held, held_rw);
+               if (held_rw == BTRFS_WRITE_LOCK)
+@@ -95,7 +88,6 @@ noinline void btrfs_clear_path_blocking(
+                       held_rw = BTRFS_READ_LOCK_BLOCKING;
+       }
+       btrfs_set_path_blocking(p);
+-#endif
+       for (i = BTRFS_MAX_LEVEL - 1; i >= 0; i--) {
+               if (p->nodes[i] && p->locks[i]) {
+@@ -107,10 +99,8 @@ noinline void btrfs_clear_path_blocking(
+               }
+       }
+-#ifdef CONFIG_DEBUG_LOCK_ALLOC
+       if (held)
+               btrfs_clear_lock_blocking_rw(held, held_rw);
+-#endif
+ }
+ /* this also releases the path */
+@@ -2902,7 +2892,7 @@ cow_done:
+                                       }
+                                       p->locks[level] = BTRFS_WRITE_LOCK;
+                               } else {
+-                                      err = btrfs_try_tree_read_lock(b);
++                                      err = btrfs_tree_read_lock_atomic(b);
+                                       if (!err) {
+                                               btrfs_set_path_blocking(p);
+                                               btrfs_tree_read_lock(b);
+@@ -3034,7 +3024,7 @@ again:
+                       }
+                       level = btrfs_header_level(b);
+-                      err = btrfs_try_tree_read_lock(b);
++                      err = btrfs_tree_read_lock_atomic(b);
+                       if (!err) {
+                               btrfs_set_path_blocking(p);
+                               btrfs_tree_read_lock(b);
+--- a/fs/btrfs/locking.c
++++ b/fs/btrfs/locking.c
+@@ -128,6 +128,26 @@ again:
+ }
+ /*
++ * take a spinning read lock.
++ * returns 1 if we get the read lock and 0 if we don't
++ * this won't wait for blocking writers
++ */
++int btrfs_tree_read_lock_atomic(struct extent_buffer *eb)
++{
++      if (atomic_read(&eb->blocking_writers))
++              return 0;
++
++      read_lock(&eb->lock);
++      if (atomic_read(&eb->blocking_writers)) {
++              read_unlock(&eb->lock);
++              return 0;
++      }
++      atomic_inc(&eb->read_locks);
++      atomic_inc(&eb->spinning_readers);
++      return 1;
++}
++
++/*
+  * returns 1 if we get the read lock and 0 if we don't
+  * this won't wait for blocking writers
+  */
+@@ -158,9 +178,7 @@ int btrfs_try_tree_write_lock(struct ext
+           atomic_read(&eb->blocking_readers))
+               return 0;
+-      if (!write_trylock(&eb->lock))
+-              return 0;
+-
++      write_lock(&eb->lock);
+       if (atomic_read(&eb->blocking_writers) ||
+           atomic_read(&eb->blocking_readers)) {
+               write_unlock(&eb->lock);
+--- a/fs/btrfs/locking.h
++++ b/fs/btrfs/locking.h
+@@ -35,6 +35,8 @@ void btrfs_clear_lock_blocking_rw(struct
+ void btrfs_assert_tree_locked(struct extent_buffer *eb);
+ int btrfs_try_tree_read_lock(struct extent_buffer *eb);
+ int btrfs_try_tree_write_lock(struct extent_buffer *eb);
++int btrfs_tree_read_lock_atomic(struct extent_buffer *eb);
++
+ static inline void btrfs_tree_unlock_rw(struct extent_buffer *eb, int rw)
+ {
diff --git a/queue-3.17/can-esd_usb2-fix-memory-leak-on-disconnect.patch b/queue-3.17/can-esd_usb2-fix-memory-leak-on-disconnect.patch
new file mode 100644 (file)
index 0000000..aa7396b
--- /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
+@@ -1143,6 +1143,7 @@ static void esd_usb2_disconnect(struct u
+                       }
+               }
+               unlink_all_urbs(dev);
++              kfree(dev);
+       }
+ }
index ec490baf43710989b9564e04fdc55483060ab8f0..36694951145a179cd0a0d43dcacaa41e8a443100 100644 (file)
@@ -49,3 +49,20 @@ powerpc-pseries-fix-endiannes-issue-in-rtas-call-from-xmon.patch
 powerpc-powernv-fix-the-hmi-event-version-check.patch
 iio-fix-iio_event_code_extract_dir-bit-mask.patch
 iio-adc-men_z188_adc-add-terminating-entry-for.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-uas-add-no-uas-quirk-for-hitachi-usb-3-enclosures-4971-1012.patch
+usb-xhci-don-t-start-a-halted-endpoint-before-its-new-dequeue-is-set.patch
+usb-xhci-reset-a-halted-endpoint-immediately-when-we-encounter-a-stall.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
+alsa-hda-limit-40bit-dma-for-amd-hdmi-controllers.patch
+alsa-hda-one-more-hp-machine-needs-to-change-mute-led-quirk.patch
+aio-fix-uncorrent-dirty-pages-accouting-when-truncating-aio-ring-buffer.patch
+btrfs-fix-lockups-from-btrfs_clear_path_blocking.patch
diff --git a/queue-3.17/staging-r8188eu-add-new-device-id-for-dlink-go-usb-n150.patch b/queue-3.17/staging-r8188eu-add-new-device-id-for-dlink-go-usb-n150.patch
new file mode 100644 (file)
index 0000000..971cf03
--- /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
+@@ -47,6 +47,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.17/usb-keyspan-fix-overrun-error-reporting.patch b/queue-3.17/usb-keyspan-fix-overrun-error-reporting.patch
new file mode 100644 (file)
index 0000000..16980e2
--- /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__);
+@@ -773,13 +774,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.17/usb-keyspan-fix-tty-line-status-reporting.patch b/queue-3.17/usb-keyspan-fix-tty-line-status-reporting.patch
new file mode 100644 (file)
index 0000000..002b988
--- /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);
+                       }
+@@ -650,14 +655,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);
+                       }
+@@ -714,15 +724,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;
+@@ -785,14 +799,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.17/usb-quirks-add-reset-resume-quirk-for-ms-wireless-laser-mouse-6000.patch b/queue-3.17/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.17/usb-serial-cp210x-add-ids-for-cel-meshconnect-usb-stick.patch b/queue-3.17/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.17/usb-serial-ftdi_sio-add-pids-for-matrix-orbital-products.patch b/queue-3.17/usb-serial-ftdi_sio-add-pids-for-matrix-orbital-products.patch
new file mode 100644 (file)
index 0000000..b19003a
--- /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
+@@ -470,6 +470,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.17/usb-ssu100-fix-overrun-error-reporting.patch b/queue-3.17/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.17/usb-uas-add-no-uas-quirk-for-hitachi-usb-3-enclosures-4971-1012.patch b/queue-3.17/usb-uas-add-no-uas-quirk-for-hitachi-usb-3-enclosures-4971-1012.patch
new file mode 100644 (file)
index 0000000..c5ab803
--- /dev/null
@@ -0,0 +1,32 @@
+From 8daee1352d51a32676b84bddcc0e3252d1caa833 Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede@redhat.com>
+Date: Fri, 21 Nov 2014 13:28:03 +0100
+Subject: USB: uas: Add no-uas quirk for Hitachi usb-3 enclosures 4971:1012
+
+From: Hans de Goede <hdegoede@redhat.com>
+
+commit 8daee1352d51a32676b84bddcc0e3252d1caa833 upstream.
+
+These disks have a broken uas implementation, the tag field of the status
+iu-s is not set properly, so we need to fall-back to usb-storage for these.
+
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/storage/unusual_uas.h |    7 +++++++
+ 1 file changed, 7 insertions(+)
+
+--- a/drivers/usb/storage/unusual_uas.h
++++ b/drivers/usb/storage/unusual_uas.h
+@@ -103,3 +103,10 @@ UNUSUAL_DEV(0x2109, 0x0711, 0x0000, 0x99
+               "VL711",
+               USB_SC_DEVICE, USB_PR_DEVICE, NULL,
+               US_FL_NO_ATA_1X),
++
++/* Reported-by: Hans de Goede <hdegoede@redhat.com> */
++UNUSUAL_DEV(0x4971, 0x1012, 0x0000, 0x9999,
++              "Hitachi",
++              "External HDD",
++              USB_SC_DEVICE, USB_PR_DEVICE, NULL,
++              US_FL_IGNORE_UAS),
diff --git a/queue-3.17/usb-xhci-don-t-start-a-halted-endpoint-before-its-new-dequeue-is-set.patch b/queue-3.17/usb-xhci-don-t-start-a-halted-endpoint-before-its-new-dequeue-is-set.patch
new file mode 100644 (file)
index 0000000..853fe66
--- /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
+@@ -1106,9 +1106,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.17/usb-xhci-reset-a-halted-endpoint-immediately-when-we-encounter-a-stall.patch b/queue-3.17/usb-xhci-reset-a-halted-endpoint-immediately-when-we-encounter-a-stall.patch
new file mode 100644 (file)
index 0000000..bf6cbb9
--- /dev/null
@@ -0,0 +1,181 @@
+From 8e71a322fdb127814bcba423a512914ca5bc6cf5 Mon Sep 17 00:00:00 2001
+From: Mathias Nyman <mathias.nyman@linux.intel.com>
+Date: Tue, 18 Nov 2014 11:27:12 +0200
+Subject: USB: xhci: Reset a halted endpoint immediately when we encounter a stall.
+
+From: Mathias Nyman <mathias.nyman@linux.intel.com>
+
+commit 8e71a322fdb127814bcba423a512914ca5bc6cf5 upstream.
+
+If a device is halted and reuturns a STALL, then the halted endpoint
+needs to be cleared both on the host and device side. The host
+side halt is cleared by issueing a xhci reset endpoint command. The device side
+is cleared with a ClearFeature(ENDPOINT_HALT) request, which should
+be issued by the device driver if a URB reruen -EPIPE.
+
+Previously we cleared the host side halt after the device side was cleared.
+To make sure the host side halt is cleared in time we want to issue the
+reset endpoint command immedialtely when a STALL status is encountered.
+
+Otherwise we end up not following the specs and not returning -EPIPE
+several times in a row when trying to transfer data to a halted endpoint.
+
+Fixes: bcef3fd (USB: xhci: Handle errors that cause endpoint halts.)
+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 |   40 ++++++--------------------
+ drivers/usb/host/xhci.c      |   65 +++++++++----------------------------------
+ 2 files changed, 25 insertions(+), 80 deletions(-)
+
+--- a/drivers/usb/host/xhci-ring.c
++++ b/drivers/usb/host/xhci-ring.c
+@@ -1850,22 +1850,13 @@ static int finish_td(struct xhci_hcd *xh
+               ep->stopped_td = td;
+               return 0;
+       } else {
+-              if (trb_comp_code == COMP_STALL) {
+-                      /* The transfer is completed from the driver's
+-                       * perspective, but we need to issue a set dequeue
+-                       * command for this stalled endpoint to move the dequeue
+-                       * pointer past the TD.  We can't do that here because
+-                       * the halt condition must be cleared first.  Let the
+-                       * USB class driver clear the stall later.
+-                       */
+-                      ep->stopped_td = td;
+-                      ep->stopped_stream = ep_ring->stream_id;
+-              } else if (xhci_requires_manual_halt_cleanup(xhci,
+-                                      ep_ctx, trb_comp_code)) {
+-                      /* Other types of errors halt the endpoint, but the
+-                       * class driver doesn't call usb_reset_endpoint() unless
+-                       * the error is -EPIPE.  Clear the halted status in the
+-                       * xHCI hardware manually.
++              if (trb_comp_code == COMP_STALL ||
++                  xhci_requires_manual_halt_cleanup(xhci, ep_ctx,
++                                                    trb_comp_code)) {
++                      /* Issue a reset endpoint command to clear the host side
++                       * halt, followed by a set dequeue command to move the
++                       * dequeue pointer past the TD.
++                       * The class driver clears the device side halt later.
+                        */
+                       xhci_cleanup_halted_endpoint(xhci,
+                                       slot_id, ep_index, ep_ring->stream_id,
+@@ -1985,9 +1976,7 @@ static int process_ctrl_td(struct xhci_h
+               else
+                       td->urb->actual_length = 0;
+-              xhci_cleanup_halted_endpoint(xhci,
+-                      slot_id, ep_index, 0, td, event_trb);
+-              return finish_td(xhci, td, event_trb, event, ep, status, true);
++              return finish_td(xhci, td, event_trb, event, ep, status, false);
+       }
+       /*
+        * Did we transfer any data, despite the errors that might have
+@@ -2541,17 +2530,8 @@ cleanup:
+               if (ret) {
+                       urb = td->urb;
+                       urb_priv = urb->hcpriv;
+-                      /* Leave the TD around for the reset endpoint function
+-                       * to use(but only if it's not a control endpoint,
+-                       * since we already queued the Set TR dequeue pointer
+-                       * command for stalled control endpoints).
+-                       */
+-                      if (usb_endpoint_xfer_control(&urb->ep->desc) ||
+-                              (trb_comp_code != COMP_STALL &&
+-                                      trb_comp_code != COMP_BABBLE))
+-                              xhci_urb_free_priv(xhci, urb_priv);
+-                      else
+-                              kfree(urb_priv);
++
++                      xhci_urb_free_priv(xhci, urb_priv);
+                       usb_hcd_unlink_urb_from_ep(bus_to_hcd(urb->dev->bus), urb);
+                       if ((urb->actual_length != urb->transfer_buffer_length &&
+--- a/drivers/usb/host/xhci.c
++++ b/drivers/usb/host/xhci.c
+@@ -2910,68 +2910,33 @@ void xhci_cleanup_stalled_ring(struct xh
+       }
+ }
+-/* Deal with stalled endpoints.  The core should have sent the control message
+- * to clear the halt condition.  However, we need to make the xHCI hardware
+- * reset its sequence number, since a device will expect a sequence number of
+- * zero after the halt condition is cleared.
++/* Called when clearing halted device. The core should have sent the control
++ * message to clear the device halt condition. The host side of the halt should
++ * already be cleared with a reset endpoint command issued when the STALL tx
++ * event was received.
++ *
+  * Context: in_interrupt
+  */
++
+ void xhci_endpoint_reset(struct usb_hcd *hcd,
+               struct usb_host_endpoint *ep)
+ {
+       struct xhci_hcd *xhci;
+-      struct usb_device *udev;
+-      unsigned int ep_index;
+-      unsigned long flags;
+-      int ret;
+-      struct xhci_virt_ep *virt_ep;
+-      struct xhci_command *command;
+       xhci = hcd_to_xhci(hcd);
+-      udev = (struct usb_device *) ep->hcpriv;
+-      /* Called with a root hub endpoint (or an endpoint that wasn't added
+-       * with xhci_add_endpoint()
+-       */
+-      if (!ep->hcpriv)
+-              return;
+-      ep_index = xhci_get_endpoint_index(&ep->desc);
+-      virt_ep = &xhci->devs[udev->slot_id]->eps[ep_index];
+-      if (!virt_ep->stopped_td) {
+-              xhci_dbg_trace(xhci, trace_xhci_dbg_reset_ep,
+-                      "Endpoint 0x%x not halted, refusing to reset.",
+-                      ep->desc.bEndpointAddress);
+-              return;
+-      }
+-      if (usb_endpoint_xfer_control(&ep->desc)) {
+-              xhci_dbg_trace(xhci, trace_xhci_dbg_reset_ep,
+-                              "Control endpoint stall already handled.");
+-              return;
+-      }
+-      command = xhci_alloc_command(xhci, false, false, GFP_ATOMIC);
+-      if (!command)
+-              return;
+-
+-      xhci_dbg_trace(xhci, trace_xhci_dbg_reset_ep,
+-                      "Queueing reset endpoint command");
+-      spin_lock_irqsave(&xhci->lock, flags);
+-      ret = xhci_queue_reset_ep(xhci, command, udev->slot_id, ep_index);
+       /*
+-       * Can't change the ring dequeue pointer until it's transitioned to the
+-       * stopped state, which is only upon a successful reset endpoint
+-       * command.  Better hope that last command worked!
++       * We might need to implement the config ep cmd in xhci 4.8.1 note:
++       * The Reset Endpoint Command may only be issued to endpoints in the
++       * Halted state. If software wishes reset the Data Toggle or Sequence
++       * Number of an endpoint that isn't in the Halted state, then software
++       * may issue a Configure Endpoint Command with the Drop and Add bits set
++       * for the target endpoint. that is in the Stopped state.
+        */
+-      if (!ret) {
+-              xhci_cleanup_stalled_ring(xhci, udev, ep_index);
+-              kfree(virt_ep->stopped_td);
+-              xhci_ring_cmd_db(xhci);
+-      }
+-      virt_ep->stopped_td = NULL;
+-      virt_ep->stopped_stream = 0;
+-      spin_unlock_irqrestore(&xhci->lock, flags);
+-      if (ret)
+-              xhci_warn(xhci, "FIXME allocate a new ring segment\n");
++      /* For now just print debug to follow the situation */
++      xhci_dbg(xhci, "Endpoint 0x%x ep reset callback called\n",
++               ep->desc.bEndpointAddress);
+ }
+ static int xhci_check_streams_endpoint(struct xhci_hcd *xhci,
diff --git a/queue-3.17/usb-xhci-rework-root-port-wake-bits-if-controller-isn-t-allowed-to-wakeup.patch b/queue-3.17/usb-xhci-rework-root-port-wake-bits-if-controller-isn-t-allowed-to-wakeup.patch
new file mode 100644 (file)
index 0000000..45176bd
--- /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
+@@ -279,7 +279,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
+@@ -255,7 +255,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);
+@@ -850,13 +852,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;
+@@ -867,6 +903,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
+@@ -1764,7 +1764,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