--- /dev/null
+From 7258ae5c5a2ce2f5969e8b18b881be40ab55433d Mon Sep 17 00:00:00 2001
+From: James Morse <james.morse@arm.com>
+Date: Fri, 16 Jun 2017 14:02:29 -0700
+Subject: mm/memory-failure.c: use compound_head() flags for huge pages
+
+From: James Morse <james.morse@arm.com>
+
+commit 7258ae5c5a2ce2f5969e8b18b881be40ab55433d upstream.
+
+memory_failure() chooses a recovery action function based on the page
+flags. For huge pages it uses the tail page flags which don't have
+anything interesting set, resulting in:
+
+> Memory failure: 0x9be3b4: Unknown page state
+> Memory failure: 0x9be3b4: recovery action for unknown page: Failed
+
+Instead, save a copy of the head page's flags if this is a huge page,
+this means if there are no relevant flags for this tail page, we use the
+head pages flags instead. This results in the me_huge_page() recovery
+action being called:
+
+> Memory failure: 0x9b7969: recovery action for huge page: Delayed
+
+For hugepages that have not yet been allocated, this allows the hugepage
+to be dequeued.
+
+Fixes: 524fca1e7356 ("HWPOISON: fix misjudgement of page_action() for errors on mlocked pages")
+Link: http://lkml.kernel.org/r/20170524130204.21845-1-james.morse@arm.com
+Signed-off-by: James Morse <james.morse@arm.com>
+Tested-by: Punit Agrawal <punit.agrawal@arm.com>
+Acked-by: Punit Agrawal <punit.agrawal@arm.com>
+Acked-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ mm/memory-failure.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+--- a/mm/memory-failure.c
++++ b/mm/memory-failure.c
+@@ -1189,7 +1189,10 @@ int memory_failure(unsigned long pfn, in
+ * page_remove_rmap() in try_to_unmap_one(). So to determine page status
+ * correctly, we save a copy of the page flags at this time.
+ */
+- page_flags = p->flags;
++ if (PageHuge(p))
++ page_flags = hpage->flags;
++ else
++ page_flags = p->flags;
+
+ /*
+ * unpoison always clear PG_hwpoison inside page lock
usb-r8a66597-hcd-select-a-different-endpoint-on-timeout.patch
usb-r8a66597-hcd-decrease-timeout.patch
drivers-misc-c2port-c2port-duramar2150.c-checking-for-null-instead-of-is_err.patch
+usb-xhci-asmedia-asm1042a-chipset-need-shorts-tx-quirk.patch
+mm-memory-failure.c-use-compound_head-flags-for-huge-pages.patch
+swap-cond_resched-in-swap_cgroup_prepare.patch
--- /dev/null
+From ef70762948dde012146926720b70e79736336764 Mon Sep 17 00:00:00 2001
+From: Yu Zhao <yuzhao@google.com>
+Date: Fri, 16 Jun 2017 14:02:31 -0700
+Subject: swap: cond_resched in swap_cgroup_prepare()
+
+From: Yu Zhao <yuzhao@google.com>
+
+commit ef70762948dde012146926720b70e79736336764 upstream.
+
+I saw need_resched() warnings when swapping on large swapfile (TBs)
+because continuously allocating many pages in swap_cgroup_prepare() took
+too long.
+
+We already cond_resched when freeing page in swap_cgroup_swapoff(). Do
+the same for the page allocation.
+
+Link: http://lkml.kernel.org/r/20170604200109.17606-1-yuzhao@google.com
+Signed-off-by: Yu Zhao <yuzhao@google.com>
+Acked-by: Michal Hocko <mhocko@suse.com>
+Acked-by: Vladimir Davydov <vdavydov.dev@gmail.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ mm/page_cgroup.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/mm/page_cgroup.c
++++ b/mm/page_cgroup.c
+@@ -368,6 +368,9 @@ static int swap_cgroup_prepare(int type)
+ if (!page)
+ goto not_enough_page;
+ ctrl->map[idx] = page;
++
++ if (!(idx % SWAP_CLUSTER_MAX))
++ cond_resched();
+ }
+ return 0;
+ not_enough_page:
--- /dev/null
+From d2f48f05cd2a2a0a708fbfa45f1a00a87660d937 Mon Sep 17 00:00:00 2001
+From: Corentin Labbe <clabbe.montjoie@gmail.com>
+Date: Fri, 9 Jun 2017 14:48:41 +0300
+Subject: usb: xhci: ASMedia ASM1042A chipset need shorts TX quirk
+
+From: Corentin Labbe <clabbe.montjoie@gmail.com>
+
+commit d2f48f05cd2a2a0a708fbfa45f1a00a87660d937 upstream.
+
+When plugging an USB webcam I see the following message:
+[106385.615559] xhci_hcd 0000:04:00.0: WARN Successful completion on short TX: needs XHCI_TRUST_TX_LENGTH quirk?
+[106390.583860] handle_tx_event: 913 callbacks suppressed
+
+With this patch applied, I get no more printing of this message.
+
+Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
+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 | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/usb/host/xhci-pci.c
++++ b/drivers/usb/host/xhci-pci.c
+@@ -185,6 +185,9 @@ static void xhci_pci_quirks(struct devic
+ if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
+ pdev->device == 0x1042)
+ xhci->quirks |= XHCI_BROKEN_STREAMS;
++ if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
++ pdev->device == 0x1142)
++ xhci->quirks |= XHCI_TRUST_TX_LENGTH;
+
+ if (xhci->quirks & XHCI_RESET_ON_RESUME)
+ xhci_dbg_trace(xhci, trace_xhci_dbg_quirks,