--- /dev/null
+From bc178622d40d87e75abc131007342429c9b03351 Mon Sep 17 00:00:00 2001
+From: Eric Sandeen <sandeen@redhat.com>
+Date: Sat, 9 Mar 2013 15:18:39 +0000
+Subject: btrfs: use rcu_barrier() to wait for bdev puts at unmount
+
+From: Eric Sandeen <sandeen@redhat.com>
+
+commit bc178622d40d87e75abc131007342429c9b03351 upstream.
+
+Doing this would reliably fail with -EBUSY for me:
+
+# mount /dev/sdb2 /mnt/scratch; umount /mnt/scratch; mkfs.btrfs -f /dev/sdb2
+...
+unable to open /dev/sdb2: Device or resource busy
+
+because mkfs.btrfs tries to open the device O_EXCL, and somebody still has it.
+
+Using systemtap to track bdev gets & puts shows a kworker thread doing a
+blkdev put after mkfs attempts a get; this is left over from the unmount
+path:
+
+btrfs_close_devices
+ __btrfs_close_devices
+ call_rcu(&device->rcu, free_device);
+ free_device
+ INIT_WORK(&device->rcu_work, __free_device);
+ schedule_work(&device->rcu_work);
+
+so unmount might complete before __free_device fires & does its blkdev_put.
+
+Adding an rcu_barrier() to btrfs_close_devices() causes unmount to wait
+until all blkdev_put()s are done, and the device is truly free once
+unmount completes.
+
+Signed-off-by: Eric Sandeen <sandeen@redhat.com>
+Signed-off-by: Josef Bacik <jbacik@fusionio.com>
+Signed-off-by: Chris Mason <chris.mason@fusionio.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/btrfs/volumes.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/fs/btrfs/volumes.c
++++ b/fs/btrfs/volumes.c
+@@ -546,6 +546,12 @@ int btrfs_close_devices(struct btrfs_fs_
+ __btrfs_close_devices(fs_devices);
+ free_fs_devices(fs_devices);
+ }
++ /*
++ * Wait for rcu kworkers under __btrfs_close_devices
++ * to finish all blkdev_puts so device is really
++ * free when umount is done.
++ */
++ rcu_barrier();
+ return ret;
+ }
+
--- /dev/null
+From e79e0fe380847493266fba557217e2773c61bd1b Mon Sep 17 00:00:00 2001
+From: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
+Date: Wed, 3 Oct 2012 17:15:26 +0300
+Subject: drm/i915: EBUSY status handling added to i915_gem_fault().
+
+From: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
+
+commit e79e0fe380847493266fba557217e2773c61bd1b upstream.
+
+Subsequent threads returning EBUSY from vm_insert_pfn() was not handled
+correctly. As a result concurrent access from new threads to
+mmapped data caused SIGBUS.
+
+Note that this fixes i-g-t/tests/gem_threaded_tiled_access.
+
+Tested-by: Mika Kuoppala <mika.kuoppala@intel.com>
+Signed-off-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
+Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
+Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/i915/i915_gem.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/drivers/gpu/drm/i915/i915_gem.c
++++ b/drivers/gpu/drm/i915/i915_gem.c
+@@ -1256,6 +1256,11 @@ out:
+ case 0:
+ case -ERESTARTSYS:
+ case -EINTR:
++ case -EBUSY:
++ /*
++ * EBUSY is ok: this just means that another thread
++ * already did the job.
++ */
+ return VM_FAULT_NOPAGE;
+ case -ENOMEM:
+ return VM_FAULT_OOM;
--- /dev/null
+From f6a70a07079518280022286a1dceb797d12e1edf Mon Sep 17 00:00:00 2001
+From: Heiko Carstens <heiko.carstens@de.ibm.com>
+Date: Mon, 4 Mar 2013 14:14:11 +0100
+Subject: s390/mm: fix flush_tlb_kernel_range()
+
+From: Heiko Carstens <heiko.carstens@de.ibm.com>
+
+commit f6a70a07079518280022286a1dceb797d12e1edf upstream.
+
+Our flush_tlb_kernel_range() implementation calls __tlb_flush_mm() with
+&init_mm as argument. __tlb_flush_mm() however will only flush tlbs
+for the passed in mm if its mm_cpumask is not empty.
+
+For the init_mm however its mm_cpumask has never any bits set. Which in
+turn means that our flush_tlb_kernel_range() implementation doesn't
+work at all.
+
+This can be easily verified with a vmalloc/vfree loop which allocates
+a page, writes to it and then frees the page again. A crash will follow
+almost instantly.
+
+To fix this remove the cpumask_empty() check in __tlb_flush_mm() since
+there shouldn't be too many mms with a zero mm_cpumask, besides the
+init_mm of course.
+
+Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
+Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/s390/include/asm/tlbflush.h | 2 --
+ 1 file changed, 2 deletions(-)
+
+--- a/arch/s390/include/asm/tlbflush.h
++++ b/arch/s390/include/asm/tlbflush.h
+@@ -73,8 +73,6 @@ static inline void __tlb_flush_idte(unsi
+
+ static inline void __tlb_flush_mm(struct mm_struct * mm)
+ {
+- if (unlikely(cpumask_empty(mm_cpumask(mm))))
+- return;
+ /*
+ * If the machine has IDTE we prefer to do a per mm flush
+ * on all cpus instead of doing a local flush if the mm
perf-x86-fix-kernel-crash-with-pebs-bts-after-suspend-resume.patch
perf-x86-fix-wrmsr_on_cpu-warning-on-suspend-resume.patch
perf-x86-fix-link-failure-for-non-intel-configs.patch
+s390-mm-fix-flush_tlb_kernel_range.patch
+btrfs-use-rcu_barrier-to-wait-for-bdev-puts-at-unmount.patch
+drm-i915-ebusy-status-handling-added-to-i915_gem_fault.patch