From 4efde2c0ededfd86bfba6ad57837abc59326947a Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 18 Mar 2013 12:36:07 -0700 Subject: [PATCH] 3.4-stable patches added patches: atmel_lcdfb-fix-16-bpp-modes-on-older-socs.patch btrfs-use-rcu_barrier-to-wait-for-bdev-puts-at-unmount.patch drm-i915-ebusy-status-handling-added-to-i915_gem_fault.patch s390-critical-section-cleanup-vs.-machine-checks.patch s390-mm-fix-flush_tlb_kernel_range.patch --- ...lcdfb-fix-16-bpp-modes-on-older-socs.patch | 89 +++++++++++++++++++ ...ier-to-wait-for-bdev-puts-at-unmount.patch | 58 ++++++++++++ ...tus-handling-added-to-i915_gem_fault.patch | 39 ++++++++ ...l-section-cleanup-vs.-machine-checks.patch | 54 +++++++++++ .../s390-mm-fix-flush_tlb_kernel_range.patch | 44 +++++++++ queue-3.4/series | 5 ++ 6 files changed, 289 insertions(+) create mode 100644 queue-3.4/atmel_lcdfb-fix-16-bpp-modes-on-older-socs.patch create mode 100644 queue-3.4/btrfs-use-rcu_barrier-to-wait-for-bdev-puts-at-unmount.patch create mode 100644 queue-3.4/drm-i915-ebusy-status-handling-added-to-i915_gem_fault.patch create mode 100644 queue-3.4/s390-critical-section-cleanup-vs.-machine-checks.patch create mode 100644 queue-3.4/s390-mm-fix-flush_tlb_kernel_range.patch diff --git a/queue-3.4/atmel_lcdfb-fix-16-bpp-modes-on-older-socs.patch b/queue-3.4/atmel_lcdfb-fix-16-bpp-modes-on-older-socs.patch new file mode 100644 index 00000000000..0d070b51c91 --- /dev/null +++ b/queue-3.4/atmel_lcdfb-fix-16-bpp-modes-on-older-socs.patch @@ -0,0 +1,89 @@ +From a79eac7165ed62114e6ca197195aa5060a54f137 Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Tue, 5 Feb 2013 14:35:11 +0100 +Subject: atmel_lcdfb: fix 16-bpp modes on older SOCs + +From: Johan Hovold + +commit a79eac7165ed62114e6ca197195aa5060a54f137 upstream. + +Fix regression introduced by commit 787f9fd23283 ("atmel_lcdfb: support +16bit BGR:565 mode, remove unsupported 15bit modes") which broke 16-bpp +modes for older SOCs which use IBGR:555 (msb is intensity) rather +than BGR:565. + +Use SOC-type to determine the pixel layout. + +Tested on at91sam9263 and at91sam9g45. + +Acked-by: Peter Korsgaard +Signed-off-by: Johan Hovold +Signed-off-by: Nicolas Ferre +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/video/atmel_lcdfb.c | 22 +++++++++++++++------- + include/video/atmel_lcdc.h | 1 + + 2 files changed, 16 insertions(+), 7 deletions(-) + +--- a/drivers/video/atmel_lcdfb.c ++++ b/drivers/video/atmel_lcdfb.c +@@ -422,17 +422,22 @@ static int atmel_lcdfb_check_var(struct + = var->bits_per_pixel; + break; + case 16: ++ /* Older SOCs use IBGR:555 rather than BGR:565. */ ++ if (sinfo->have_intensity_bit) ++ var->green.length = 5; ++ else ++ var->green.length = 6; ++ + if (sinfo->lcd_wiring_mode == ATMEL_LCDC_WIRING_RGB) { +- /* RGB:565 mode */ +- var->red.offset = 11; ++ /* RGB:5X5 mode */ ++ var->red.offset = var->green.length + 5; + var->blue.offset = 0; + } else { +- /* BGR:565 mode */ ++ /* BGR:5X5 mode */ + var->red.offset = 0; +- var->blue.offset = 11; ++ var->blue.offset = var->green.length + 5; + } + var->green.offset = 5; +- var->green.length = 6; + var->red.length = var->blue.length = 5; + break; + case 32: +@@ -679,8 +684,7 @@ static int atmel_lcdfb_setcolreg(unsigne + + case FB_VISUAL_PSEUDOCOLOR: + if (regno < 256) { +- if (cpu_is_at91sam9261() || cpu_is_at91sam9263() +- || cpu_is_at91sam9rl()) { ++ if (sinfo->have_intensity_bit) { + /* old style I+BGR:555 */ + val = ((red >> 11) & 0x001f); + val |= ((green >> 6) & 0x03e0); +@@ -870,6 +874,10 @@ static int __init atmel_lcdfb_probe(stru + } + sinfo->info = info; + sinfo->pdev = pdev; ++ if (cpu_is_at91sam9261() || cpu_is_at91sam9263() || ++ cpu_is_at91sam9rl()) { ++ sinfo->have_intensity_bit = true; ++ } + + strcpy(info->fix.id, sinfo->pdev->name); + info->flags = ATMEL_LCDFB_FBINFO_DEFAULT; +--- a/include/video/atmel_lcdc.h ++++ b/include/video/atmel_lcdc.h +@@ -62,6 +62,7 @@ struct atmel_lcdfb_info { + void (*atmel_lcdfb_power_control)(int on); + struct fb_monspecs *default_monspecs; + u32 pseudo_palette[16]; ++ bool have_intensity_bit; + }; + + #define ATMEL_LCDC_DMABADDR1 0x00 diff --git a/queue-3.4/btrfs-use-rcu_barrier-to-wait-for-bdev-puts-at-unmount.patch b/queue-3.4/btrfs-use-rcu_barrier-to-wait-for-bdev-puts-at-unmount.patch new file mode 100644 index 00000000000..d562a034af8 --- /dev/null +++ b/queue-3.4/btrfs-use-rcu_barrier-to-wait-for-bdev-puts-at-unmount.patch @@ -0,0 +1,58 @@ +From bc178622d40d87e75abc131007342429c9b03351 Mon Sep 17 00:00:00 2001 +From: Eric Sandeen +Date: Sat, 9 Mar 2013 15:18:39 +0000 +Subject: btrfs: use rcu_barrier() to wait for bdev puts at unmount + +From: Eric Sandeen + +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 +Signed-off-by: Josef Bacik +Signed-off-by: Chris Mason +Signed-off-by: Greg Kroah-Hartman + +--- + fs/btrfs/volumes.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/fs/btrfs/volumes.c ++++ b/fs/btrfs/volumes.c +@@ -591,6 +591,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; + } + diff --git a/queue-3.4/drm-i915-ebusy-status-handling-added-to-i915_gem_fault.patch b/queue-3.4/drm-i915-ebusy-status-handling-added-to-i915_gem_fault.patch new file mode 100644 index 00000000000..4948542e4b5 --- /dev/null +++ b/queue-3.4/drm-i915-ebusy-status-handling-added-to-i915_gem_fault.patch @@ -0,0 +1,39 @@ +From e79e0fe380847493266fba557217e2773c61bd1b Mon Sep 17 00:00:00 2001 +From: Dmitry Rogozhkin +Date: Wed, 3 Oct 2012 17:15:26 +0300 +Subject: drm/i915: EBUSY status handling added to i915_gem_fault(). + +From: Dmitry Rogozhkin + +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 +Signed-off-by: Dmitry Rogozhkin +Reviewed-by: Chris Wilson +Signed-off-by: Daniel Vetter +Signed-off-by: Greg Kroah-Hartman + +--- + 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 +@@ -1186,6 +1186,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; diff --git a/queue-3.4/s390-critical-section-cleanup-vs.-machine-checks.patch b/queue-3.4/s390-critical-section-cleanup-vs.-machine-checks.patch new file mode 100644 index 00000000000..8425abdfad9 --- /dev/null +++ b/queue-3.4/s390-critical-section-cleanup-vs.-machine-checks.patch @@ -0,0 +1,54 @@ +From 6551fbdfd8b85d1ab5822ac98abb4fb449bcfae0 Mon Sep 17 00:00:00 2001 +From: Martin Schwidefsky +Date: Thu, 28 Feb 2013 16:28:41 +0100 +Subject: s390: critical section cleanup vs. machine checks + +From: Martin Schwidefsky + +commit 6551fbdfd8b85d1ab5822ac98abb4fb449bcfae0 upstream. + +The current machine check code uses the registers stored by the machine +in the lowcore at __LC_GPREGS_SAVE_AREA as the registers of the interrupted +context. The registers 0-7 of a user process can get clobbered if a machine +checks interrupts the execution of a critical section in entry[64].S. + +The reason is that the critical section cleanup code may need to modify +the PSW and the registers for the previous context to get to the end of a +critical section. If registers 0-7 have to be replaced the relevant copy +will be in the registers, which invalidates the copy in the lowcore. The +machine check handler needs to explicitly store registers 0-7 to the stack. + +Signed-off-by: Martin Schwidefsky +Signed-off-by: Greg Kroah-Hartman + +--- + arch/s390/kernel/entry.S | 3 ++- + arch/s390/kernel/entry64.S | 5 +++-- + 2 files changed, 5 insertions(+), 3 deletions(-) + +--- a/arch/s390/kernel/entry.S ++++ b/arch/s390/kernel/entry.S +@@ -669,7 +669,8 @@ ENTRY(mcck_int_handler) + UPDATE_VTIME %r14,%r15,__LC_MCCK_ENTER_TIMER + mcck_skip: + SWITCH_ASYNC __LC_GPREGS_SAVE_AREA+32,__LC_PANIC_STACK,PAGE_SHIFT +- mvc __PT_R0(64,%r11),__LC_GPREGS_SAVE_AREA ++ stm %r0,%r7,__PT_R0(%r11) ++ mvc __PT_R8(32,%r11),__LC_GPREGS_SAVE_AREA+32 + stm %r8,%r9,__PT_PSW(%r11) + xc __SF_BACKCHAIN(4,%r15),__SF_BACKCHAIN(%r15) + l %r1,BASED(.Ldo_machine_check) +--- a/arch/s390/kernel/entry64.S ++++ b/arch/s390/kernel/entry64.S +@@ -689,8 +689,9 @@ ENTRY(mcck_int_handler) + UPDATE_VTIME %r14,__LC_MCCK_ENTER_TIMER + LAST_BREAK %r14 + mcck_skip: +- lghi %r14,__LC_GPREGS_SAVE_AREA +- mvc __PT_R0(128,%r11),0(%r14) ++ lghi %r14,__LC_GPREGS_SAVE_AREA+64 ++ stmg %r0,%r7,__PT_R0(%r11) ++ mvc __PT_R8(64,%r11),0(%r14) + stmg %r8,%r9,__PT_PSW(%r11) + xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15) + lgr %r2,%r11 # pass pointer to pt_regs diff --git a/queue-3.4/s390-mm-fix-flush_tlb_kernel_range.patch b/queue-3.4/s390-mm-fix-flush_tlb_kernel_range.patch new file mode 100644 index 00000000000..10cb0594ad2 --- /dev/null +++ b/queue-3.4/s390-mm-fix-flush_tlb_kernel_range.patch @@ -0,0 +1,44 @@ +From f6a70a07079518280022286a1dceb797d12e1edf Mon Sep 17 00:00:00 2001 +From: Heiko Carstens +Date: Mon, 4 Mar 2013 14:14:11 +0100 +Subject: s390/mm: fix flush_tlb_kernel_range() + +From: Heiko Carstens + +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 +Signed-off-by: Martin Schwidefsky +Signed-off-by: Greg Kroah-Hartman + +--- + 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 +@@ -74,8 +74,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 diff --git a/queue-3.4/series b/queue-3.4/series index e065361ad15..1776c63804a 100644 --- a/queue-3.4/series +++ b/queue-3.4/series @@ -24,3 +24,8 @@ powerpc-fix-cputable-entry-for-970mp-rev-1.0.patch selinux-use-gfp_atomic-under-spin_lock.patch perf-x86-fix-wrmsr_on_cpu-warning-on-suspend-resume.patch perf-x86-fix-link-failure-for-non-intel-configs.patch +s390-critical-section-cleanup-vs.-machine-checks.patch +s390-mm-fix-flush_tlb_kernel_range.patch +btrfs-use-rcu_barrier-to-wait-for-bdev-puts-at-unmount.patch +atmel_lcdfb-fix-16-bpp-modes-on-older-socs.patch +drm-i915-ebusy-status-handling-added-to-i915_gem_fault.patch -- 2.47.3