--- /dev/null
+From 884020bf3d2a3787a1cc6df902e98e0eec60330b Mon Sep 17 00:00:00 2001
+From: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Tue, 6 Aug 2013 19:01:14 +0100
+Subject: drm/i915: Invalidate TLBs for the rings after a reset
+
+From: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 884020bf3d2a3787a1cc6df902e98e0eec60330b upstream.
+
+After any "soft gfx reset" we must manually invalidate the TLBs
+associated with each ring. Empirically, it seems that a
+suspend/resume or D3-D0 cycle count as a "soft reset". The symptom is
+that the hardware would fail to note the new address for its status
+page, and so it would continue to write the shadow registers and
+breadcrumbs into the old physical address (now used by something
+completely different, scary). Whereas the driver would read the new
+status page and never see any progress, it would appear that the GPU
+hung immediately upon resume.
+
+Based on a patch by naresh kumar kachhi <naresh.kumar.kacchi@intel.com>
+
+Reported-by: Thiago Macieira <thiago@kde.org>
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64725
+Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+Tested-by: Thiago Macieira <thiago@kde.org>
+Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/i915/i915_reg.h | 2 ++
+ drivers/gpu/drm/i915/intel_ringbuffer.c | 12 ++++++++++++
+ 2 files changed, 14 insertions(+)
+
+--- a/drivers/gpu/drm/i915/i915_reg.h
++++ b/drivers/gpu/drm/i915/i915_reg.h
+@@ -502,6 +502,8 @@
+ will not assert AGPBUSY# and will only
+ be delivered when out of C3. */
+ #define INSTPM_FORCE_ORDERING (1<<7) /* GEN6+ */
++#define INSTPM_TLB_INVALIDATE (1<<9)
++#define INSTPM_SYNC_FLUSH (1<<5)
+ #define ACTHD 0x020c8
+ #define FW_BLC 0x020d8
+ #define FW_BLC2 0x020dc
+--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
++++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
+@@ -767,6 +767,18 @@ void intel_ring_setup_status_page(struct
+
+ I915_WRITE(mmio, (u32)ring->status_page.gfx_addr);
+ POSTING_READ(mmio);
++
++ /* Flush the TLB for this page */
++ if (INTEL_INFO(dev)->gen >= 6) {
++ u32 reg = RING_INSTPM(ring->mmio_base);
++ I915_WRITE(reg,
++ _MASKED_BIT_ENABLE(INSTPM_TLB_INVALIDATE |
++ INSTPM_SYNC_FLUSH));
++ if (wait_for((I915_READ(reg) & INSTPM_SYNC_FLUSH) == 0,
++ 1000))
++ DRM_ERROR("%s: wait for SyncFlush to complete for TLB invalidation timed out\n",
++ ring->name);
++ }
+ }
+
+ static int
--- /dev/null
+From 4bf93b50fd04118ac7f33a3c2b8a0a1f9fa80bc9 Mon Sep 17 00:00:00 2001
+From: Vyacheslav Dubeyko <slava@dubeyko.com>
+Date: Thu, 22 Aug 2013 16:35:45 -0700
+Subject: nilfs2: fix issue with counting number of bio requests for BIO_EOPNOTSUPP error detection
+
+From: Vyacheslav Dubeyko <slava@dubeyko.com>
+
+commit 4bf93b50fd04118ac7f33a3c2b8a0a1f9fa80bc9 upstream.
+
+Fix the issue with improper counting number of flying bio requests for
+BIO_EOPNOTSUPP error detection case.
+
+The sb_nbio must be incremented exactly the same number of times as
+complete() function was called (or will be called) because
+nilfs_segbuf_wait() will call wail_for_completion() for the number of
+times set to sb_nbio:
+
+ do {
+ wait_for_completion(&segbuf->sb_bio_event);
+ } while (--segbuf->sb_nbio > 0);
+
+Two functions complete() and wait_for_completion() must be called the
+same number of times for the same sb_bio_event. Otherwise,
+wait_for_completion() will hang or leak.
+
+Signed-off-by: Vyacheslav Dubeyko <slava@dubeyko.com>
+Cc: Dan Carpenter <dan.carpenter@oracle.com>
+Acked-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
+Tested-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
+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>
+
+---
+ fs/nilfs2/segbuf.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/fs/nilfs2/segbuf.c
++++ b/fs/nilfs2/segbuf.c
+@@ -376,12 +376,12 @@ static int nilfs_segbuf_submit_bio(struc
+ bio->bi_private = segbuf;
+ bio_get(bio);
+ submit_bio(mode, bio);
++ segbuf->sb_nbio++;
+ if (bio_flagged(bio, BIO_EOPNOTSUPP)) {
+ bio_put(bio);
+ err = -EOPNOTSUPP;
+ goto failed;
+ }
+- segbuf->sb_nbio++;
+ bio_put(bio);
+
+ wi->bio = NULL;
--- /dev/null
+From 2df37a19c686c2d7c4e9b4ce1505b5141e3e5552 Mon Sep 17 00:00:00 2001
+From: Vyacheslav Dubeyko <slava@dubeyko.com>
+Date: Thu, 22 Aug 2013 16:35:44 -0700
+Subject: nilfs2: remove double bio_put() in nilfs_end_bio_write() for BIO_EOPNOTSUPP error
+
+From: Vyacheslav Dubeyko <slava@dubeyko.com>
+
+commit 2df37a19c686c2d7c4e9b4ce1505b5141e3e5552 upstream.
+
+Remove double call of bio_put() in nilfs_end_bio_write() for the case of
+BIO_EOPNOTSUPP error detection. The issue was found by Dan Carpenter
+and he suggests first version of the fix too.
+
+Signed-off-by: Vyacheslav Dubeyko <slava@dubeyko.com>
+Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
+Acked-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
+Tested-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
+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>
+
+---
+ fs/nilfs2/segbuf.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/fs/nilfs2/segbuf.c
++++ b/fs/nilfs2/segbuf.c
+@@ -345,8 +345,7 @@ static void nilfs_end_bio_write(struct b
+
+ if (err == -EOPNOTSUPP) {
+ set_bit(BIO_EOPNOTSUPP, &bio->bi_flags);
+- bio_put(bio);
+- /* to be detected by submit_seg_bio() */
++ /* to be detected by nilfs_segbuf_submit_bio() */
+ }
+
+ if (!uptodate)
--- /dev/null
+From 9e40127526e857fa3f29d51e83277204fbdfc6ba Mon Sep 17 00:00:00 2001
+From: Wladislav Wiebe <wladislav.kw@gmail.com>
+Date: Mon, 12 Aug 2013 13:06:53 +0200
+Subject: of: fdt: fix memory initialization for expanded DT
+
+From: Wladislav Wiebe <wladislav.kw@gmail.com>
+
+commit 9e40127526e857fa3f29d51e83277204fbdfc6ba upstream.
+
+Already existing property flags are filled wrong for properties created from
+initial FDT. This could cause problems if this DYNAMIC device-tree functions
+are used later, i.e. properties are attached/detached/replaced. Simply dumping
+flags from the running system show, that some initial static (not allocated via
+kzmalloc()) nodes are marked as dynamic.
+
+I putted some debug extensions to property_proc_show(..) :
+..
++ if (OF_IS_DYNAMIC(pp))
++ pr_err("DEBUG: xxx : OF_IS_DYNAMIC\n");
++ if (OF_IS_DETACHED(pp))
++ pr_err("DEBUG: xxx : OF_IS_DETACHED\n");
+
+when you operate on the nodes (e.g.: ~$ cat /proc/device-tree/*some_node*) you
+will see that those flags are filled wrong, basically in most cases it will dump
+a DYNAMIC or DETACHED status, which is in not true.
+(BTW. this OF_IS_DETACHED is a own define for debug purposes which which just
+make a test_bit(OF_DETACHED, &x->_flags)
+
+If nodes are dynamic kernel is allowed to kfree() them. But it will crash
+attempting to do so on the nodes from FDT -- they are not allocated via
+kzmalloc().
+
+Signed-off-by: Wladislav Wiebe <wladislav.kw@gmail.com>
+Acked-by: Alexander Sverdlin <alexander.sverdlin@nsn.com>
+Signed-off-by: Rob Herring <rob.herring@calxeda.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/of/fdt.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/of/fdt.c
++++ b/drivers/of/fdt.c
+@@ -390,6 +390,8 @@ static void __unflatten_device_tree(stru
+ mem = (unsigned long)
+ dt_alloc(size + 4, __alignof__(struct device_node));
+
++ memset((void *)mem, 0, size);
++
+ ((__be32 *)mem)[size / 4] = cpu_to_be32(0xdeadbeef);
+
+ pr_debug(" unflattening %lx...\n", mem);
workqueue-fix-possible-stall-on-try_to_grab_pending-of-a-delayed-work-item.patch
workqueue-consider-work-function-when-searching-for-busy-work-items.patch
+zd1201-do-not-use-stack-as-urb-transfer_buffer.patch
+xen-events-initialize-local-per-cpu-mask-for-all-possible-events.patch
+drm-i915-invalidate-tlbs-for-the-rings-after-a-reset.patch
+of-fdt-fix-memory-initialization-for-expanded-dt.patch
+nilfs2-remove-double-bio_put-in-nilfs_end_bio_write-for-bio_eopnotsupp-error.patch
+nilfs2-fix-issue-with-counting-number-of-bio-requests-for-bio_eopnotsupp-error-detection.patch
--- /dev/null
+From 84ca7a8e45dafb49cd5ca90a343ba033e2885c17 Mon Sep 17 00:00:00 2001
+From: David Vrabel <david.vrabel@citrix.com>
+Date: Thu, 15 Aug 2013 13:21:06 +0100
+Subject: xen/events: initialize local per-cpu mask for all possible events
+
+From: David Vrabel <david.vrabel@citrix.com>
+
+commit 84ca7a8e45dafb49cd5ca90a343ba033e2885c17 upstream.
+
+The sizeof() argument in init_evtchn_cpu_bindings() is incorrect
+resulting in only the first 64 (or 32 in 32-bit guests) ports having
+their bindings being initialized to VCPU 0.
+
+In most cases this does not cause a problem as request_irq() will set
+the irq affinity which will set the correct local per-cpu mask.
+However, if the request_irq() is called on a VCPU other than 0, there
+is a window between the unmasking of the event and the affinity being
+set were an event may be lost because it is not locally unmasked on
+any VCPU. If request_irq() is called on VCPU 0 then local irqs are
+disabled during the window and the race does not occur.
+
+Fix this by initializing all NR_EVENT_CHANNEL bits in the local
+per-cpu masks.
+
+Signed-off-by: David Vrabel <david.vrabel@citrix.com>
+Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/xen/events.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/xen/events.c
++++ b/drivers/xen/events.c
+@@ -324,7 +324,7 @@ static void init_evtchn_cpu_bindings(voi
+
+ for_each_possible_cpu(i)
+ memset(per_cpu(cpu_evtchn_mask, i),
+- (i == 0) ? ~0 : 0, sizeof(*per_cpu(cpu_evtchn_mask, i)));
++ (i == 0) ? ~0 : 0, NR_EVENT_CHANNELS/8);
+ }
+
+ static inline void clear_evtchn(int port)
--- /dev/null
+From 1206ff4ff9d2ef7468a355328bc58ac6ebf5be44 Mon Sep 17 00:00:00 2001
+From: Jussi Kivilinna <jussi.kivilinna@iki.fi>
+Date: Tue, 6 Aug 2013 14:28:42 +0300
+Subject: zd1201: do not use stack as URB transfer_buffer
+
+From: Jussi Kivilinna <jussi.kivilinna@iki.fi>
+
+commit 1206ff4ff9d2ef7468a355328bc58ac6ebf5be44 upstream.
+
+Patch fixes zd1201 not to use stack as URB transfer_buffer. URB buffers need
+to be DMA-able, which stack is not.
+
+Patch is only compile tested.
+
+Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
+Signed-off-by: John W. Linville <linville@tuxdriver.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/wireless/zd1201.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/zd1201.c
++++ b/drivers/net/wireless/zd1201.c
+@@ -98,10 +98,12 @@ static int zd1201_fw_upload(struct usb_d
+ goto exit;
+
+ err = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), 0x4,
+- USB_DIR_IN | 0x40, 0,0, &ret, sizeof(ret), ZD1201_FW_TIMEOUT);
++ USB_DIR_IN | 0x40, 0, 0, buf, sizeof(ret), ZD1201_FW_TIMEOUT);
+ if (err < 0)
+ goto exit;
+
++ memcpy(&ret, buf, sizeof(ret));
++
+ if (ret & 0x80) {
+ err = -EIO;
+ goto exit;