commit 0b8e8118dd2c9440bb7a2da1a19e15e324d3c09b
Author: Jiri Slaby <jslaby@suse.cz>
Date:   Fri Jul 18 14:08:07 2014 +0200

    Linux 3.12.25

commit b72ab222d16e84332602aa8138012f4d8126bab6
Author: Lan Tianyu <tianyu.lan@intel.com>
Date:   Mon Jul 7 15:47:12 2014 +0800

    ACPI / battery: Retry to get battery information if failed during probing
    
    commit 75646e758a0ecbed5024454507d5be5b9ea9dcbf upstream.
    
    Some machines (eg. Lenovo Z480) ECs are not stable during boot up
    and causes battery driver fails to be loaded due to failure of getting
    battery information from EC sometimes. After several retries, the
    operation will work. This patch is to retry to get battery information 5
    times if the first try fails.
    
    [ backport to 3.14.5: removed second parameter in acpi_battery_update(),
    introduced by the commit 9e50bc14a7f58b5d8a55973b2d69355852ae2dae (ACPI /
    battery: Accelerate battery resume callback)]
    
    [naszar <naszar@ya.ru>: backport to 3.14.5]
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=75581
    Reported-and-tested-by: naszar <naszar@ya.ru>
    Cc: All applicable <stable@vger.kernel.org>
    Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit d30ab27962dc2280291dc65b8daa3b1459cc3ceb
Author: Roland Dreier <roland@purestorage.com>
Date:   Fri May 2 11:18:41 2014 -0700

    x86, ioremap: Speed up check for RAM pages
    
    commit c81c8a1eeede61e92a15103748c23d100880cc8a upstream.
    
    In __ioremap_caller() (the guts of ioremap), we loop over the range of
    pfns being remapped and checks each one individually with page_is_ram().
    For large ioremaps, this can be very slow.  For example, we have a
    device with a 256 GiB PCI BAR, and ioremapping this BAR can take 20+
    seconds -- sometimes long enough to trigger the soft lockup detector!
    
    Internally, page_is_ram() calls walk_system_ram_range() on a single
    page.  Instead, we can make a single call to walk_system_ram_range()
    from __ioremap_caller(), and do our further checks only for any RAM
    pages that we find.  For the common case of MMIO, this saves an enormous
    amount of work, since the range being ioremapped doesn't intersect
    system RAM at all.
    
    With this change, ioremap on our 256 GiB BAR takes less than 1 second.
    
    Signed-off-by: Roland Dreier <roland@purestorage.com>
    Link: http://lkml.kernel.org/r/1399054721-1331-1-git-send-email-roland@kernel.org
    Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 8310f53f36bdbe400b8c6bfe6296f024ea9de6e0
Author: Guenter Roeck <linux@roeck-us.net>
Date:   Mon Jun 30 11:45:30 2014 -0700

    powerpc: Disable RELOCATABLE for COMPILE_TEST with PPC64
    
    commit fb43e8477ed9006c4f397f904c691a120503038c upstream.
    
    powerpc:allmodconfig has been failing for some time with the following
    error.
    
    arch/powerpc/kernel/exceptions-64s.S: Assembler messages:
    arch/powerpc/kernel/exceptions-64s.S:1312: Error: attempt to move .org backwards
    make[1]: *** [arch/powerpc/kernel/head_64.o] Error 1
    
    A number of attempts to fix the problem by moving around code have been
    unsuccessful and resulted in failed builds for some configurations and
    the discovery of toolchain bugs.
    
    Fix the problem by disabling RELOCATABLE for COMPILE_TEST builds instead.
    While this is less than perfect, it avoids substantial code changes
    which would otherwise be necessary just to make COMPILE_TEST builds
    happy and might have undesired side effects.
    
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit ca846a7a1fa185cf2520a755ba1944efac9b75f7
Author: Steven Rostedt (Red Hat) <rostedt@goodmis.org>
Date:   Tue Jun 10 09:46:00 2014 -0400

    ring-buffer: Check if buffer exists before polling
    
    commit 8b8b36834d0fff67fc8668093f4312dd04dcf21d upstream.
    
    The per_cpu buffers are created one per possible CPU. But these do
    not mean that those CPUs are online, nor do they even exist.
    
    With the addition of the ring buffer polling, it assumes that the
    caller polls on an existing buffer. But this is not the case if
    the user reads trace_pipe from a CPU that does not exist, and this
    causes the kernel to crash.
    
    Simple fix is to check the cpu against buffer bitmask against to see
    if the buffer was allocated or not and return -ENODEV if it is
    not.
    
    More updates were done to pass the -ENODEV back up to userspace.
    
    Link: http://lkml.kernel.org/r/5393DB61.6060707@oracle.com
    
    Reported-by: Sasha Levin <sasha.levin@oracle.com>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 378005bbce5cbbadadd581a9edc7d960b4316560
Author: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Date:   Mon Jun 23 13:22:07 2014 -0700

    DMA, CMA: fix possible memory leak
    
    commit fe8eea4f4a3f299ef83ed090d5354698ebe4fda8 upstream.
    
    We should free memory for bitmap when we find zone mismatch, otherwise
    this memory will leak.
    
    Additionally, I copy code comment from PPC KVM's CMA code to inform why
    we need to check zone mis-match.
    
    Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
    Acked-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
    Reviewed-by: Michal Nazarewicz <mina86@mina86.com>
    Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
    Acked-by: Minchan Kim <minchan@kernel.org>
    Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
    Cc: Marek Szyprowski <m.szyprowski@samsung.com>
    Cc: Michal Nazarewicz <mina86@mina86.com>
    Cc: Paolo Bonzini <pbonzini@redhat.com>
    Cc: Gleb Natapov <gleb@kernel.org>
    Cc: Alexander Graf <agraf@suse.de>
    Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    Cc: Paul Mackerras <paulus@samba.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit f29c738c2375d0db702e587bec74db8e25c1758b
Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
Date:   Thu Jun 5 20:02:59 2014 +0300

    drm/i915: Don't clobber the GTT when it's within stolen memory
    
    commit f1e1c2129b79cfdaf07bca37c5a10569fe021abe upstream.
    
    On most gen2-4 platforms the GTT can be (or maybe always is?)
    inside the stolen memory region. If that's the case, reduce the
    size of the stolen memory appropriately to make make sure we
    don't clobber the GTT.
    
    v2: Deal with gen4 36 bit physical address
    
    Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80151
    Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit d5a2e1498c1285b33e457d8b62598389e9d3c9f5
Author: Christian König <christian.koenig@amd.com>
Date:   Wed Jun 4 15:29:56 2014 +0200

    drm/radeon: stop poisoning the GART TLB
    
    commit 0986c1a55ca64b44ee126a2f719a6e9f28cbe0ed upstream.
    
    When we set the valid bit on invalid GART entries they are
    loaded into the TLB when an adjacent entry is loaded. This
    poisons the TLB with invalid entries which are sometimes
    not correctly removed on TLB flush.
    
    For stable inclusion the patch probably needs to be modified a bit.
    
    Signed-off-by: Christian König <christian.koenig@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 70db01574e61f9c1d7e31a446350f93e976a4ec0
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Mon Jul 7 17:59:37 2014 -0400

    drm/radeon: fix typo in golden register setup on evergreen
    
    commit 6abafb78f9881b4891baf74ab4e9f090ae45230e upstream.
    
    Fixes hangs on driver load on some cards.
    
    bug:
    https://bugs.freedesktop.org/show_bug.cgi?id=76998
    
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit d52023d8dab741fe093790eca47c32ba2bc89779
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Tue Jul 8 18:25:25 2014 -0400

    drm/radeon: fix typo in ci_stop_dpm()
    
    commit ed96377132e564d797c48a5490fd46bed01c4273 upstream.
    
    Need to use the RREG32_SMC() accessor since the register
    is an smc indirect index.
    
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit d5d31b715b30a67a3a60ac39fd6c92de680c1daa
Author: Alexandre Demers <alexandre.f.demers@gmail.com>
Date:   Tue Jul 8 22:27:36 2014 -0400

    drm/radeon/dpm: Reenabling SS on Cayman
    
    commit 41959341ac7e33dd360c7a881d13566f9eca37b2 upstream.
    
    It reverts commit c745fe611ca42295c9d91d8e305d27983e9132ef now that
    Cayman is stable since VDDCI fix. Spread spectrum was not the culprit.
    
    This depends on b0880e87c1fd038b84498944f52e52c3e86ebe59
    (drm/radeon/dpm: fix vddci setup typo on cayman).
    
    Signed-off-by: Alexandre Demers <alexandre.f.demers@gmail.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit e4b456d4e61e7f663f5e88849f5002ba685ba359
Author: Theodore Ts'o <tytso@mit.edu>
Date:   Sat Jul 12 15:32:24 2014 -0400

    ext4: fix a potential deadlock in __ext4_es_shrink()
    
    commit 3f1f9b851311a76226140b55b1ea22111234a7c2 upstream.
    
    This fixes the following lockdep complaint:
    
    [ INFO: possible circular locking dependency detected ]
    3.16.0-rc2-mm1+ #7 Tainted: G           O
    -------------------------------------------------------
    kworker/u24:0/4356 is trying to acquire lock:
     (&(&sbi->s_es_lru_lock)->rlock){+.+.-.}, at: [<ffffffff81285fff>] __ext4_es_shrink+0x4f/0x2e0
    
    but task is already holding lock:
     (&ei->i_es_lock){++++-.}, at: [<ffffffff81286961>] ext4_es_insert_extent+0x71/0x180
    
    which lock already depends on the new lock.
    
     Possible unsafe locking scenario:
    
           CPU0                    CPU1
           ----                    ----
      lock(&ei->i_es_lock);
                                   lock(&(&sbi->s_es_lru_lock)->rlock);
                                   lock(&ei->i_es_lock);
      lock(&(&sbi->s_es_lru_lock)->rlock);
    
     *** DEADLOCK ***
    
    6 locks held by kworker/u24:0/4356:
     #0:  ("writeback"){.+.+.+}, at: [<ffffffff81071d00>] process_one_work+0x180/0x560
     #1:  ((&(&wb->dwork)->work)){+.+.+.}, at: [<ffffffff81071d00>] process_one_work+0x180/0x560
     #2:  (&type->s_umount_key#22){++++++}, at: [<ffffffff811a9c74>] grab_super_passive+0x44/0x90
     #3:  (jbd2_handle){+.+...}, at: [<ffffffff812979f9>] start_this_handle+0x189/0x5f0
     #4:  (&ei->i_data_sem){++++..}, at: [<ffffffff81247062>] ext4_map_blocks+0x132/0x550
     #5:  (&ei->i_es_lock){++++-.}, at: [<ffffffff81286961>] ext4_es_insert_extent+0x71/0x180
    
    stack backtrace:
    CPU: 0 PID: 4356 Comm: kworker/u24:0 Tainted: G           O   3.16.0-rc2-mm1+ #7
    Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
    Workqueue: writeback bdi_writeback_workfn (flush-253:0)
     ffffffff8213dce0 ffff880014b07538 ffffffff815df0bb 0000000000000007
     ffffffff8213e040 ffff880014b07588 ffffffff815db3dd ffff880014b07568
     ffff880014b07610 ffff88003b868930 ffff88003b868908 ffff88003b868930
    Call Trace:
     [<ffffffff815df0bb>] dump_stack+0x4e/0x68
     [<ffffffff815db3dd>] print_circular_bug+0x1fb/0x20c
     [<ffffffff810a7a3e>] __lock_acquire+0x163e/0x1d00
     [<ffffffff815e89dc>] ? retint_restore_args+0xe/0xe
     [<ffffffff815ddc7b>] ? __slab_alloc+0x4a8/0x4ce
     [<ffffffff81285fff>] ? __ext4_es_shrink+0x4f/0x2e0
     [<ffffffff810a8707>] lock_acquire+0x87/0x120
     [<ffffffff81285fff>] ? __ext4_es_shrink+0x4f/0x2e0
     [<ffffffff8128592d>] ? ext4_es_free_extent+0x5d/0x70
     [<ffffffff815e6f09>] _raw_spin_lock+0x39/0x50
     [<ffffffff81285fff>] ? __ext4_es_shrink+0x4f/0x2e0
     [<ffffffff8119760b>] ? kmem_cache_alloc+0x18b/0x1a0
     [<ffffffff81285fff>] __ext4_es_shrink+0x4f/0x2e0
     [<ffffffff812869b8>] ext4_es_insert_extent+0xc8/0x180
     [<ffffffff812470f4>] ext4_map_blocks+0x1c4/0x550
     [<ffffffff8124c4c4>] ext4_writepages+0x6d4/0xd00
    	...
    
    Reported-by: Minchan Kim <minchan@kernel.org>
    Signed-off-by: Theodore Ts'o <tytso@mit.edu>
    Reported-by: Minchan Kim <minchan@kernel.org>
    Cc: Zheng Liu <gnehzuil.liu@gmail.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 38020539004ac2a24e1183f37fabd0dc9c657f5f
Author: Eric Sandeen <sandeen@redhat.com>
Date:   Sat Jul 5 19:18:22 2014 -0400

    ext4: disable synchronous transaction batching if max_batch_time==0
    
    commit 5dd214248f94d430d70e9230bda72f2654ac88a8 upstream.
    
    The mount manpage says of the max_batch_time option,
    
    	This optimization can be turned off entirely
    	by setting max_batch_time to 0.
    
    But the code doesn't do that.  So fix the code to do
    that.
    
    Signed-off-by: Eric Sandeen <sandeen@redhat.com>
    Signed-off-by: Theodore Ts'o <tytso@mit.edu>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 5795af2e8a16321e5eb9877e3c96510e2184abf4
Author: Theodore Ts'o <tytso@mit.edu>
Date:   Sat Jul 5 19:15:50 2014 -0400

    ext4: clarify ext4_error message in ext4_mb_generate_buddy_error()
    
    commit 94d4c066a4ff170a2671b1a9b153febbf36796f6 upstream.
    
    We are spending a lot of time explaining to users what this error
    means.  Let's try to improve the message to avoid this problem.
    
    Signed-off-by: Theodore Ts'o <tytso@mit.edu>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit f17c60ee789dab6e7233ec9b13ef566cf964141f
Author: Theodore Ts'o <tytso@mit.edu>
Date:   Sat Jul 5 18:40:52 2014 -0400

    ext4: clarify error count warning messages
    
    commit ae0f78de2c43b6fadd007c231a352b13b5be8ed2 upstream.
    
    Make it clear that values printed are times, and that it is error
    since last fsck. Also add note about fsck version required.
    
    Signed-off-by: Pavel Machek <pavel@ucw.cz>
    Signed-off-by: Theodore Ts'o <tytso@mit.edu>
    Reviewed-by: Andreas Dilger <adilger@dilger.ca>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 95f670b4b379ad85b0dacc9e7b724422df1b53f6
Author: Theodore Ts'o <tytso@mit.edu>
Date:   Sat Jul 5 16:28:35 2014 -0400

    ext4: fix unjournalled bg descriptor while initializing inode bitmap
    
    commit 61c219f5814277ecb71d64cb30297028d6665979 upstream.
    
    The first time that we allocate from an uninitialized inode allocation
    bitmap, if the block allocation bitmap is also uninitalized, we need
    to get write access to the block group descriptor before we start
    modifying the block group descriptor flags and updating the free block
    count, etc.  Otherwise, there is the potential of a bad journal
    checksum (if journal checksums are enabled), and of the file system
    becoming inconsistent if we crash at exactly the wrong time.
    
    Signed-off-by: Theodore Ts'o <tytso@mit.edu>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 07c07190d1632a504f6f1e504e784651986d16fd
Author: Vincent Minet <vincent@vincent-minet.net>
Date:   Sat Jul 5 01:51:33 2014 +0200

    intel_pstate: Set CPU number before accessing MSRs
    
    commit 179e8471673ce0249cd4ecda796008f7757e5bad upstream.
    
    Ensure that cpu->cpu is set before writing MSR_IA32_PERF_CTL during CPU
    initialization. Otherwise only cpu0 has its P-state set and all other
    cores are left with their values unchanged.
    
    In most cases, this is not too serious because the P-states will be set
    correctly when the timer function is run.  But when the default governor
    is set to performance, the per-CPU current_pstate stays the same forever
    and no attempts are made to write the MSRs again.
    
    Signed-off-by: Vincent Minet <vincent@vincent-minet.net>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 86def8656e3133d68f91cbccd30e74deea9edb7c
Author: Joe Thornber <thornber@redhat.com>
Date:   Fri Jun 27 15:29:04 2014 -0400

    dm io: fix a race condition in the wake up code for sync_io
    
    commit 10f1d5d111e8aed46a0f1179faf9a3cf422f689e upstream.
    
    There's a race condition between the atomic_dec_and_test(&io->count)
    in dec_count() and the waking of the sync_io() thread.  If the thread
    is spuriously woken immediately after the decrement it may exit,
    making the on stack io struct invalid, yet the dec_count could still
    be using it.
    
    Fix this race by using a completion in sync_io() and dec_count().
    
    Reported-by: Minfei Huang <huangminfei@ucloud.cn>
    Signed-off-by: Joe Thornber <thornber@redhat.com>
    Signed-off-by: Mike Snitzer <snitzer@redhat.com>
    Acked-by: Mikulas Patocka <mpatocka@redhat.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 71a046b808d524809937d06e279bf9a291fb58b8
Author: K. Y. Srinivasan <kys@microsoft.com>
Date:   Mon Jul 7 16:34:24 2014 -0700

    Drivers: hv: vmbus: Fix a bug in the channel callback dispatch code
    
    commit affb1aff300ddee54df307812b38f166e8a865ef upstream.
    
    Starting with Win8, we have implemented several optimizations to improve the
    scalability and performance of the VMBUS transport between the Host and the
    Guest. Some of the non-performance critical services cannot leverage these
    optimization since they only read and process one message at a time.
    Make adjustments to the callback dispatch code to account for the way
    non-performance critical drivers handle reading of the channel.
    
    Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit c2602aa9ffd73202901ec0a3bbbfdad0b2d1a8e8
Author: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Date:   Fri Jun 27 14:21:10 2014 +0200

    clk: s2mps11: Fix double free corruption during driver unbind
    
    commit 2a96dfa49c83a2a7cbdb11382976aaa6b2636764 upstream.
    
    After unbinding the driver memory was corrupted by double free of
    clk_lookup structure. This lead to OOPS when re-binding the driver
    again.
    
    The driver allocated memory for 'clk_lookup' with devm_kzalloc. During
    driver removal this memory was freed twice: once by clkdev_drop() and
    second by devm code.
    
    Kernel panic log:
    [   30.839284] Unable to handle kernel paging request at virtual address 5f343173
    [   30.846476] pgd = dee14000
    [   30.849165] [5f343173] *pgd=00000000
    [   30.852703] Internal error: Oops: 805 [#1] PREEMPT SMP ARM
    [   30.858166] Modules linked in:
    [   30.861208] CPU: 0 PID: 1 Comm: bash Not tainted 3.16.0-rc2-00239-g94bdf617b07e-dirty #40
    [   30.869364] task: df478000 ti: df480000 task.ti: df480000
    [   30.874752] PC is at clkdev_add+0x2c/0x38
    [   30.878738] LR is at clkdev_add+0x18/0x38
    [   30.882732] pc : [<c0350908>]    lr : [<c03508f4>]    psr: 60000013
    [   30.882732] sp : df481e78  ip : 00000001  fp : c0700ed8
    [   30.894187] r10: 0000000c  r9 : 00000000  r8 : c07b0e3c
    [   30.899396] r7 : 00000002  r6 : df45f9d0  r5 : df421390  r4 : c0700d6c
    [   30.905906] r3 : 5f343173  r2 : c0700d84  r1 : 60000013  r0 : c0700d6c
    [   30.912417] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
    [   30.919534] Control: 10c53c7d  Table: 5ee1406a  DAC: 00000015
    [   30.925262] Process bash (pid: 1, stack limit = 0xdf480240)
    [   30.930817] Stack: (0xdf481e78 to 0xdf482000)
    [   30.935159] 1e60:                                                       00001000 df6de610
    [   30.943321] 1e80: df7f4558 c0355650 c05ec6ec c0700eb0 df6de600 df7f4510 dec9d69c 00000014
    [   30.951480] 1ea0: 00167b48 df6de610 c0700e30 c0713518 00000000 c0700e30 dec9d69c 00000006
    [   30.959639] 1ec0: 00167b48 c02c1b7c c02c1b64 df6de610 c07aff48 c02c0420 c06fb150 c047cc20
    [   30.967798] 1ee0: df6de610 df6de610 c0700e30 df6de644 c06fb150 0000000c dec9d690 c02bef90
    [   30.975957] 1f00: dec9c6c0 dece4c00 df481f80 dece4c00 0000000c c02be73c 0000000c c016ca8c
    [   30.984116] 1f20: c016ca48 00000000 00000000 c016c1f4 00000000 00000000 b6f18000 df481f80
    [   30.992276] 1f40: df7f66c0 0000000c df480000 df480000 b6f18000 c011094c df47839c 60000013
    [   31.000435] 1f60: 00000000 00000000 df7f66c0 df7f66c0 0000000c df480000 b6f18000 c0110dd4
    [   31.008594] 1f80: 00000000 00000000 0000000c b6ec05d8 0000000c b6f18000 00000004 c000f2a8
    [   31.016753] 1fa0: 00001000 c000f0e0 b6ec05d8 0000000c 00000001 b6f18000 0000000c 00000000
    [   31.024912] 1fc0: b6ec05d8 0000000c b6f18000 00000004 0000000c 00000001 00000000 00167b48
    [   31.033071] 1fe0: 00000000 bed83a80 b6e004f0 b6e5122c 60000010 00000001 ffffffff ffffffff
    [   31.041248] [<c0350908>] (clkdev_add) from [<c0355650>] (s2mps11_clk_probe+0x2b4/0x3b4)
    [   31.049223] [<c0355650>] (s2mps11_clk_probe) from [<c02c1b7c>] (platform_drv_probe+0x18/0x48)
    [   31.057728] [<c02c1b7c>] (platform_drv_probe) from [<c02c0420>] (driver_probe_device+0x13c/0x384)
    [   31.066579] [<c02c0420>] (driver_probe_device) from [<c02bef90>] (bind_store+0x88/0xd8)
    [   31.074564] [<c02bef90>] (bind_store) from [<c02be73c>] (drv_attr_store+0x20/0x2c)
    [   31.082118] [<c02be73c>] (drv_attr_store) from [<c016ca8c>] (sysfs_kf_write+0x44/0x48)
    [   31.090016] [<c016ca8c>] (sysfs_kf_write) from [<c016c1f4>] (kernfs_fop_write+0xc0/0x17c)
    [   31.098176] [<c016c1f4>] (kernfs_fop_write) from [<c011094c>] (vfs_write+0xa0/0x1c4)
    [   31.105899] [<c011094c>] (vfs_write) from [<c0110dd4>] (SyS_write+0x40/0x8c)
    [   31.112931] [<c0110dd4>] (SyS_write) from [<c000f0e0>] (ret_fast_syscall+0x0/0x3c)
    [   31.120481] Code: e2842018 e584501c e1a00004 e885000c (e5835000)
    [   31.126596] ---[ end trace efad45bfa3a61b05 ]---
    [   31.131181] Kernel panic - not syncing: Fatal exception
    [   31.136368] CPU1: stopping
    [   31.139054] CPU: 1 PID: 0 Comm: swapper/1 Tainted: G      D       3.16.0-rc2-00239-g94bdf617b07e-dirty #40
    [   31.148697] [<c0016480>] (unwind_backtrace) from [<c0012950>] (show_stack+0x10/0x14)
    [   31.156419] [<c0012950>] (show_stack) from [<c0480db8>] (dump_stack+0x80/0xcc)
    [   31.163622] [<c0480db8>] (dump_stack) from [<c001499c>] (handle_IPI+0x130/0x15c)
    [   31.170998] [<c001499c>] (handle_IPI) from [<c000862c>] (gic_handle_irq+0x60/0x68)
    [   31.178549] [<c000862c>] (gic_handle_irq) from [<c0013480>] (__irq_svc+0x40/0x70)
    [   31.186009] Exception stack(0xdf4bdf88 to 0xdf4bdfd0)
    [   31.191046] df80:                   ffffffed 00000000 00000000 00000000 df4bc000 c06d042c
    [   31.199207] dfa0: 00000000 ffffffed c06d03c0 00000000 c070c288 00000000 00000000 df4bdfd0
    [   31.207363] dfc0: c0010324 c0010328 60000013 ffffffff
    [   31.212402] [<c0013480>] (__irq_svc) from [<c0010328>] (arch_cpu_idle+0x28/0x30)
    [   31.219783] [<c0010328>] (arch_cpu_idle) from [<c005f150>] (cpu_startup_entry+0x2c4/0x3f0)
    [   31.228027] [<c005f150>] (cpu_startup_entry) from [<400086c4>] (0x400086c4)
    [   31.234968] ---[ end Kernel panic - not syncing: Fatal exception
    
    Fixes: 7cc560dea415 ("clk: s2mps11: Add support for s2mps11")
    Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
    Reviewed-by: Yadwinder Singh Brar <yadi.brar@samsung.com>
    Signed-off-by: Mike Turquette <mturquette@linaro.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit dce080c4f6a377ae7f0a6b0157f63ae48d5abdde
Author: Thomas Gleixner <tglx@linutronix.de>
Date:   Thu Jun 19 21:52:23 2014 +0000

    clk: spear3xx: Use proper control register offset
    
    commit 15ebb05248d025534773c9ef64915bd888f04e4b upstream.
    
    The control register is at offset 0x10, not 0x0. This is wreckaged
    since commit 5df33a62c (SPEAr: Switch to common clock framework).
    
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
    Signed-off-by: Mike Turquette <mturquette@linaro.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit ccca5d34ac88c8d9200cce6f9e26f2e86be7dfaa
Author: Colin Cross <ccross@android.com>
Date:   Wed Jun 18 21:10:09 2014 +0100

    arm64: implement TASK_SIZE_OF
    
    commit fa2ec3ea10bd377f9d55772b1dab65178425a1a2 upstream.
    
    include/linux/sched.h implements TASK_SIZE_OF as TASK_SIZE if it
    is not set by the architecture headers.  TASK_SIZE uses the
    current task to determine the size of the virtual address space.
    On a 64-bit kernel this will cause reading /proc/pid/pagemap of a
    64-bit process from a 32-bit process to return EOF when it reads
    past 0xffffffff.
    
    Implement TASK_SIZE_OF exactly the same as TASK_SIZE with
    test_tsk_thread_flag instead of test_thread_flag.
    
    Signed-off-by: Colin Cross <ccross@android.com>
    Acked-by: Will Deacon <will.deacon@arm.com>
    Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 49049cd0b036f01c91e1820033c6637f26860bab
Author: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Date:   Mon Jun 23 19:41:05 2014 +0300

    crypto: sha512_ssse3 - fix byte count to bit count conversion
    
    commit cfe82d4f45c7cc39332a2be7c4c1d3bf279bbd3d upstream.
    
    Byte-to-bit-count computation is only partly converted to big-endian and is
    mixing in CPU-endian values. Problem was noticed by sparce with warning:
    
      CHECK   arch/x86/crypto/sha512_ssse3_glue.c
    arch/x86/crypto/sha512_ssse3_glue.c:144:19: warning: restricted __be64 degrades to integer
    arch/x86/crypto/sha512_ssse3_glue.c:144:17: warning: incorrect type in assignment (different base types)
    arch/x86/crypto/sha512_ssse3_glue.c:144:17:    expected restricted __be64 <noident>
    arch/x86/crypto/sha512_ssse3_glue.c:144:17:    got unsigned long long
    
    Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
    Acked-by: Tim Chen <tim.c.chen@linux.intel.com>
    Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 52df57db58770bfcf552f9eb65366696f03328a7
Author: Prabhakar Lad <prabhakar.csengg@gmail.com>
Date:   Tue Jul 8 16:25:38 2014 +0100

    cpufreq: Makefile: fix compilation for davinci platform
    
    commit 5a90af67c2126fe1d04ebccc1f8177e6ca70d3a9 upstream.
    
    Since commtit 8a7b1227e303 (cpufreq: davinci: move cpufreq driver to
    drivers/cpufreq) this added dependancy only for CONFIG_ARCH_DAVINCI_DA850
    where as davinci_cpufreq_init() call is used by all davinci platform.
    
    This patch fixes following build error:
    
    arch/arm/mach-davinci/built-in.o: In function `davinci_init_late':
    :(.init.text+0x928): undefined reference to `davinci_cpufreq_init'
    make: *** [vmlinux] Error 1
    
    Fixes: 8a7b1227e303 (cpufreq: davinci: move cpufreq driver to drivers/cpufreq)
    Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
    Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 19528a53afb83a2268055f30ca2511d4179a86e3
Author: Joel Stanley <joel@jms.id.au>
Date:   Tue Jul 8 16:08:22 2014 +0930

    powerpc/perf: Clear MMCR2 when enabling PMU
    
    commit b50a6c584bb47b370f84bfd746770c0bbe7129b7 upstream.
    
    On POWER8 when switching to a KVM guest we set bits in MMCR2 to freeze
    the PMU counters. Aside from on boot they are then never reset,
    resulting in stuck perf counters for any user in the guest or host.
    
    We now set MMCR2 to 0 whenever enabling the PMU, which provides a sane
    state for perf to use the PMU counters under either the guest or the
    host.
    
    This was manifesting as a bug with ppc64_cpu --frequency:
    
        $ sudo ppc64_cpu --frequency
        WARNING: couldn't run on cpu 0
        WARNING: couldn't run on cpu 8
          ...
        WARNING: couldn't run on cpu 144
        WARNING: couldn't run on cpu 152
        min:    18446744073.710 GHz (cpu -1)
        max:    0.000 GHz (cpu -1)
        avg:    0.000 GHz
    
    The command uses a perf counter to measure CPU cycles over a fixed
    amount of time, in order to approximate the frequency of the machine.
    The counters were returning zero once a guest was started, regardless of
    weather it was still running or had been shut down.
    
    By dumping the value of MMCR2, it was observed that once a guest is
    running MMCR2 is set to 1s - which stops counters from running:
    
        $ sudo sh -c 'echo p > /proc/sysrq-trigger'
        CPU: 0 PMU registers, ppmu = POWER8 n_counters = 6
        PMC1:  5b635e38 PMC2: 00000000 PMC3: 00000000 PMC4: 00000000
        PMC5:  1bf5a646 PMC6: 5793d378 PMC7: deadbeef PMC8: deadbeef
        MMCR0: 0000000080000000 MMCR1: 000000001e000000 MMCRA: 0000040000000000
        MMCR2: fffffffffffffc00 EBBHR: 0000000000000000
        EBBRR: 0000000000000000 BESCR: 0000000000000000
        SIAR:  00000000000a51cc SDAR:  c00000000fc40000 SIER:  0000000001000000
    
    This is done unconditionally in book3s_hv_interrupts.S upon entering the
    guest, and the original value is only save/restored if the host has
    indicated it was using the PMU. This is okay, however the user of the
    PMU needs to ensure that it is in a defined state when it starts using
    it.
    
    Fixes: e05b9b9e5c10 ("powerpc/perf: Power8 PMU support")
    Signed-off-by: Joel Stanley <joel@jms.id.au>
    Acked-by: Michael Ellerman <mpe@ellerman.id.au>
    Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 2574447727403dd8f2f1c40d4d6a6933c427a79d
Author: Joel Stanley <joel@jms.id.au>
Date:   Tue Jul 8 16:08:21 2014 +0930

    powerpc/perf: Add PPMU_ARCH_207S define
    
    commit 4d9690dd56b0d18f2af8a9d4a279cb205aae3345 upstream.
    
    Instead of separate bits for every POWER8 PMU feature, have a single one
    for v2.07 of the architecture.
    
    This saves us adding a MMCR2 define for a future patch.
    
    Signed-off-by: Joel Stanley <joel@jms.id.au>
    Acked-by: Michael Ellerman <mpe@ellerman.id.au>
    Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit a348a994e4312b0566c72ec49d72a4a754e267d8
Author: Anton Blanchard <anton@samba.org>
Date:   Thu May 29 08:15:38 2014 +1000

    powerpc/perf: Never program book3s PMCs with values >= 0x80000000
    
    commit f56029410a13cae3652d1f34788045c40a13ffc7 upstream.
    
    We are seeing a lot of PMU warnings on POWER8:
    
        Can't find PMC that caused IRQ
    
    Looking closer, the active PMC is 0 at this point and we took a PMU
    exception on the transition from negative to 0. Some versions of POWER8
    have an issue where they edge detect and not level detect PMC overflows.
    
    A number of places program the PMC with (0x80000000 - period_left),
    where period_left can be negative. We can either fix all of these or
    just ensure that period_left is always >= 1.
    
    This patch takes the second option.
    
    Signed-off-by: Anton Blanchard <anton@samba.org>
    Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 8c1eb0393ccc6ab3e79fae8a1e7dcd538f0af010
Author: Lv Zheng <lv.zheng@intel.com>
Date:   Sun Jun 15 08:42:07 2014 +0800

    ACPI / EC: Fix race condition in ec_transaction_completed()
    
    commit c0d653412fc8450370167a3268b78fc772ff9c87 upstream.
    
    There is a race condition in ec_transaction_completed().
    
    When ec_transaction_completed() is called in the GPE handler, it could
    return true because of (ec->curr == NULL). Then the wake_up() invocation
    could complete the next command unexpectedly since there is no lock between
    the 2 invocations. With the previous cleanup, the IBF=0 waiter race need
    not be handled any more. It's now safe to return a flag from
    advance_condition() to indicate the requirement of wakeup, the flag is
    returned from a locked context.
    
    The ec_transaction_completed() is now only invoked by the ec_poll() where
    the ec->curr is ensured to be different from NULL.
    
    After cleaning up, the EVT_SCI=1 check should be moved out of the wakeup
    condition so that an EVT_SCI raised with (ec->curr == NULL) can trigger a
    QR_SC command.
    
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=70891
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=63931
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=59911
    Reported-and-tested-by: Gareth Williams <gareth@garethwilliams.me.uk>
    Reported-and-tested-by: Hans de Goede <jwrdegoede@fedoraproject.org>
    Reported-by: Barton Xu <tank.xuhan@gmail.com>
    Tested-by: Steffen Weber <steffen.weber@gmail.com>
    Tested-by: Arthur Chen <axchen@nvidia.com>
    Signed-off-by: Lv Zheng <lv.zheng@intel.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 208614e5439f886ecab37b35de7841221a51e5e1
Author: Lv Zheng <lv.zheng@intel.com>
Date:   Sun Jun 15 08:41:48 2014 +0800

    ACPI / EC: Remove duplicated ec_wait_ibf0() waiter
    
    commit 9b80f0f73ae1583c22325ede341c74195847618c upstream.
    
    After we've added the first command byte write into advance_transaction(),
    the IBF=0 waiter is duplicated with the command completion waiter
    implemented in the ec_poll() because:
       If IBF=1 blocked the first command byte write invoked in the task
       context ec_poll(), it would be kicked off upon IBF=0 interrupt or timed
       out and retried again in the task context.
    
    Remove this seperate and duplicate IBF=0 waiter.  By doing so we can
    reduce the overall number of times to access the EC_SC(R) status
    register.
    
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=70891
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=63931
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=59911
    Reported-and-tested-by: Gareth Williams <gareth@garethwilliams.me.uk>
    Reported-and-tested-by: Hans de Goede <jwrdegoede@fedoraproject.org>
    Reported-by: Barton Xu <tank.xuhan@gmail.com>
    Tested-by: Steffen Weber <steffen.weber@gmail.com>
    Tested-by: Arthur Chen <axchen@nvidia.com>
    Signed-off-by: Lv Zheng <lv.zheng@intel.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 6fb7e70df60963690310c1a137562ef7041e7d5c
Author: Lv Zheng <lv.zheng@intel.com>
Date:   Sun Jun 15 08:41:35 2014 +0800

    ACPI / EC: Add asynchronous command byte write support
    
    commit f92fca0060fc4dc9227342d0072d75df98c1e5a5 upstream.
    
    Move the first command byte write into advance_transaction() so that all
    EC register accesses that can affect the command processing state machine
    can happen in this asynchronous state machine advancement function.
    
    The advance_transaction() function then can be a complete implementation
    of an asyncrhonous transaction for a single command so that:
     1. The first command byte can be written in the interrupt context;
     2. The command completion waiter can also be used to wait the first command
        byte's timeout;
     3. In BURST mode, the follow-up command bytes can be written in the
        interrupt context directly, so that it doesn't need to return to the
        task context. Returning to the task context reduces the throughput of
        the BURST mode and in the worst cases where the system workload is very
        high, this leads to the hardware driven automatic BURST mode exit.
    
    In order not to increase memory consumption, convert 'done' into 'flags'
    to contain multiple indications:
     1. ACPI_EC_COMMAND_COMPLETE: converting from original 'done' condition,
        indicating the completion of the command transaction.
     2. ACPI_EC_COMMAND_POLL: indicating the availability of writing the first
        command byte. A new command can utilize this flag to compete for the
        right of accessing the underlying hardware. There is a follow-up bug
        fix that has utilized this new flag.
    
    The 2 flags are important because it also reflects a key concept of IO
    programs' design used in the system softwares. Normally an IO program
    running in the kernel should first be implemented in the asynchronous way.
    And the 2 flags are the most common way to implement its synchronous
    operations on top of the asynchronous operations:
    1. POLL: This flag can be used to block until the asynchronous operations
             can happen.
    2. COMPLETE: This flag can be used to block until the asynchronous
                 operations have completed.
    By constructing code cleanly in this way, many difficult problems can be
    solved smoothly.
    
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=70891
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=63931
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=59911
    Reported-and-tested-by: Gareth Williams <gareth@garethwilliams.me.uk>
    Reported-and-tested-by: Hans de Goede <jwrdegoede@fedoraproject.org>
    Reported-by: Barton Xu <tank.xuhan@gmail.com>
    Tested-by: Steffen Weber <steffen.weber@gmail.com>
    Tested-by: Arthur Chen <axchen@nvidia.com>
    Signed-off-by: Lv Zheng <lv.zheng@intel.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit e9b3f9c5625e23301d10d9d9fbcfab84c791419e
Author: Lv Zheng <lv.zheng@intel.com>
Date:   Sun Jun 15 08:41:17 2014 +0800

    ACPI / EC: Avoid race condition related to advance_transaction()
    
    commit 66b42b78bc1e816f92b662e8888c89195e4199e1 upstream.
    
    The advance_transaction() will be invoked from the IRQ context GPE handler
    and the task context ec_poll(). The handling of this function is locked so
    that the EC state machine are ensured to be advanced sequentially.
    
    But there is a problem. Before invoking advance_transaction(), EC_SC(R) is
    read. Then for advance_transaction(), there could be race condition around
    the lock from both contexts. The first one reading the register could fail
    this race and when it passes the stale register value to the state machine
    advancement code, the hardware condition is totally different from when
    the register is read. And the hardware accesses determined from the wrong
    hardware status can break the EC state machine. And there could be cases
    that the functionalities of the platform firmware are seriously affected.
    For example:
     1. When 2 EC_DATA(W) writes compete the IBF=0, the 2nd EC_DATA(W) write may
        be invalid due to IBF=1 after the 1st EC_DATA(W) write. Then the
        hardware will either refuse to respond a next EC_SC(W) write of the next
        command or discard the current WR_EC command when it receives a EC_SC(W)
        write of the next command.
     2. When 1 EC_SC(W) write and 1 EC_DATA(W) write compete the IBF=0, the
        EC_DATA(W) write may be invalid due to IBF=1 after the EC_SC(W) write.
        The next EC_DATA(R) could never be responded by the hardware. This is
        the root cause of the reported issue.
    
    Fix this issue by moving the EC_SC(R) access into the lock so that we can
    ensure that the state machine is advanced consistently.
    
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=70891
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=63931
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=59911
    Reported-and-tested-by: Gareth Williams <gareth@garethwilliams.me.uk>
    Reported-and-tested-by: Hans de Goede <jwrdegoede@fedoraproject.org>
    Reported-by: Barton Xu <tank.xuhan@gmail.com>
    Tested-by: Steffen Weber <steffen.weber@gmail.com>
    Tested-by: Arthur Chen <axchen@nvidia.com>
    Signed-off-by: Lv Zheng <lv.zheng@intel.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 9d3d2645bfd7a58f2ab06698a644e4da479b2429
Author: Axel Lin <axel.lin@ingics.com>
Date:   Thu Jul 3 22:45:45 2014 +0800

    hwmon: (adm1021) Fix cache problem when writing temperature limits
    
    commit c024044d4da2c9c3b32933b4235df1e409293b84 upstream.
    
    The module test script for the adm1021 driver exposes a cache problem
    when writing temperature limits. temp_min and temp_max are expected
    to be stored in milli-degrees C but are stored in degrees C.
    
    Reported-by: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: Axel Lin <axel.lin@ingics.com>
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit fc3ea4233ec6c3a7da7780007cf1c6ca8d13ce97
Author: Axel Lin <axel.lin@ingics.com>
Date:   Wed Jul 2 08:29:55 2014 +0800

    hwmon: (adm1029) Ensure the fan_div cache is updated in set_fan_div
    
    commit 1035a9e3e9c76b64a860a774f5b867d28d34acc2 upstream.
    
    Writing to fanX_div does not clear the cache. As a result, reading
    from fanX_div may return the old value for up to two seconds
    after writing a new value.
    
    This patch ensures the fan_div cache is updated in set_fan_div().
    
    Reported-by: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: Axel Lin <axel.lin@ingics.com>
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit b375dd2795184f4b3b7dcfc45da9581ddc840e71
Author: Guenter Roeck <linux@roeck-us.net>
Date:   Thu Jul 3 13:44:23 2014 -0700

    hwmon: (adm1031) Fix writes to limit registers
    
    commit 145e74a4e5022225adb84f4e5d4fff7938475c35 upstream.
    
    Upper limit for write operations to temperature limit registers
    was clamped to a fractional value. However, limit registers do
    not support fractional values. As a result, upper limits of 127.5
    degrees C or higher resulted in a rounded limit of 128 degrees C.
    Since limit registers are signed, this was stored as -128 degrees C.
    Clamp limits to (-55, +127) degrees C to solve the problem.
    
    Value on writes to auto_temp[12]_min and auto_temp[12]_max were not
    clamped at all, but masked. As a result, out-of-range writes resulted
    in a more or less arbitrary limit. Clamp those attributes to (0, 127)
    degrees C for more predictable results.
    
    Cc: Axel Lin <axel.lin@ingics.com>
    Reviewed-by: Jean Delvare <jdelvare@suse.de>
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 08efa418a9d5fdf12a383555e44d57280bff7fce
Author: Guenter Roeck <linux@roeck-us.net>
Date:   Sun Jul 6 11:39:24 2014 -0700

    hwmon: (emc2103) Clamp limits instead of bailing out
    
    commit f6c2dd20108c35e30e2c1f3c6142d189451a626b upstream.
    
    It is customary to clamp limits instead of bailing out with an error
    if a configured limit is out of the range supported by the driver.
    This simplifies limit configuration, since the user will not typically
    know chip and/or driver specific limits.
    
    Reviewed-by: Jean Delvare <jdelvare@suse.de>
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit b57dd1ade2c2ba513ef03227548325dff760fbdf
Author: Axel Lin <axel.lin@ingics.com>
Date:   Wed Jul 2 07:44:44 2014 +0800

    hwmon: (amc6821) Fix permissions for temp2_input
    
    commit df86754b746e9a0ff6f863f690b1c01d408e3cdc upstream.
    
    temp2_input should not be writable, fix it.
    
    Reported-by: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: Axel Lin <axel.lin@ingics.com>
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit c8052537da2c9dbdcf0bbf479ab7c561a1b8d982
Author: Aaron Lu <aaron.lu@intel.com>
Date:   Wed May 21 16:33:27 2014 +0800

    thermal: hwmon: Make the check for critical temp valid consistent
    
    commit e8db5d6736a712a3e2280c0e31f4b301d85172d8 upstream.
    
    On 05/21/2014 04:22 PM, Aaron Lu wrote:
    > On 05/21/2014 01:57 PM, Kui Zhang wrote:
    >> Hello,
    >>
    >> I get following error when rmmod thermal.
    >>
    >> rmmod  thermal
    >> Killed
    
    While dealing with this problem, I found another problem that also
    results in a kernel crash on thermal module removal:
    
    From: Aaron Lu <aaron.lu@intel.com>
    Date: Wed, 21 May 2014 16:05:38 +0800
    Subject: thermal: hwmon: Make the check for critical temp valid consistent
    
    We used the tz->ops->get_crit_temp && !tz->ops->get_crit_temp(tz, temp)
    to decide if we need to create the temp_crit attribute file but we just
    check if tz->ops->get_crit_temp exists to decide if we need to remove
    that attribute file. Some ACPI thermal zone doesn't have a valid critical
    trip point and that would result in removing a non-existent device file
    on thermal module unload.
    
    Signed-off-by: Aaron Lu <aaron.lu@intel.com>
    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 9b8fa806491226ca3540acb9364b5181f1ab4142
Author: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Date:   Mon Jul 7 09:56:48 2014 -0400

    workqueue: zero cpumask of wq_numa_possible_cpumask on init
    
    commit 5a6024f1604eef119cf3a6fa413fe0261a81a8f3 upstream.
    
    When hot-adding and onlining CPU, kernel panic occurs, showing following
    call trace.
    
      BUG: unable to handle kernel paging request at 0000000000001d08
      IP: [<ffffffff8114acfd>] __alloc_pages_nodemask+0x9d/0xb10
      PGD 0
      Oops: 0000 [#1] SMP
      ...
      Call Trace:
       [<ffffffff812b8745>] ? cpumask_next_and+0x35/0x50
       [<ffffffff810a3283>] ? find_busiest_group+0x113/0x8f0
       [<ffffffff81193bc9>] ? deactivate_slab+0x349/0x3c0
       [<ffffffff811926f1>] new_slab+0x91/0x300
       [<ffffffff815de95a>] __slab_alloc+0x2bb/0x482
       [<ffffffff8105bc1c>] ? copy_process.part.25+0xfc/0x14c0
       [<ffffffff810a3c78>] ? load_balance+0x218/0x890
       [<ffffffff8101a679>] ? sched_clock+0x9/0x10
       [<ffffffff81105ba9>] ? trace_clock_local+0x9/0x10
       [<ffffffff81193d1c>] kmem_cache_alloc_node+0x8c/0x200
       [<ffffffff8105bc1c>] copy_process.part.25+0xfc/0x14c0
       [<ffffffff81114d0d>] ? trace_buffer_unlock_commit+0x4d/0x60
       [<ffffffff81085a80>] ? kthread_create_on_node+0x140/0x140
       [<ffffffff8105d0ec>] do_fork+0xbc/0x360
       [<ffffffff8105d3b6>] kernel_thread+0x26/0x30
       [<ffffffff81086652>] kthreadd+0x2c2/0x300
       [<ffffffff81086390>] ? kthread_create_on_cpu+0x60/0x60
       [<ffffffff815f20ec>] ret_from_fork+0x7c/0xb0
       [<ffffffff81086390>] ? kthread_create_on_cpu+0x60/0x60
    
    In my investigation, I found the root cause is wq_numa_possible_cpumask.
    All entries of wq_numa_possible_cpumask is allocated by
    alloc_cpumask_var_node(). And these entries are used without initializing.
    So these entries have wrong value.
    
    When hot-adding and onlining CPU, wq_update_unbound_numa() is called.
    wq_update_unbound_numa() calls alloc_unbound_pwq(). And alloc_unbound_pwq()
    calls get_unbound_pool(). In get_unbound_pool(), worker_pool->node is set
    as follow:
    
    3592         /* if cpumask is contained inside a NUMA node, we belong to that node */
    3593         if (wq_numa_enabled) {
    3594                 for_each_node(node) {
    3595                         if (cpumask_subset(pool->attrs->cpumask,
    3596                                            wq_numa_possible_cpumask[node])) {
    3597                                 pool->node = node;
    3598                                 break;
    3599                         }
    3600                 }
    3601         }
    
    But wq_numa_possible_cpumask[node] does not have correct cpumask. So, wrong
    node is selected. As a result, kernel panic occurs.
    
    By this patch, all entries of wq_numa_possible_cpumask are allocated by
    zalloc_cpumask_var_node to initialize them. And the panic disappeared.
    
    Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
    Reviewed-by: Lai Jiangshan <laijs@cn.fujitsu.com>
    Signed-off-by: Tejun Heo <tj@kernel.org>
    Fixes: bce903809ab3 ("workqueue: add wq_numa_tbl_len and wq_numa_possible_cpumask[]")
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit d9e8b4f661a91d29bd641568a30e54c93cebb15d
Author: Gu Zheng <guz.fnst@cn.fujitsu.com>
Date:   Wed Jun 25 09:57:18 2014 +0800

    cpuset,mempolicy: fix sleeping function called from invalid context
    
    commit 391acf970d21219a2a5446282d3b20eace0c0d7a upstream.
    
    When runing with the kernel(3.15-rc7+), the follow bug occurs:
    [ 9969.258987] BUG: sleeping function called from invalid context at kernel/locking/mutex.c:586
    [ 9969.359906] in_atomic(): 1, irqs_disabled(): 0, pid: 160655, name: python
    [ 9969.441175] INFO: lockdep is turned off.
    [ 9969.488184] CPU: 26 PID: 160655 Comm: python Tainted: G       A      3.15.0-rc7+ #85
    [ 9969.581032] Hardware name: FUJITSU-SV PRIMEQUEST 1800E/SB, BIOS PRIMEQUEST 1000 Series BIOS Version 1.39 11/16/2012
    [ 9969.706052]  ffffffff81a20e60 ffff8803e941fbd0 ffffffff8162f523 ffff8803e941fd18
    [ 9969.795323]  ffff8803e941fbe0 ffffffff8109995a ffff8803e941fc58 ffffffff81633e6c
    [ 9969.884710]  ffffffff811ba5dc ffff880405c6b480 ffff88041fdd90a0 0000000000002000
    [ 9969.974071] Call Trace:
    [ 9970.003403]  [<ffffffff8162f523>] dump_stack+0x4d/0x66
    [ 9970.065074]  [<ffffffff8109995a>] __might_sleep+0xfa/0x130
    [ 9970.130743]  [<ffffffff81633e6c>] mutex_lock_nested+0x3c/0x4f0
    [ 9970.200638]  [<ffffffff811ba5dc>] ? kmem_cache_alloc+0x1bc/0x210
    [ 9970.272610]  [<ffffffff81105807>] cpuset_mems_allowed+0x27/0x140
    [ 9970.344584]  [<ffffffff811b1303>] ? __mpol_dup+0x63/0x150
    [ 9970.409282]  [<ffffffff811b1385>] __mpol_dup+0xe5/0x150
    [ 9970.471897]  [<ffffffff811b1303>] ? __mpol_dup+0x63/0x150
    [ 9970.536585]  [<ffffffff81068c86>] ? copy_process.part.23+0x606/0x1d40
    [ 9970.613763]  [<ffffffff810bf28d>] ? trace_hardirqs_on+0xd/0x10
    [ 9970.683660]  [<ffffffff810ddddf>] ? monotonic_to_bootbased+0x2f/0x50
    [ 9970.759795]  [<ffffffff81068cf0>] copy_process.part.23+0x670/0x1d40
    [ 9970.834885]  [<ffffffff8106a598>] do_fork+0xd8/0x380
    [ 9970.894375]  [<ffffffff81110e4c>] ? __audit_syscall_entry+0x9c/0xf0
    [ 9970.969470]  [<ffffffff8106a8c6>] SyS_clone+0x16/0x20
    [ 9971.030011]  [<ffffffff81642009>] stub_clone+0x69/0x90
    [ 9971.091573]  [<ffffffff81641c29>] ? system_call_fastpath+0x16/0x1b
    
    The cause is that cpuset_mems_allowed() try to take
    mutex_lock(&callback_mutex) under the rcu_read_lock(which was hold in
    __mpol_dup()). And in cpuset_mems_allowed(), the access to cpuset is
    under rcu_read_lock, so in __mpol_dup, we can reduce the rcu_read_lock
    protection region to protect the access to cpuset only in
    current_cpuset_is_being_rebound(). So that we can avoid this bug.
    
    This patch is a temporary solution that just addresses the bug
    mentioned above, can not fix the long-standing issue about cpuset.mems
    rebinding on fork():
    
    "When the forker's task_struct is duplicated (which includes
     ->mems_allowed) and it races with an update to cpuset_being_rebound
     in update_tasks_nodemask() then the task's mems_allowed doesn't get
     updated. And the child task's mems_allowed can be wrong if the
     cpuset's nodemask changes before the child has been added to the
     cgroup's tasklist."
    
    Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
    Acked-by: Li Zefan <lizefan@huawei.com>
    Signed-off-by: Tejun Heo <tj@kernel.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 982170a363d53cf2c65547e79d0a30055268a841
Author: Maxime Bizon <mbizon@freebox.fr>
Date:   Mon Jun 23 16:35:35 2014 +0200

    workqueue: fix dev_set_uevent_suppress() imbalance
    
    commit bddbceb688c6d0decaabc7884fede319d02f96c8 upstream.
    
    Uevents are suppressed during attributes registration, but never
    restored, so kobject_uevent() does nothing.
    
    Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
    Signed-off-by: Tejun Heo <tj@kernel.org>
    Fixes: 226223ab3c4118ddd10688cc2c131135848371ab
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 376a57d00313c93db09e2ba2fdb7eb8c97b6bb65
Author: Jan Kardell <jan.kardell@telliq.com>
Date:   Thu Nov 6 22:18:00 2014 +0000

    iio: ti_am335x_adc: Fix: Use same step id at FIFOs both ends
    
    commit baa3c65298c089a9014b4e523a14ec2885cca1bc upstream.
    
    Since AI lines could be selected at will (linux-3.11) the sending
    and receiving ends of the FIFO does not agree about what step is used
    for a line. It only works if the last lines are used, like 5,6,7,
    and fails if ie 2,4,6 is selected in DT.
    
    Signed-off-by: Jan Kardell <jan.kardell@telliq.com>
    Tested-by: Zubair Lutfullah <zubair.lutfullah@gmail.com>
    Signed-off-by: Jonathan Cameron <jic23@kernel.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 75c2ca57d23d993553e878a2186493d975894d18
Author: Michal Sojka <sojkam1@fel.cvut.cz>
Date:   Thu Jul 10 14:00:34 2014 +0200

    USB: serial: ftdi_sio: Add Infineon Triboard
    
    commit d8279a40e50ad55539780aa617a32a53d7f0953e upstream.
    
    This adds support for Infineon TriBoard TC1798 [1]. Only interface 1
    is used as serial line (see [2], Figure 8-6).
    
    [1] http://www.infineon.com/cms/de/product/microcontroller/development-tools-software-and-kits/tricore-tm-development-tools-software-and-kits/starterkits-and-evaluation-boards/starter-kit-tc1798/channel.html?channel=db3a304333b8a7ca0133cfa3d73e4268
    [2] http://www.infineon.com/dgdl/TriBoardManual-TC1798-V10.pdf?folderId=db3a304412b407950112b409ae7c0343&fileId=db3a304333b8a7ca0133cfae99fe426a
    
    Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
    Cc: Johan Hovold <johan@kernel.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 065cccd3b91bbfa4985115e2fff492f62fc17c9c
Author: Bert Vermeulen <bert@biot.com>
Date:   Tue Jul 8 14:42:23 2014 +0200

    USB: ftdi_sio: Add extra PID.
    
    commit 5a7fbe7e9ea0b1b9d7ffdba64db1faa3a259164c upstream.
    
    This patch adds PID 0x0003 to the VID 0x128d (Testo). At least the
    Testo 435-4 uses this, likely other gear as well.
    
    Signed-off-by: Bert Vermeulen <bert@biot.com>
    Cc: Johan Hovold <johan@kernel.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit a74bd870c5464b03fb75d7a10bde42c58fa928d2
Author: Andras Kovacs <andras@sth.sze.hu>
Date:   Fri Jun 27 14:50:11 2014 +0200

    USB: cp210x: add support for Corsair usb dongle
    
    commit b9326057a3d8447f5d2e74a7b521ccf21add2ec0 upstream.
    
    Corsair USB Dongles are shipped with Corsair AXi series PSUs.
    These are cp210x serial usb devices, so make driver detect these.
    I have a program, that can get information from these PSUs.
    
    Tested with 2 different dongles shipped with Corsair AX860i and
    AX1200i units.
    
    Signed-off-by: Andras Kovacs <andras@sth.sze.hu>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 04e38195f8c1f616cfc530ad3b9f71fb0eba4493
Author: Bernd Wachter <bernd.wachter@jolla.com>
Date:   Wed Jul 2 12:36:48 2014 +0300

    usb: option: Add ID for Telewell TW-LTE 4G v2
    
    commit 3d28bd840b2d3981cd28caf5fe1df38f1344dd60 upstream.
    
    Add ID of the Telewell 4G v2 hardware to option driver to get legacy
    serial interface working
    
    Signed-off-by: Bernd Wachter <bernd.wachter@jolla.com>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 3eef6e60ade2856fa9d2a7073d3410fe23af3e2c
Author: Hugh Dickins <hughd@google.com>
Date:   Mon Jun 23 13:22:07 2014 -0700

    mm: fix crashes from mbind() merging vmas
    
    commit d05f0cdcbe6388723f1900c549b4850360545201 upstream.
    
    In v2.6.34 commit 9d8cebd4bcd7 ("mm: fix mbind vma merge problem")
    introduced vma merging to mbind(), but it should have also changed the
    convention of passing start vma from queue_pages_range() (formerly
    check_range()) to new_vma_page(): vma merging may have already freed
    that structure, resulting in BUG at mm/mempolicy.c:1738 and probably
    worse crashes.
    
    Fixes: 9d8cebd4bcd7 ("mm: fix mbind vma merge problem")
    Reported-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
    Tested-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
    Signed-off-by: Hugh Dickins <hughd@google.com>
    Acked-by: Christoph Lameter <cl@linux.com>
    Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
    Cc: Minchan Kim <minchan.kim@gmail.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit ae267ec932fb5aadbf011ca267305502ac95a923
Author: Mikulas Patocka <mpatocka@redhat.com>
Date:   Tue Apr 8 21:52:05 2014 -0400

    sym53c8xx_2: Set DID_REQUEUE return code when aborting squeue
    
    commit fd1232b214af43a973443aec6a2808f16ee5bf70 upstream.
    
    This patch fixes I/O errors with the sym53c8xx_2 driver when the disk
    returns QUEUE FULL status.
    
    When the controller encounters an error (including QUEUE FULL or BUSY
    status), it aborts all not yet submitted requests in the function
    sym_dequeue_from_squeue.
    
    This function aborts them with DID_SOFT_ERROR.
    
    If the disk has full tag queue, the request that caused the overflow is
    aborted with QUEUE FULL status (and the scsi midlayer properly retries
    it until it is accepted by the disk), but the sym53c8xx_2 driver aborts
    the following requests with DID_SOFT_ERROR --- for them, the midlayer
    does just a few retries and then signals the error up to sd.
    
    The result is that disk returning QUEUE FULL causes request failures.
    
    The error was reproduced on 53c895 with COMPAQ BD03685A24 disk
    (rebranded ST336607LC) with command queue 48 or 64 tags.  The disk has
    64 tags, but under some access patterns it return QUEUE FULL when there
    are less than 64 pending tags.  The SCSI specification allows returning
    QUEUE FULL anytime and it is up to the host to retry.
    
    Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
    Cc: Matthew Wilcox <matthew@wil.cx>
    Cc: James Bottomley <JBottomley@Parallels.com>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit fbfba9cf15b7d48d0c8e9f7965b351ddc3d59114
Author: Sander Eikelenboom <linux@eikelenboom.it>
Date:   Fri May 2 15:09:27 2014 +0200

    ALSA: usb-audio: Prevent printk ratelimiting from spamming kernel log while DEBUG not defined
    
    commit b7a7723513dc89f83d6df13206df55d4dc26e825 upstream.
    
    This (widely used) construction:
    
    if(printk_ratelimit())
    	dev_dbg()
    
    Causes the ratelimiting to spam the kernel log with the "callbacks suppressed"
    message below, even while the dev_dbg it is supposed to rate limit wouldn't
    print anything because DEBUG is not defined for this device.
    
    [  533.803964] retire_playback_urb: 852 callbacks suppressed
    [  538.807930] retire_playback_urb: 852 callbacks suppressed
    [  543.811897] retire_playback_urb: 852 callbacks suppressed
    [  548.815745] retire_playback_urb: 852 callbacks suppressed
    [  553.819826] retire_playback_urb: 852 callbacks suppressed
    
    So use dev_dbg_ratelimited() instead of this construction.
    
    Signed-off-by: Sander Eikelenboom <linux@eikelenboom.it>
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit eae433b4f393fb3c4a0d806674f4b89536530360
Author: Tim Gardner <tim.gardner@canonical.com>
Date:   Wed Apr 9 11:30:44 2014 -0600

    ALSA: usb-audio: Suppress repetitive debug messages from retire_playback_urb()
    
    commit a5065eb6da55b226661456e6a7435f605df98111 upstream.
    
    BugLink: http://bugs.launchpad.net/bugs/1305133
    
    Malfunctioning or slow devices can cause a flood of dmesg SPAM.
    
    I've ignored checkpatch.pl complaints about the use of printk_ratelimit() in favour
    of prior art in sound/usb/pcm.c.
    
    WARNING: Prefer printk_ratelimited or pr_<level>_ratelimited to printk_ratelimit
    +	if (printk_ratelimit() &&
    
    Cc: Jaroslav Kysela <perex@perex.cz>
    Cc: Takashi Iwai <tiwai@suse.de>
    Cc: Eldad Zack <eldad@fogrefinery.com>
    Cc: Daniel Mack <zonque@gmail.com>
    Cc: Clemens Ladisch <clemens@ladisch.de>
    Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit c9fcc0e38ff846a043218e4c7ec326b90a3f78a6
Author: Micky Ching <micky_ching@realsil.com.cn>
Date:   Thu Mar 27 13:35:04 2014 +0800

    mmc: rtsx: add R1-no-CRC mmc command type handle
    
    commit 5027251eced6e34315a52bd841279df957f627bb upstream.
    
    a27fbf2f067b0cd ("mmc: add ignorance case for CMD13 CRC error") produced
    a cmd.flags unhandled in realtek pci host driver.  This will make MMC
    card fail to initialize, this patch is used to handle the new cmd.flags
    condition and MMC card can be used.
    
    Signed-off-by: Micky Ching <micky_ching@realsil.com.cn>
    Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
    Signed-off-by: Chris Ball <chris@printf.net>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit ad4a4e1ff95b3c7e02a7ce993d7e7c6e07f5f6d0
Author: Peter Hurley <peter@hurleysoftware.com>
Date:   Mon Jun 16 08:10:42 2014 -0400

    tty: Correct INPCK handling
    
    commit 66528f90669691c85c73bea4f0c9f4a5857c4cab upstream.
    
    If INPCK is not set, input parity detection should be disabled. This means
    parity errors should not be received from the tty driver, and the data
    received should be treated normally.
    
    SUS v3, 11.2.2, General Terminal Interface - Input Modes, states:
      "If INPCK is set, input parity checking shall be enabled. If INPCK is
       not set, input parity checking shall be disabled, allowing output parity
       generation without input parity errors. Note that whether input parity
       checking is enabled or disabled is independent of whether parity detection
       is enabled or disabled (see Control Modes). If parity detection is enabled
       but input parity checking is disabled, the hardware to which the terminal
       is connected shall recognize the parity bit, but the terminal special file
       shall not check whether or not this bit is correctly set."
    
    Ignore parity errors reported by the tty driver when INPCK is not set, and
    handle the received data normally.
    
    Fixes: Bugzilla #71681, 'Improvement of n_tty_receive_parity_error from n_tty.c'
    Reported-by: Ivan <athlon_@mail.ru>
    Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 7d6467cfe6aa0c56d0b4a94d4deb00a718ac4efa
Author: Peter Hurley <peter@hurleysoftware.com>
Date:   Mon Jun 16 08:10:41 2014 -0400

    serial: Fix IGNBRK handling
    
    commit ef8b9ddcb45fa3b1e11acd72be2398001e807d14 upstream.
    
    If IGNBRK is set without either BRKINT or PARMRK set, some uart
    drivers send a 0x00 byte for BREAK without the TTYBREAK flag to the
    line discipline, when it should send either nothing or the TTYBREAK flag
    set. This happens because the read_status_mask masks out the BI
    condition, which uart_insert_char() then interprets as a normal 0x00 byte.
    
    SUS v3 is clear regarding the meaning of IGNBRK; Section 11.2.2, General
    Terminal Interface - Input Modes, states:
      "If IGNBRK is set, a break condition detected on input shall be ignored;
       that is, not put on the input queue and therefore not read by any
       process."
    
    Fix read_status_mask to include the BI bit if IGNBRK is set; the
    lsr status retains the BI bit if a BREAK is recv'd, which is
    subsequently ignored in uart_insert_char() when masked with the
    ignore_status_mask.
    
    Affected drivers:
    8250 - all
    serial_txx9
    mfd
    amba-pl010
    amba-pl011
    atmel_serial
    bfin_uart
    dz
    ip22zilog
    max310x
    mxs-auart
    netx-serial
    pnx8xxx_uart
    pxa
    sb1250-duart
    sccnxp
    serial_ks8695
    sirfsoc_uart
    st-asc
    vr41xx_siu
    zs
    sunzilog
    fsl_lpuart
    sunsab
    ucc_uart
    bcm63xx_uart
    sunsu
    efm32-uart
    pmac_zilog
    mpsc
    msm_serial
    m32r_sio
    
    Unaffected drivers:
    omap-serial
    rp2
    sa1100
    imx
    icom
    
    Annotated for fixes:
    altera_uart
    mcf
    
    Drivers without break detection:
    21285
    xilinx-uartps
    altera_jtaguart
    apbuart
    arc-uart
    clps711x
    max3100
    uartlite
    msm_serial_hs
    nwpserial
    lantiq
    vt8500_serial
    
    Unknown:
    samsung
    mpc52xx_uart
    bfin_sport_uart
    cpm_uart/core
    
    Fixes: Bugzilla #71651, '8250_core.c incorrectly handles IGNBRK flag'
    Reported-by: Ivan <athlon_@mail.ru>
    Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit c225b32571e98f5ad5e6883cbd349902b246d75f
Author: Michal Nazarewicz <mina86@mina86.com>
Date:   Wed Jul 2 15:22:35 2014 -0700

    mm: page_alloc: fix CMA area initialisation when pageblock > MAX_ORDER
    
    commit dc78327c0ea7da5186d8cbc1647bd6088c5c9fa5 upstream.
    
    With a kernel configured with ARM64_64K_PAGES && !TRANSPARENT_HUGEPAGE,
    the following is triggered at early boot:
    
      SMP: Total of 8 processors activated.
      devtmpfs: initialized
      Unable to handle kernel NULL pointer dereference at virtual address 00000008
      pgd = fffffe0000050000
      [00000008] *pgd=00000043fba00003, *pmd=00000043fba00003, *pte=00e0000078010407
      Internal error: Oops: 96000006 [#1] SMP
      Modules linked in:
      CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.15.0-rc864k+ #44
      task: fffffe03bc040000 ti: fffffe03bc080000 task.ti: fffffe03bc080000
      PC is at __list_add+0x10/0xd4
      LR is at free_one_page+0x270/0x638
      ...
      Call trace:
        __list_add+0x10/0xd4
        free_one_page+0x26c/0x638
        __free_pages_ok.part.52+0x84/0xbc
        __free_pages+0x74/0xbc
        init_cma_reserved_pageblock+0xe8/0x104
        cma_init_reserved_areas+0x190/0x1e4
        do_one_initcall+0xc4/0x154
        kernel_init_freeable+0x204/0x2a8
        kernel_init+0xc/0xd4
    
    This happens because init_cma_reserved_pageblock() calls
    __free_one_page() with pageblock_order as page order but it is bigger
    than MAX_ORDER.  This in turn causes accesses past zone->free_list[].
    
    Fix the problem by changing init_cma_reserved_pageblock() such that it
    splits pageblock into individual MAX_ORDER pages if pageblock is bigger
    than a MAX_ORDER page.
    
    In cases where !CONFIG_HUGETLB_PAGE_SIZE_VARIABLE, which is all
    architectures expect for ia64, powerpc and tile at the moment, the
    “pageblock_order > MAX_ORDER” condition will be optimised out since both
    sides of the operator are constants.  In cases where pageblock size is
    variable, the performance degradation should not be significant anyway
    since init_cma_reserved_pageblock() is called only at boot time at most
    MAX_CMA_AREAS times which by default is eight.
    
    Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
    Reported-by: Mark Salter <msalter@redhat.com>
    Tested-by: Mark Salter <msalter@redhat.com>
    Tested-by: Christopher Covington <cov@codeaurora.org>
    Cc: Mel Gorman <mgorman@suse.de>
    Cc: David Rientjes <rientjes@google.com>
    Cc: Marek Szyprowski <m.szyprowski@samsung.com>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit d90ff081ac4e26e9258a5cb24dc2333d657af0dd
Author: Thomas Gleixner <tglx@linutronix.de>
Date:   Thu Jun 19 21:34:37 2014 +0000

    irqchip: spear_shirq: Fix interrupt offset
    
    commit 4f4366033945419b0c52118c29d3057d7c558765 upstream.
    
    The ras3 block on spear320 claims to have 3 interrupts. In fact it has
    one and 6 reserved interrupts. Account the 6 reserved to this block so
    it has 7 interrupts total. That matches the datasheet and the device
    tree entries.
    
    Broken since commit 80515a5a(ARM: SPEAr3xx: shirq: simplify and move
    the shared irq multiplexor to DT). Testing is overrated....
    
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Link: https://lkml.kernel.org/r/20140619212712.872379208@linutronix.de
    Fixes: 80515a5a2e3c ('ARM: SPEAr3xx: shirq: simplify and move the shared irq multiplexor to DT')
    Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
    Signed-off-by: Jason Cooper <jason@lakedaemon.net>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit f18a52f4ec2d93a6f7edf185a17647347c7813c5
Author: NeilBrown <neilb@suse.de>
Date:   Wed Jul 2 12:04:14 2014 +1000

    md: flush writes before starting a recovery.
    
    commit 133d4527eab8d199a62eee6bd433f0776842df2e upstream.
    
    When we write to a degraded array which has a bitmap, we
    make sure the relevant bit in the bitmap remains set when
    the write completes (so a 're-add' can quickly rebuilt a
    temporarily-missing device).
    
    If, immediately after such a write starts, we incorporate a spare,
    commence recovery, and skip over the region where the write is
    happening (because the 'needs recovery' flag isn't set yet),
    then that write will not get to the new device.
    
    Once the recovery finishes the new device will be trusted, but will
    have incorrect data, leading to possible corruption.
    
    We cannot set the 'needs recovery' flag when we start the write as we
    do not know easily if the write will be "degraded" or not.  That
    depends on details of the particular raid level and particular write
    request.
    
    This patch fixes a corruption issue of long standing and so it
    suitable for any -stable kernel.  It applied correctly to 3.0 at
    least and will minor editing to earlier kernels.
    
    Reported-by: Bill <billstuff2001@sbcglobal.net>
    Tested-by: Bill <billstuff2001@sbcglobal.net>
    Link: http://lkml.kernel.org/r/53A518BB.60709@sbcglobal.net
    Signed-off-by: NeilBrown <neilb@suse.de>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 19a019286096e976f414ef9dda602cb511ad8299
Author: Steven Rostedt (Red Hat) <rostedt@goodmis.org>
Date:   Tue Jun 24 23:50:09 2014 -0400

    tracing: Remove ftrace_stop/start() from reading the trace file
    
    commit 099ed151675cd1d2dbeae1dac697975f6a68716d upstream.
    
    Disabling reading and writing to the trace file should not be able to
    disable all function tracing callbacks. There's other users today
    (like kprobes and perf). Reading a trace file should not stop those
    from happening.
    
    Reviewed-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit cb116d6b3ffb0302b958d811cdb53db1943447ba
Author: Michal Nazarewicz <mina86@mina86.com>
Date:   Fri Jun 13 15:38:05 2014 +0200

    tools: ffs-test: fix header values endianess
    
    commit f35f71244da6e51db4e1f2c7e318581f498ececf upstream.
    
    It appears that no one ever run ffs-test on a big-endian machine,
    since it used cpu-endianess for fs_count and hs_count fields which
    should be in little-endian format.  Fix by wrapping the numbers in
    cpu_to_le32.
    
    Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 12ea90016aa96ea84080e250cfff45d865da540c
Author: J. Bruce Fields <bfields@redhat.com>
Date:   Thu Jun 19 16:44:48 2014 -0400

    nfsd: fix rare symlink decoding bug
    
    commit 76f47128f9b33af1e96819746550d789054c9664 upstream.
    
    An NFS operation that creates a new symlink includes the symlink data,
    which is xdr-encoded as a length followed by the data plus 0 to 3 bytes
    of zero-padding as required to reach a 4-byte boundary.
    
    The vfs, on the other hand, wants null-terminated data.
    
    The simple way to handle this would be by copying the data into a newly
    allocated buffer with space for the final null.
    
    The current nfsd_symlink code tries to be more clever by skipping that
    step in the (likely) case where the byte following the string is already
    0.
    
    But that assumes that the byte following the string is ours to look at.
    In fact, it might be the first byte of a page that we can't read, or of
    some object that another task might modify.
    
    Worse, the NFSv4 code tries to fix the problem by actually writing to
    that byte.
    
    In the NFSv2/v3 cases this actually appears to be safe:
    
    	- nfs3svc_decode_symlinkargs explicitly null-terminates the data
    	  (after first checking its length and copying it to a new
    	  page).
    	- NFSv2 limits symlinks to 1k.  The buffer holding the rpc
    	  request is always at least a page, and the link data (and
    	  previous fields) have maximum lengths that prevent the request
    	  from reaching the end of a page.
    
    In the NFSv4 case the CREATE op is potentially just one part of a long
    compound so can end up on the end of a page if you're unlucky.
    
    The minimal fix here is to copy and null-terminate in the NFSv4 case.
    The nfsd_symlink() interface here seems too fragile, though.  It should
    really either do the copy itself every time or just require a
    null-terminated string.
    
    Reported-by: Jeff Layton <jlayton@primarydata.com>
    Signed-off-by: J. Bruce Fields <bfields@redhat.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 8f2574b71fe4afbd17bfd1745431f3902322b8ae
Author: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Date:   Thu Nov 6 12:11:00 2014 +0000

    iio: of_iio_channel_get_by_name() returns non-null pointers for error legs
    
    commit a2c12493ed7e63a18cef33a71686d12ffcd6600e upstream.
    
    Currently in the inkern.c code for IIO framework, the function
    of_iio_channel_get_by_name() will return a non-NULL pointer when
    it cannot find a channel using of_iio_channel_get() and when it
    tries to search for 'io-channel-ranges' property and fails. This
    is incorrect behaviour as the function which calls this expects
    a NULL pointer for failure. This patch rectifies the issue.
    
    Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
    Signed-off-by: Jonathan Cameron <jic23@kernel.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit d964adc84e6398b37d5659f4a5d12f303a128bd9
Author: Paolo Bonzini <pbonzini@redhat.com>
Date:   Thu Jun 19 11:40:18 2014 +0200

    KVM: x86: preserve the high 32-bits of the PAT register
    
    commit 7cb060a91c0efc5ff94f83c6df3ed705e143cdb9 upstream.
    
    KVM does not really do much with the PAT, so this went unnoticed for a
    long time.  It is exposed however if you try to do rdmsr on the PAT
    register.
    
    Reported-by: Valentine Sinitsyn <valentine.sinitsyn@gmail.com>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 35d3871e7ca540c0861bf3ef7e2085594c0aa3ce
Author: Nadav Amit <namit@cs.technion.ac.il>
Date:   Wed Jun 18 17:21:19 2014 +0300

    KVM: x86: Increase the number of fixed MTRR regs to 10
    
    commit 682367c494869008eb89ef733f196e99415ae862 upstream.
    
    Recent Intel CPUs have 10 variable range MTRRs. Since operating systems
    sometime make assumptions on CPUs while they ignore capability MSRs, it is
    better for KVM to be consistent with recent CPUs. Reporting more MTRRs than
    actually supported has no functional implications.
    
    Signed-off-by: Nadav Amit <namit@cs.technion.ac.il>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 9011a645583adfa1f71f15ee68efb254dce2538d
Author: Jan Kara <jack@suse.cz>
Date:   Thu Jun 26 12:30:54 2014 -0400

    ext4: Fix hole punching for files with indirect blocks
    
    commit a93cd4cf86466caa49cfe64607bea7f0bde3f916 upstream.
    
    Hole punching code for files with indirect blocks wrongly computed
    number of blocks which need to be cleared when traversing the indirect
    block tree. That could result in punching more blocks than actually
    requested and thus effectively cause a data loss. For example:
    
    fallocate -n -p 10240000 4096
    
    will punch the range 10240000 - 12632064 instead of the range 1024000 -
    10244096. Fix the calculation.
    
    Fixes: 8bad6fc813a3a5300f51369c39d315679fd88c72
    Signed-off-by: Jan Kara <jack@suse.cz>
    Signed-off-by: Theodore Ts'o <tytso@mit.edu>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 18e64a6a372648b8f12a457805df7ee40510e278
Author: Jan Kara <jack@suse.cz>
Date:   Sun Jun 15 23:46:28 2014 -0400

    ext4: Fix buffer double free in ext4_alloc_branch()
    
    commit c5c7b8ddfbf8cb3b2291e515a34ab1b8982f5a2d upstream.
    
    Error recovery in ext4_alloc_branch() calls ext4_forget() even for
    buffer corresponding to indirect block it did not allocate. This leads
    to brelse() being called twice for that buffer (once from ext4_forget()
    and once from cleanup in ext4_ind_map_blocks()) leading to buffer use
    count misaccounting. Eventually (but often much later because there
    are other users of the buffer) we will see messages like:
    VFS: brelse: Trying to free free buffer
    
    Another manifestation of this problem is an error:
    JBD2 unexpected failure: jbd2_journal_revoke: !buffer_revoked(bh);
    inconsistent data on disk
    
    The fix is easy - don't forget buffer we did not allocate. Also add an
    explanatory comment because the indexing at ext4_alloc_branch() is
    somewhat subtle.
    
    Signed-off-by: Jan Kara <jack@suse.cz>
    Signed-off-by: Theodore Ts'o <tytso@mit.edu>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 04e1cd73c6374c169225be3fad8c28df397a6adb
Author: Tejun Heo <tj@kernel.org>
Date:   Thu Jun 19 17:42:57 2014 -0400

    blkcg: fix use-after-free in __blkg_release_rcu() by making blkcg_gq refcnt an atomic_t
    
    commit a5049a8ae34950249a7ae94c385d7c5c98914412 upstream.
    
    Hello,
    
    So, this patch should do.  Joe, Vivek, can one of you guys please
    verify that the oops goes away with this patch?
    
    Jens, the original thread can be read at
    
      http://thread.gmane.org/gmane.linux.kernel/1720729
    
    The fix converts blkg->refcnt from int to atomic_t.  It does some
    overhead but it should be minute compared to everything else which is
    going on and the involved cacheline bouncing, so I think it's highly
    unlikely to cause any noticeable difference.  Also, the refcnt in
    question should be converted to a perpcu_ref for blk-mq anyway, so the
    atomic_t is likely to go away pretty soon anyway.
    
    Thanks.
    
    ------- 8< -------
    __blkg_release_rcu() may be invoked after the associated request_queue
    is released with a RCU grace period inbetween.  As such, the function
    and callbacks invoked from it must not dereference the associated
    request_queue.  This is clearly indicated in the comment above the
    function.
    
    Unfortunately, while trying to fix a different issue, 2a4fd070ee85
    ("blkcg: move bulk of blkcg_gq release operations to the RCU
    callback") ignored this and added [un]locking of @blkg->q->queue_lock
    to __blkg_release_rcu().  This of course can cause oops as the
    request_queue may be long gone by the time this code gets executed.
    
      general protection fault: 0000 [#1] SMP
      CPU: 21 PID: 30 Comm: rcuos/21 Not tainted 3.15.0 #1
      Hardware name: Stratus ftServer 6400/G7LAZ, BIOS BIOS Version 6.3:57 12/25/2013
      task: ffff880854021de0 ti: ffff88085403c000 task.ti: ffff88085403c000
      RIP: 0010:[<ffffffff8162e9e5>]  [<ffffffff8162e9e5>] _raw_spin_lock_irq+0x15/0x60
      RSP: 0018:ffff88085403fdf0  EFLAGS: 00010086
      RAX: 0000000000020000 RBX: 0000000000000010 RCX: 0000000000000000
      RDX: 000060ef80008248 RSI: 0000000000000286 RDI: 6b6b6b6b6b6b6b6b
      RBP: ffff88085403fdf0 R08: 0000000000000286 R09: 0000000000009f39
      R10: 0000000000020001 R11: 0000000000020001 R12: ffff88103c17a130
      R13: ffff88103c17a080 R14: 0000000000000000 R15: 0000000000000000
      FS:  0000000000000000(0000) GS:ffff88107fca0000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 00000000006e5ab8 CR3: 000000000193d000 CR4: 00000000000407e0
      Stack:
       ffff88085403fe18 ffffffff812cbfc2 ffff88103c17a130 0000000000000000
       ffff88103c17a130 ffff88085403fec0 ffffffff810d1d28 ffff880854021de0
       ffff880854021de0 ffff88107fcaec58 ffff88085403fe80 ffff88107fcaec30
      Call Trace:
       [<ffffffff812cbfc2>] __blkg_release_rcu+0x72/0x150
       [<ffffffff810d1d28>] rcu_nocb_kthread+0x1e8/0x300
       [<ffffffff81091d81>] kthread+0xe1/0x100
       [<ffffffff8163813c>] ret_from_fork+0x7c/0xb0
      Code: ff 47 04 48 8b 7d 08 be 00 02 00 00 e8 55 48 a4 ff 5d c3 0f 1f 00 66 66 66 66 90 55 48 89 e5
      +fa 66 66 90 66 66 90 b8 00 00 02 00 <f0> 0f c1 07 89 c2 c1 ea 10 66 39 c2 75 02 5d c3 83 e2 fe 0f
      +b7
      RIP  [<ffffffff8162e9e5>] _raw_spin_lock_irq+0x15/0x60
       RSP <ffff88085403fdf0>
    
    The request_queue locking was added because blkcg_gq->refcnt is an int
    protected with the queue lock and __blkg_release_rcu() needs to put
    the parent.  Let's fix it by making blkcg_gq->refcnt an atomic_t and
    dropping queue locking in the function.
    
    Given the general heavy weight of the current request_queue and blkcg
    operations, this is unlikely to cause any noticeable overhead.
    Moreover, blkcg_gq->refcnt is likely to be converted to percpu_ref in
    the near future, so whatever (most likely negligible) overhead it may
    add is temporary.
    
    Signed-off-by: Tejun Heo <tj@kernel.org>
    Reported-by: Joe Lawrence <joe.lawrence@stratus.com>
    Acked-by: Vivek Goyal <vgoyal@redhat.com>
    Link: http://lkml.kernel.org/g/alpine.DEB.2.02.1406081816540.17948@jlaw-desktop.mno.stratus.com
    Signed-off-by: Jens Axboe <axboe@fb.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 10bdb522a256f5039785c80bf60868fb5cb505df
Author: Steve French <smfrench@gmail.com>
Date:   Sun Jun 22 20:38:49 2014 -0500

    CIFS: fix mount failure with broken pathnames when smb3 mount with mapchars option
    
    commit ce36d9ab3bab06b7b5522f5c8b68fac231b76ffb upstream.
    
    When we SMB3 mounted with mapchars (to allow reserved characters : \ / > < * ?
    via the Unicode Windows to POSIX remap range) empty paths
    (eg when we open "" to query the root of the SMB3 directory on mount) were not
    null terminated so we sent garbarge as a path name on empty paths which caused
    SMB2/SMB2.1/SMB3 mounts to fail when mapchars was specified.  mapchars is
    particularly important since Unix Extensions for SMB3 are not supported (yet)
    
    Signed-off-by: Steve French <smfrench@gmail.com>
    Reviewed-by: David Disseldorp <ddiss@suse.de>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit bf792b9b9abf281511c8a7cbbd1518ff6adac7d8
Author: Rafał Miłecki <zajec5@gmail.com>
Date:   Thu Jun 12 22:28:22 2014 +0200

    b43: fix frequency reported on G-PHY with /new/ firmware
    
    commit 2fc68eb122c7ea6cd5be1fe7d6650c0beb2f4f40 upstream.
    
    Support for firmware rev 508+ was added years ago, but we never noticed
    it reports channel in a different way for G-PHY devices. Instead of
    offset from 2400 MHz it simply passes channel id (AKA hw_value).
    
    So far it was (most probably) affecting monitor mode users only, but
    the following recent commit made it noticeable for quite everybody:
    
    commit 3afc2167f60a327a2c1e1e2600ef209a3c2b75b7
    Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
    Date:   Tue Mar 4 16:50:13 2014 +0200
    
        cfg80211/mac80211: ignore signal if the frame was heard on wrong channel
    
    Reported-by: Aaro Koskinen <aaro.koskinen@iki.fi>
    Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
    Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
    Signed-off-by: John W. Linville <linville@tuxdriver.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 9b272249cf3509f4d61120fa900c5ab143534437
Author: Maxime Ripard <maxime.ripard@free-electrons.com>
Date:   Mon Jun 23 22:49:40 2014 +0200

    net: allwinner: emac: Add missing free_irq
    
    commit b91113282bf44df46aba374a0b8f88a75bfd4b3f upstream.
    
    If the mdio probe function fails in emac_open, the interrupt we just requested
    isn't freed. If emac_open is called again, for example because we try to set up
    the interface again, the kernel will oops because the interrupt wasn't properly
    released.
    
    Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 0c935c957f255c6253692b9f2b764861b88527ca
Author: ChiaHao <andy.jhshiu@gmail.com>
Date:   Thu Jun 12 15:32:33 2014 +0100

    arm64: Bug fix in stack alignment exception
    
    commit 3906c2b53cd23c2ae03e6ce41432c8e7f0a3cbbb upstream.
    
    The value of ESR has been stored into x1, and should be directly pass to
    do_sp_pc_abort function, "MOV x1, x25" is an extra operation and do_sp_pc_abort
    will get the wrong value of ESR.
    
    Signed-off-by: ChiaHao <andy.jhshiu@gmail.com>
    Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 356d96c53497cb8b259c73b74b1ec3e6a40968b0
Author: David R. Piegdon <lkml@p23q.org>
Date:   Mon Jun 16 23:42:51 2014 +0000

    ARM: OMAP2+: Fix parser-bug in platform muxing code
    
    commit c021f241f4fab2bb4fc4120a38a828a03dd3f970 upstream.
    
    Fix a parser-bug in the omap2 muxing code where muxtable-entries will be
    wrongly selected if the requested muxname is a *prefix* of their
    m0-entry and they have a matching mN-entry. Fix by additionally checking
    that the length of the m0_entry is equal.
    
    For example muxing of "dss_data2.dss_data2" on omap32xx will fail
    because the prefix "dss_data2" will match the mux-entries "dss_data2" as
    well as "dss_data20", with the suffix "dss_data2" matching m0 (for
    dss_data2) and m4 (for dss_data20). Thus both are recognized as signal
    path candidates:
    
    Relevant muxentries from mux34xx.c:
            _OMAP3_MUXENTRY(DSS_DATA20, 90,
                    "dss_data20", NULL, "mcspi3_somi", "dss_data2",
                    "gpio_90", NULL, NULL, "safe_mode"),
            _OMAP3_MUXENTRY(DSS_DATA2, 72,
                    "dss_data2", NULL, NULL, NULL,
                    "gpio_72", NULL, NULL, "safe_mode"),
    
    This will result in a failure to mux the pin at all:
    
     _omap_mux_get_by_name: Multiple signal paths (2) for dss_data2.dss_data2
    
    Patch should apply to linus' latest master down to rather old linux-2.6
    trees.
    
    Signed-off-by: David R. Piegdon <lkml@p23q.org>
    Cc: stable@vger.kernel.org
    [tony@atomide.com: updated description to include full description]
    Signed-off-by: Tony Lindgren <tony@atomide.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 53d968cadf757d911ed4ad7f935007bff1e1e509
Author: Steve Capper <steve.capper@linaro.org>
Date:   Wed Jul 2 11:46:23 2014 +0100

    arm64: mm: Make icache synchronisation logic huge page aware
    
    commit 923b8f5044da753e4985ab15c1374ced2cdf616c upstream.
    
    The __sync_icache_dcache routine will only flush the dcache for the
    first page of a compound page, potentially leading to stale icache
    data residing further on in a hugetlb page.
    
    This patch addresses this issue by taking into consideration the
    order of the page when flushing the dcache.
    
    Reported-by: Mark Brown <broonie@linaro.org>
    Tested-by: Mark Brown <broonie@linaro.org>
    Signed-off-by: Steve Capper <steve.capper@linaro.org>
    Acked-by: Will Deacon <will.deacon@arm.com>
    Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 6b5002673d4de9144db56cfe17046b3873cc6d9e
Author: David Rientjes <rientjes@google.com>
Date:   Mon Jun 23 13:22:04 2014 -0700

    mm, pcp: allow restoring percpu_pagelist_fraction default
    
    commit 7cd2b0a34ab8e4db971920eef8982f985441adfb upstream.
    
    Oleg reports a division by zero error on zero-length write() to the
    percpu_pagelist_fraction sysctl:
    
        divide error: 0000 [#1] SMP DEBUG_PAGEALLOC
        CPU: 1 PID: 9142 Comm: badarea_io Not tainted 3.15.0-rc2-vm-nfs+ #19
        Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
        task: ffff8800d5aeb6e0 ti: ffff8800d87a2000 task.ti: ffff8800d87a2000
        RIP: 0010: percpu_pagelist_fraction_sysctl_handler+0x84/0x120
        RSP: 0018:ffff8800d87a3e78  EFLAGS: 00010246
        RAX: 0000000000000f89 RBX: ffff88011f7fd000 RCX: 0000000000000000
        RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000010
        RBP: ffff8800d87a3e98 R08: ffffffff81d002c8 R09: ffff8800d87a3f50
        R10: 000000000000000b R11: 0000000000000246 R12: 0000000000000060
        R13: ffffffff81c3c3e0 R14: ffffffff81cfddf8 R15: ffff8801193b0800
        FS:  00007f614f1e9740(0000) GS:ffff88011f440000(0000) knlGS:0000000000000000
        CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
        CR2: 00007f614f1fa000 CR3: 00000000d9291000 CR4: 00000000000006e0
        Call Trace:
          proc_sys_call_handler+0xb3/0xc0
          proc_sys_write+0x14/0x20
          vfs_write+0xba/0x1e0
          SyS_write+0x46/0xb0
          tracesys+0xe1/0xe6
    
    However, if the percpu_pagelist_fraction sysctl is set by the user, it
    is also impossible to restore it to the kernel default since the user
    cannot write 0 to the sysctl.
    
    This patch allows the user to write 0 to restore the default behavior.
    It still requires a fraction equal to or larger than 8, however, as
    stated by the documentation for sanity.  If a value in the range [1, 7]
    is written, the sysctl will return EINVAL.
    
    This successfully solves the divide by zero issue at the same time.
    
    Signed-off-by: David Rientjes <rientjes@google.com>
    Reported-by: Oleg Drokin <green@linuxhacker.ru>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 78a97b52b5c8dceaf68bc5129b95c71bb60f7199
Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Date:   Thu May 8 12:15:22 2014 +0300

    iwlwifi: pcie: try to get ownership several times
    
    commit 501fd9895c1d7d8161ed56698ae2fccb10ef14f5 upstream.
    
    Some races with the hardware can happen when we take
    ownership of the device. Don't give up after the first try.
    
    Reviewed-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 2cee62888af61f9786994e8662b267a9de6cb88d
Author: Felix Fietkau <nbd@openwrt.org>
Date:   Tue May 27 22:33:57 2014 +0200

    mac80211: fix a memory leak on sta rate selection table
    
    commit 53d045258ee2e38b1e882617cb0799a04d05f5fa upstream.
    
    If the rate control algorithm uses a selection table, it
    is leaked when the station is destroyed - fix that.
    
    Signed-off-by: Felix Fietkau <nbd@openwrt.org>
    Reported-by: Christophe Prévotaux <cprevotaux@nltinc.com>
    Fixes: 0d528d85c519 ("mac80211: improve the rate control API")
    [add commit log entry, remove pointless NULL check]
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 3174f2792732ea8528fffbbb42cd4d5ca484be31
Author: Arik Nemtsov <arik@wizery.com>
Date:   Mon May 26 14:40:51 2014 +0300

    mac80211: don't check netdev state for debugfs read/write
    
    commit 923eaf367206e01f22c97aee22300e332d071916 upstream.
    
    Doing so will lead to an oops for a p2p-dev interface, since it has
    no netdev.
    
    Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
    Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 8b623dad986de9a560cae3f61a2be21180f10add
Author: Krzysztof Hałasa <khalasa@piap.pl>
Date:   Mon May 26 14:14:46 2014 +0200

    mac80211: fix IBSS join by initializing last_scan_completed
    
    commit c7d37a66e345df2fdf1aa7b2c9a6d3d53846ca5b upstream.
    
    Without this fix, freshly rebooted Linux creates a new IBSS
    instead of joining an existing one. Only when jiffies counter
    overflows after 5 minutes the IBSS can be successfully joined.
    
    Signed-off-by: Krzysztof Hałasa <khalasa@piap.pl>
    [edit commit message slightly]
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit d9f8ab9c7c5e29b630816bd2be3d9c90c98c75ba
Author: Fabio Baltieri <fabio.baltieri@gmail.com>
Date:   Sun Jun 8 22:06:24 2014 +0100

    hwmon: (ina2xx) Cast to s16 on shunt and current regs
    
    commit c0214f98943b1fe43f7be61b7782b0c8f0836f28 upstream.
    
    All devices supported by ina2xx are bidirectional and report the
    measured shunt voltage and power values as a signed 16 bit, but the
    current driver implementation caches all registers as u16, leading
    to an incorrect sign extension when reporting to userspace in
    ina2xx_get_value().
    
    This patch fixes the problem by casting the signed registers to s16.
    Tested on an INA219.
    
    Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit a355e863488c27d3afcad4eaf805ebdd5f6a6752
Author: Ilya Dryomov <ilya.dryomov@inktank.com>
Date:   Tue Jun 10 13:53:29 2014 +0400

    rbd: handle parent_overlap on writes correctly
    
    commit 9638556a276125553549fdfe349c464481ec2f39 upstream.
    
    The following check in rbd_img_obj_request_submit()
    
        rbd_dev->parent_overlap <= obj_request->img_offset
    
    allows the fall through to the non-layered write case even if both
    parent_overlap and obj_request->img_offset belong to the same RADOS
    object.  This leads to data corruption, because the area to the left of
    parent_overlap ends up unconditionally zero-filled instead of being
    populated with parent data.  Suppose we want to write 1M to offset 6M
    of image bar, which is a clone of foo@snap; object_size is 4M,
    parent_overlap is 5M:
    
        rbd_data.<id>.0000000000000001
         ---------------------|----------------------|------------
        | should be copyup'ed | should be zeroed out | write ...
         ---------------------|----------------------|------------
       4M                    5M                     6M
                        parent_overlap    obj_request->img_offset
    
    4..5M should be copyup'ed from foo, yet it is zero-filled, just like
    5..6M is.
    
    Given that the only striping mode kernel client currently supports is
    chunking (i.e. stripe_unit == object_size, stripe_count == 1), round
    parent_overlap up to the next object boundary for the purposes of the
    overlap check.
    
    Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
    Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 1ef3eb2867700888172aec631f89275d44d583f8
Author: Alex Elder <elder@linaro.org>
Date:   Sat Apr 26 14:21:44 2014 +0400

    rbd: use reference counts for image requests
    
    commit 0f2d5be792b0466b06797f637cfbb0f64dbb408c upstream.
    
    Each image request contains a reference count, but to date it has
    not actually been used.  (I think this was just an oversight.) A
    recent report involving rbd failing an assertion shed light on why
    and where we need to use these reference counts.
    
    Every OSD request associated with an object request uses
    rbd_osd_req_callback() as its callback function.  That function will
    call a helper function (dependent on the type of OSD request) that
    will set the object request's "done" flag if the object request if
    appropriate.  If that "done" flag is set, the object request is
    passed to rbd_obj_request_complete().
    
    In rbd_obj_request_complete(), requests are processed in sequential
    order.  So if an object request completes before one of its
    predecessors in the image request, the completion is deferred.
    Otherwise, if it's a completing object's "turn" to be completed, it
    is passed to rbd_img_obj_end_request(), which records the result of
    the operation, accumulates transferred bytes, and so on.  Next, the
    successor to this request is checked and if it is marked "done",
    (deferred) completion processing is performed on that request, and
    so on.  If the last object request in an image request is completed,
    rbd_img_request_complete() is called, which (typically) destroys
    the image request.
    
    There is a race here, however.  The instant an object request is
    marked "done" it can be provided (by a thread handling completion of
    one of its predecessor operations) to rbd_img_obj_end_request(),
    which (for the last request) can then lead to the image request
    getting torn down.  And this can happen *before* that object has
    itself entered rbd_img_obj_end_request().  As a result, once it
    *does* enter that function, the image request (and even the object
    request itself) may have been freed and become invalid.
    
    All that's necessary to avoid this is to properly count references
    to the image requests.  We tear down an image request's object
    requests all at once--only when the entire image request has
    completed.  So there's no need for an image request to count
    references for its object requests.  However, we don't want an
    image request to go away until the last of its object requests
    has passed through rbd_img_obj_callback().  In other words,
    we don't want rbd_img_request_complete() to necessarily
    result in the image request being destroyed, because it may
    get called before we've finished processing on all of its
    object requests.
    
    So the fix is to add a reference to an image request for
    each of its object requests.  The reference can be viewed
    as representing an object request that has not yet finished
    its call to rbd_img_obj_callback().  That is emphasized by
    getting the reference right after assigning that as the image
    object's callback function.  The corresponding release of that
    reference is done at the end of rbd_img_obj_callback(), which
    every image object request passes through exactly once.
    
    Signed-off-by: Alex Elder <elder@linaro.org>
    Reviewed-by: Ilya Dryomov <ilya.dryomov@inktank.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 6e9a6814089157ec4de1e99ce79eef7c7dd22d04
Author: Lukas Czerner <lczerner@redhat.com>
Date:   Wed Jun 11 12:28:43 2014 -0400

    dm thin: update discard_granularity to reflect the thin-pool blocksize
    
    commit 09869de57ed2728ae3c619803932a86cb0e2c4f8 upstream.
    
    DM thinp already checks whether the discard_granularity of the data
    device is a factor of the thin-pool block size.  But when using the
    dm-thin-pool's discard passdown support, DM thinp was not selecting the
    max of the underlying data device's discard_granularity and the
    thin-pool's block size.
    
    Update set_discard_limits() to set discard_granularity to the max of
    these values.  This enables blkdev_issue_discard() to properly align the
    discards that are sent to the DM thin device on a full block boundary.
    As such each discard will now cover an entire DM thin-pool block and the
    block will be reclaimed.
    
    Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
    Signed-off-by: Lukas Czerner <lczerner@redhat.com>
    Signed-off-by: Mike Snitzer <snitzer@redhat.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 350c598f19fa0b7ffd149924e1aeeade1998e234
Author: Marcin Kraglak <marcin.kraglak@tieto.com>
Date:   Fri Jun 13 14:08:22 2014 +0200

    Bluetooth: Allow change security level on ATT_CID in slave role
    
    commit 92d1372e1a9fec00e146b74e8b9ad7a385b9b37f upstream.
    
    Kernel supports SMP Security Request so don't block increasing security
    when we are slave.
    
    Signed-off-by: Marcin Kraglak <marcin.kraglak@tieto.com>
    Acked-by: Johan Hedberg <johan.hedberg@intel.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 2a4de70a275f0f2af6d64b1e41c7a052563c8a40
Author: Johan Hedberg <johan.hedberg@intel.com>
Date:   Fri Jun 13 10:22:28 2014 +0300

    Bluetooth: Fix locking of hdev when calling into SMP code
    
    commit c73f94b8c093a615ce80eabbde0ac6eb9abfe31a upstream.
    
    The SMP code expects hdev to be unlocked since e.g. crypto functions
    will try to (re)lock it. Therefore, we need to release the lock before
    calling into smp.c from mgmt.c. Without this we risk a deadlock whenever
    the smp_user_confirm_reply() function is called.
    
    Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
    Tested-by: Lukasz Rymanowski <lukasz.rymanowski@tieto.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 634cf9cfd93db62d56afd3b70ef12331d200c523
Author: Johan Hedberg <johan.hedberg@intel.com>
Date:   Tue Jun 10 14:05:57 2014 +0300

    Bluetooth: Fix indicating discovery state when canceling inquiry
    
    commit 50143a433b70e3145bcf8a4a4e54f0c11bdee32b upstream.
    
    When inquiry is canceled through the HCI_Cancel_Inquiry command there is
    no Inquiry Complete event generated. Instead, all we get is the command
    complete for the HCI_Inquiry_Cancel command. This means that we must
    call the hci_discovery_set_state() function from the respective command
    complete handler in order to ensure that user space knows the correct
    discovery state.
    
    Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 778763287ded64dd5c022435d3e0e3182f148a64
Author: Johan Hedberg <johan.hedberg@intel.com>
Date:   Mon Jun 9 13:58:14 2014 +0300

    Bluetooth: Fix SSP acceptor just-works confirmation without MITM
    
    commit ba15a58b179ed76a7e887177f2b06de12c58ec8f upstream.
    
    From the Bluetooth Core Specification 4.1 page 1958:
    
    "if both devices have set the Authentication_Requirements parameter to
    one of the MITM Protection Not Required options, authentication stage 1
    shall function as if both devices set their IO capabilities to
    DisplayOnly (e.g., Numeric comparison with automatic confirmation on
    both devices)"
    
    So far our implementation has done user confirmation for all just-works
    cases regardless of the MITM requirements, however following the
    specification to the word means that we should not be doing confirmation
    when neither side has the MITM flag set.
    
    Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
    Tested-by: Szymon Janc <szymon.janc@tieto.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 8d8baacc721386b54a23302d93e8122f0ea15c6f
Author: Thomas Hellstrom <thellstrom@vmware.com>
Date:   Wed Jul 2 15:47:04 2014 +0200

    drm/vmwgfx: Fix incorrect write to read-only register v2:
    
    commit 4e578080ed3262ed2c3985868539bc66218d25c0 upstream.
    
    Commit "drm/vmwgfx: correct fb_fix_screeninfo.line_length", while fixing a
    vmwgfx fbdev bug, also writes the pitch to a supposedly read-only register:
    SVGA_REG_BYTES_PER_LINE, while it should be (and also in fact is) written to
    SVGA_REG_PITCHLOCK.
    
    This patch is Cc'd stable because of the unknown effects writing to this
    register might have, particularly on older device versions.
    
    v2: Updated log message.
    
    Cc: Christopher Friedt <chrisfriedt@gmail.com>
    Tested-by: Christopher Friedt <chrisfriedt@gmail.com>
    Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
    Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 74c6eb737eb3509c7ec23b98b84c7ac4d9eceb14
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Wed Jul 2 14:10:19 2014 -0400

    drm/radeon/cik: fix typo in EOP packet
    
    commit b397207b7475afa9df2f94541f978100ff1ea47e upstream.
    
    Volatile bit was in the wrong location.  This bit is
    not used at the moment.
    
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 860858903a44a7f427af39ba890a17b05dd4a887
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Tue Jul 1 12:11:31 2014 -0400

    drm/radeon/dpm: fix vddci setup typo on cayman
    
    commit b0880e87c1fd038b84498944f52e52c3e86ebe59 upstream.
    
    We were using the vddc mask rather than the vddci mask.
    
    Bug:
    https://bugzilla.kernel.org/show_bug.cgi?id=79071
    
    May also fix:
    https://bugs.freedesktop.org/show_bug.cgi?id=69723
    
    Noticed by: Dieter Nützel <Dieter@nuetzel-hh.de>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit af8f13889227e79bd7709836ab667b88db562c7f
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Tue Jul 1 12:07:33 2014 -0400

    drm/radeon/dpm: fix typo in vddci setup for eg/btc
    
    commit e07929810f0a19ddd756558290c7d72827cbfcd9 upstream.
    
    We were using the vddc mask rather than the vddci mask.
    
    Bug:
    https://bugzilla.kernel.org/show_bug.cgi?id=79071
    
    Possibly also fixes:
    https://bugzilla.kernel.org/show_bug.cgi?id=68571
    
    Noticed-by:  Jonathan Howard <jonathan@unbiased.name>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 20badb285d5c13d6c4c8ab2a47203d73378da50b
Author: Marek Olšák <marek.olsak@amd.com>
Date:   Tue May 27 02:56:36 2014 +0200

    drm/radeon: don't allow RADEON_GEM_DOMAIN_CPU for command submission
    
    commit ec65da385d46f63740c1c9230b891a6dcbd64c71 upstream.
    
    It hangs the hardware.
    
    Signed-off-by: Marek Olšák <marek.olsak@amd.com>
    Reviewed-by: Christian König <christian.koenig@amd.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 4a88652c5b6dae30f51c877df7beb9eed82675f8
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Tue May 27 16:40:51 2014 -0400

    drm/radeon/atom: fix dithering on certain panels
    
    commit 642528355c694f5ed68f6bff9ff520326a249f99 upstream.
    
    We need to specify the encoder mode as LVDS for eDP
    when using the Crtc_Source atom table in order to properly
    set up the FMT hardware.
    
    bug:
    https://bugs.freedesktop.org/show_bug.cgi?id=73911
    
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 85d9eb244713c9f0a820a9fd9d8ebe2eefc264c8
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Tue May 27 13:48:05 2014 -0400

    drm/radeon/dp: fix lane/clock setup for dp 1.2 capable devices
    
    commit 3b6d9fd23e015b5397c438fd3cd74147d2c805b6 upstream.
    
    Only DCE5+ asics support DP 1.2.
    
    Noticed by ArtForz on IRC.
    
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit d437f862f098aea2d30df01b3a550526d57d8ad0
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Tue May 27 13:11:36 2014 -0400

    drm/radeon: fix typo in radeon_connector_is_dp12_capable()
    
    commit af5d36539dfe043f1cf0f8b7334d6bb12cd14e75 upstream.
    
    We were checking the ext clock rather than the display clock.
    
    Noticed by ArtForz on IRC.
    
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 7bd2e093da845f9b507c0471d9beff0f8fd95320
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Mon Apr 21 21:45:09 2014 -0400

    drm/radeon: only apply hdmi bpc pll flags when encoder mode is hdmi
    
    commit 7d5ab3009a8ca777174f6f469277b3922d56fd4b upstream.
    
    May fix display issues with non-HDMI displays.
    
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit b7f5767932e6c8fc33f8b6961511fdafcf827e42
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Mon May 19 14:04:43 2014 -0400

    vgaswitcheroo: switch the mux to the igp on power down when runpm is enabled
    
    commit f2bc561610962693be61425cf913778586d8f9c1 upstream.
    
    Avoids blank screens on muxed systems when runpm is active.
    
    bug:
    https://bugs.freedesktop.org/show_bug.cgi?id=75917
    
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 62874b837dc5de00f3c8de646e80b73c52d75b01
Author: pekon gupta <pekon@ti.com>
Date:   Thu Mar 20 18:49:58 2014 +0530

    mtd: nand: omap: fix BCHx ecc.correct to return detected bit-flips in erased-page
    
    commit f306e8c3b667632952f1a4a74ffb910bbc06255f upstream.
    
    fixes: commit 62116e5171e00f85a8d53f76e45b84423c89ff34
           mtd: nand: omap2: Support for hardware BCH error correction.
    
    In omap_elm_correct_data(), if bitflip_count in an erased-page is within the
    correctable limit (< ecc.strength), then it is not indicated back to the caller
    ecc->read_page().
    
    This mis-guides upper layers like MTD and UBIFS layer to assume erased-page as
    perfectly clean and use it for writing even if actual bitflip_count was
    dangerously high (bitflip_count > mtd->bitflip_threshold).
    
    This patch fixes this above issue, by returning 'stats' to caller
    ecc->read_page() under all scenarios.
    
    Reported-by: Brian Norris <computersforpeace@gmail.com>
    Signed-off-by: Pekon Gupta <pekon@ti.com>
    Signed-off-by: Brian Norris <computersforpeace@gmail.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 9e911a38500562935a11ab7eabf11a8e1a82cedf
Author: Pekon Gupta <pekon@ti.com>
Date:   Tue May 6 09:41:32 2014 +0530

    mtd: eLBC NAND: fix subpage write support
    
    commit f034d87def51f026b735d1e2877e9387011b2ba3 upstream.
    
    As subpage write is enabled by default for all drivers, nand_write_subpage_hwecc
    causes a crash if the driver did not register ecc->hwctl or ecc->calculate.
    This behavior was introduced in
       commit 837a6ba4f3b6d23026674e6af6b6849a4634fff9
       "mtd: nand: subpage write support for hardware based ECC schemes".
    
    This fixes a crash by emulating subpage write support by padding sub-page data
    with 0xff on either sides to make it full page compatible.
    
    Reported-by: Helmut Schaa <helmut.schaa@googlemail.com>
    Tested-by: Helmut Schaa <helmut.schaa@googlemail.com>
    Signed-off-by: Pekon Gupta <pekon@ti.com>
    Reviewed-by: Scott Wood <scottwood@freescale.com>
    Signed-off-by: Brian Norris <computersforpeace@gmail.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit db172b15bfb29485fca401e330306516f7c83dd5
Author: Stanislaw Gruszka <stf_xl@wp.pl>
Date:   Mon Jun 16 18:45:15 2014 +0200

    rt2x00: fix rfkill regression on rt2500pci
    
    commit 616a8394b5df8c88f4dd416f4527439a4e365034 upstream.
    
    As reported by Niels, starting rfkill polling during device probe
    (commit e2bc7c5, generally sane change) broke rfkill on rt2500pci
    device. I considered that bug as some initalization issue, which
    should be fixed on rt2500pci specific code. But after several
    attempts (see bug report for details) we fail to find working solution.
    Hence I decided to revert to old behaviour on rt2500pci to fix
    regression.
    
    Additionally patch also unregister rfkill on device remove instead
    of ifconfig down, what was another issue introduced by bad commit.
    
    Bug report:
    https://bugzilla.kernel.org/show_bug.cgi?id=73821
    
    Fixes: e2bc7c5f3cb8 ("rt2x00: Fix rfkill_polling register function.")
    Bisected-by: Niels <nille0386@googlemail.com>
    Reported-and-tested-by: Niels <nille0386@googlemail.com>
    Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
    Signed-off-by: John W. Linville <linville@tuxdriver.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 3682af83fcc3399abb2d2d556c7fa34bfa17e4ec
Author: Stanislaw Gruszka <sgruszka@redhat.com>
Date:   Tue Jun 10 12:51:06 2014 +0200

    rt2x00: disable TKIP on USB
    
    commit 8edcb0ba0d56f5914eef11eda6db8bfe74eb9ca8 upstream.
    
    On USB we can not get atomically TKIP key. We have to disable support
    for TKIP acceleration on USB hardware to avoid bug as showed bellow.
    
    [  860.827243] BUG: scheduling while atomic: hostapd/3397/0x00000002
    <snip>
    [  860.827280] Call Trace:
    [  860.827282]  [<ffffffff81682ea6>] dump_stack+0x4d/0x66
    [  860.827284]  [<ffffffff8167eb9b>] __schedule_bug+0x47/0x55
    [  860.827285]  [<ffffffff81685bb3>] __schedule+0x733/0x7b0
    [  860.827287]  [<ffffffff81685c59>] schedule+0x29/0x70
    [  860.827289]  [<ffffffff81684f8a>] schedule_timeout+0x15a/0x2b0
    [  860.827291]  [<ffffffff8105ac50>] ? ftrace_raw_event_tick_stop+0xc0/0xc0
    [  860.827294]  [<ffffffff810c13c2>] ? __module_text_address+0x12/0x70
    [  860.827296]  [<ffffffff81686823>] wait_for_completion_timeout+0xb3/0x140
    [  860.827298]  [<ffffffff81080fc0>] ? wake_up_state+0x20/0x20
    [  860.827301]  [<ffffffff814d5b3d>] usb_start_wait_urb+0x7d/0x150
    [  860.827303]  [<ffffffff814d5cd5>] usb_control_msg+0xc5/0x110
    [  860.827305]  [<ffffffffa02fb0c6>] rt2x00usb_vendor_request+0xc6/0x160  [rt2x00usb]
    [  860.827307]  [<ffffffffa02fb215>] rt2x00usb_vendor_req_buff_lock+0x75/0x150 [rt2x00usb]
    [  860.827309]  [<ffffffffa02fb393>] rt2x00usb_vendor_request_buff+0xa3/0xe0 [rt2x00usb]
    [  860.827311]  [<ffffffffa023d1a3>] rt2x00usb_register_multiread+0x33/0x40 [rt2800usb]
    [  860.827314]  [<ffffffffa05805f9>] rt2800_get_tkip_seq+0x39/0x50  [rt2800lib]
    [  860.827321]  [<ffffffffa0480f88>] ieee80211_get_key+0x218/0x2a0  [mac80211]
    [  860.827322]  [<ffffffff815cc68c>] ? __nlmsg_put+0x6c/0x80
    [  860.827329]  [<ffffffffa051b02e>] nl80211_get_key+0x22e/0x360 [cfg80211]
    
    Reported-and-tested-by: Peter Wu <lekensteyn@gmail.com>
    Reported-and-tested-by: Pontus Fuchs <pontus.fuchs@gmail.com>
    Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
    Signed-off-by: John W. Linville <linville@tuxdriver.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 6e73e2919e887d9ee07e9283db14a13d5001317d
Author: Michal Nazarewicz <mina86@mina86.com>
Date:   Tue Jun 17 17:47:41 2014 +0200

    usb: gadget: f_fs: fix NULL pointer dereference when there are no strings
    
    commit f0688c8b81d2ea239c3fb0b848f623b579238d99 upstream.
    
    If the descriptors do not need any strings and user space sends empty
    set of strings, the ffs->stringtabs field remains NULL.  Thus
    *ffs->stringtabs in functionfs_bind leads to a NULL pointer
    dereferenece.
    
    The bug was introduced by commit [fd7c9a007f: “use usb_string_ids_n()”].
    
    While at it, remove double initialisation of lang local variable in
    that function.
    
    ffs->strings_count does not need to be checked in any way since in
    the above scenario it will remain zero and usb_string_ids_n() is
    a no-operation when colled with 0 argument.
    
    Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 5b7169673a2f472bc2ed4cfe4c3926ba546a201a
Author: Johan Hovold <johan@kernel.org>
Date:   Thu Jun 5 16:05:52 2014 +0200

    USB: ftdi_sio: fix null deref at port probe
    
    commit aea1ae8760314e072bf1b773521e9de5d5dda10d upstream.
    
    Fix NULL-pointer dereference when probing an interface with no
    endpoints.
    
    These devices have two bulk endpoints per interface, but this avoids
    crashing the kernel if a user forces a non-FTDI device to be probed.
    
    Note that the iterator variable was made unsigned in order to avoid
    a maybe-uninitialized compiler warning for ep_desc after the loop.
    
    Fixes: 895f28badce9 ("USB: ftdi_sio: fix hi-speed device packet size
    calculation")
    
    Reported-by: Mike Remski <mremski@mutualink.net>
    Tested-by: Mike Remski <mremski@mutualink.net>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 6b94ad95ad64b2a2ca7a26b9fd147ebb5e52383b
Author: Peter Chen <peter.chen@freescale.com>
Date:   Wed Jul 2 12:16:31 2014 +0800

    usb: chipidea: udc: delete td from req's td list at ep_dequeue
    
    commit e4adcff09ca39ecbcc4851d40d0f0a5458e7b77a upstream.
    
    We need to delete un-finished td from current request's td list
    at ep_dequeue API, otherwise, this non-user td will be remained
    at td list before this request is freed. So if we do ep_queue->
    ep_dequeue->ep_queue sequence, when the complete interrupt for
    the second ep_queue comes, we search td list for this request,
    the first td (added by the first ep_queue) will be handled, and
    its status is still active, so we will consider the this transfer
    still not be completed, but in fact, it has completed. It causes
    the peripheral side considers it never receives current data for
    this transfer.
    
    We met this problem when do "Error Recovery Test - Device Configured"
    test item for USBCV2 MSC test, the host has never received ACK for
    the IN token for CSW due to peripheral considers it does not get this
    CBW, the USBCV test log like belows:
    
    --------------------------------------------------------------------------
    INFO
    Issuing BOT MSC Reset, reset should always succeed
    INFO
    Retrieving status on CBW endpoint
    INFO
    CBW endpoint status = 0x0
    INFO
    Retrieving status on CSW endpoint
    INFO
    CSW endpoint status = 0x0
    INFO
    Issuing required command (Test Unit Ready) to verify device has recovered
    INFO
    Issuing CBW (attempt #1):
    INFO
    |----- CBW LUN                  = 0x0
    INFO
    |----- CBW Flags                = 0x0
    INFO
    |----- CBW Data Transfer Length = 0x0
    INFO
    |----- CBW CDB Length           = 0x6
    INFO
    |----- CBW CDB-00 = 0x0
    INFO
    |----- CBW CDB-01 = 0x0
    INFO
    |----- CBW CDB-02 = 0x0
    INFO
    |----- CBW CDB-03 = 0x0
    INFO
    |----- CBW CDB-04 = 0x0
    INFO
    |----- CBW CDB-05 = 0x0
    INFO
    Issuing CSW : try 1
    INFO
    CSW Bulk Request timed out!
    ERROR
    Failed CSW phase : should have been success or stall
    FAIL
    (5.3.4) The CSW status value must be 0x00, 0x01, or 0x02.
    ERROR
    BOTCommonMSCRequest failed:  error=80004000
    
    Cc: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
    Signed-off-by: Peter Chen <peter.chen@freescale.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit a92e6f7083da6402c6d69e54026b3ae00c78530b
Author: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Date:   Mon Jun 23 15:34:22 2014 -0300

    usb: musb: Fix panic upon musb_am335x module removal
    
    commit 7adb5c876e9c0677078a1e1094c6eafd29c30b74 upstream.
    
    At probe time, the musb_am335x driver register its childs by
    calling of_platform_populate(), which registers all childs in
    the devicetree hierarchy recursively.
    
    On the other side, the driver's remove() function uses of_device_unregister()
    to remove each child of musb_am335x's.
    
    However, when musb_dsps is loaded, its devices are attached to the musb_am335x
    device as musb_am335x childs. Hence, musb_am335x remove() will attempt to
    unregister the devices registered by musb_dsps, which produces a kernel panic.
    
    In other words, the childs in the "struct device" hierarchy are not the same
    as the childs in the "devicetree" hierarchy.
    
    Ideally, we should enforce the removal of the devices registered by
    musb_am335x *only*, instead of all its child devices. However, because of the
    recursive nature of of_platform_populate, this doesn't seem possible.
    
    Therefore, as the only solution at hand, this commit disables musb_am335x
    driver removal capability, preventing it from being ever removed. This was
    originally suggested by Sebastian Siewior:
    
    https://www.mail-archive.com/linux-omap@vger.kernel.org/msg104946.html
    
    And for reference, here's the panic upon module removal:
    
    musb-hdrc musb-hdrc.0.auto: remove, state 4
    usb usb1: USB disconnect, device number 1
    musb-hdrc musb-hdrc.0.auto: USB bus 1 deregistered
    Unable to handle kernel NULL pointer dereference at virtual address 0000008c
    pgd = de11c000
    [0000008c] *pgd=9e174831, *pte=00000000, *ppte=00000000
    Internal error: Oops: 17 [#1] ARM
    Modules linked in: musb_am335x(-) musb_dsps musb_hdrc usbcore usb_common
    CPU: 0 PID: 623 Comm: modprobe Not tainted 3.15.0-rc4-00001-g24efd13 #69
    task: de1b7500 ti: de122000 task.ti: de122000
    PC is at am335x_shutdown+0x10/0x28
    LR is at am335x_shutdown+0xc/0x28
    pc : [<c0327798>]    lr : [<c0327794>]    psr: a0000013
    sp : de123df8  ip : 00000004  fp : 00028f00
    r10: 00000000  r9 : de122000  r8 : c000e6c4
    r7 : de0e3c10  r6 : de0e3800  r5 : de624010  r4 : de1ec750
    r3 : de0e3810  r2 : 00000000  r1 : 00000001  r0 : 00000000
    Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
    Control: 10c5387d  Table: 9e11c019  DAC: 00000015
    Process modprobe (pid: 623, stack limit = 0xde122240)
    Stack: (0xde123df8 to 0xde124000)
    3de0:                                                       de0e3810 bf054488
    3e00: bf05444c de624010 60000013 bf043650 000012fc de624010 de0e3810 bf043a20
    3e20: de0e3810 bf04b240 c0635b88 c02ca37c c02ca364 c02c8db0 de1b7500 de0e3844
    3e40: de0e3810 c02c8e28 c0635b88 de02824c de0e3810 c02c884c de0e3800 de0e3810
    3e60: de0e3818 c02c5b20 bf05417c de0e3800 de0e3800 c0635b88 de0f2410 c02ca838
    3e80: bf05417c de0e3800 bf055438 c02ca8cc de0e3c10 bf054194 de0e3c10 c02ca37c
    3ea0: c02ca364 c02c8db0 de1b7500 de0e3c44 de0e3c10 c02c8e28 c0635b88 de02824c
    3ec0: de0e3c10 c02c884c de0e3c10 de0e3c10 de0e3c18 c02c5b20 de0e3c10 de0e3c10
    3ee0: 00000000 bf059000 a0000013 c02c5bc0 00000000 bf05900c de0e3c10 c02c5c48
    3f00: de0dd0c0 de1ec970 de0f2410 bf05929c de0f2444 bf05902c de0f2410 c02ca37c
    3f20: c02ca364 c02c8db0 bf05929c de0f2410 bf05929c c02c94c8 bf05929c 00000000
    3f40: 00000800 c02c8ab4 bf0592e0 c007fc40 c00dd820 6273756d 336d615f 00783533
    3f60: c064a0ac de1b7500 de122000 de1b7500 c000e590 00000001 c000e6c4 c0060160
    3f80: 00028e70 00028e70 00028ea4 00000081 60000010 00028e70 00028e70 00028ea4
    3fa0: 00000081 c000e500 00028e70 00028e70 00028ea4 00000800 becb59f8 00027608
    3fc0: 00028e70 00028e70 00028ea4 00000081 00000001 00000001 00000000 00028f00
    3fe0: b6e6b6f0 becb59d4 000160e8 b6e6b6fc 60000010 00028ea4 00000000 00000000
    [<c0327798>] (am335x_shutdown) from [<bf054488>] (dsps_musb_exit+0x3c/0x4c [musb_dsps])
    [<bf054488>] (dsps_musb_exit [musb_dsps]) from [<bf043650>] (musb_shutdown+0x80/0x90 [musb_hdrc])
    [<bf043650>] (musb_shutdown [musb_hdrc]) from [<bf043a20>] (musb_remove+0x24/0x68 [musb_hdrc])
    [<bf043a20>] (musb_remove [musb_hdrc]) from [<c02ca37c>] (platform_drv_remove+0x18/0x1c)
    [<c02ca37c>] (platform_drv_remove) from [<c02c8db0>] (__device_release_driver+0x70/0xc8)
    [<c02c8db0>] (__device_release_driver) from [<c02c8e28>] (device_release_driver+0x20/0x2c)
    [<c02c8e28>] (device_release_driver) from [<c02c884c>] (bus_remove_device+0xdc/0x10c)
    [<c02c884c>] (bus_remove_device) from [<c02c5b20>] (device_del+0x104/0x198)
    [<c02c5b20>] (device_del) from [<c02ca838>] (platform_device_del+0x14/0x9c)
    [<c02ca838>] (platform_device_del) from [<c02ca8cc>] (platform_device_unregister+0xc/0x20)
    [<c02ca8cc>] (platform_device_unregister) from [<bf054194>] (dsps_remove+0x18/0x38 [musb_dsps])
    [<bf054194>] (dsps_remove [musb_dsps]) from [<c02ca37c>] (platform_drv_remove+0x18/0x1c)
    [<c02ca37c>] (platform_drv_remove) from [<c02c8db0>] (__device_release_driver+0x70/0xc8)
    [<c02c8db0>] (__device_release_driver) from [<c02c8e28>] (device_release_driver+0x20/0x2c)
    [<c02c8e28>] (device_release_driver) from [<c02c884c>] (bus_remove_device+0xdc/0x10c)
    [<c02c884c>] (bus_remove_device) from [<c02c5b20>] (device_del+0x104/0x198)
    [<c02c5b20>] (device_del) from [<c02c5bc0>] (device_unregister+0xc/0x20)
    [<c02c5bc0>] (device_unregister) from [<bf05900c>] (of_remove_populated_child+0xc/0x14 [musb_am335x])
    [<bf05900c>] (of_remove_populated_child [musb_am335x]) from [<c02c5c48>] (device_for_each_child+0x44/0x70)
    [<c02c5c48>] (device_for_each_child) from [<bf05902c>] (am335x_child_remove+0x18/0x30 [musb_am335x])
    [<bf05902c>] (am335x_child_remove [musb_am335x]) from [<c02ca37c>] (platform_drv_remove+0x18/0x1c)
    [<c02ca37c>] (platform_drv_remove) from [<c02c8db0>] (__device_release_driver+0x70/0xc8)
    [<c02c8db0>] (__device_release_driver) from [<c02c94c8>] (driver_detach+0xb4/0xb8)
    [<c02c94c8>] (driver_detach) from [<c02c8ab4>] (bus_remove_driver+0x4c/0xa0)
    [<c02c8ab4>] (bus_remove_driver) from [<c007fc40>] (SyS_delete_module+0x128/0x1cc)
    [<c007fc40>] (SyS_delete_module) from [<c000e500>] (ret_fast_syscall+0x0/0x48)
    
    Fixes: 97238b35d5bb ("usb: musb: dsps: use proper child nodes")
    Acked-by: George Cherian <george.cherian@ti.com>
    Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit cfc3a6809fcfcad827e8c29b882de5b777e98cfc
Author: Thomas Gleixner <tglx@linutronix.de>
Date:   Fri Jun 20 23:41:24 2014 +0200

    usb: musb: Ensure that cppi41 timer gets armed on premature DMA TX irq
    
    commit c58d80f523ffc15ef4d062fc7aeb03793fe39701 upstream.
    
    Some TI chips raise the DMA complete interrupt before the actual
    transfer has been completed. The code tries to busy wait for a few
    microseconds and if that fails it arms an hrtimer to recheck. So far
    so good, but that has the following issue:
    
    CPU 0					CPU1
    
    start_next_transfer(RQ1);
    
    DMA interrupt
      if (premature_irq(RQ1))
        if (!hrtimer_active(timer))
           hrtimer_start(timer);
    
    hrtimer expires
      timer->state = CALLBACK_RUNNING;
      timer->fn()
        cppi41_recheck_tx_req()
          complete_request(RQ1);
          if (requests_pending())
            start_next_transfer(RQ2);
    
    					DMA interrupt
    					  if (premature_irq(RQ2))
    					    if (!hrtimer_active(timer))
    					       hrtimer_start(timer);
      timer->state = INACTIVE;
    
    The premature interrupt of request2 on CPU1 does not arm the timer and
    therefor the request completion never happens because it checks for
    !hrtimer_active(). hrtimer_active() evaluates:
    
      timer->state != HRTIMER_STATE_INACTIVE
    
    which of course evaluates to true in the above case as timer->state is
    CALLBACK_RUNNING.
    
    That's clearly documented:
    
     * A timer is active, when it is enqueued into the rbtree or the
     * callback function is running or it's in the state of being migrated
     * to another cpu.
    
    But that's not what the code wants to check. The code wants to check
    whether the timer is queued, i.e. whether its armed and waiting for
    expiry.
    
    We have a helper function for this: hrtimer_is_queued(). This
    evaluates:
    
      timer->state & HRTIMER_STATE_QUEUED
    
    So in the above case this evaluates to false and therefor forces the
    DMA interrupt on CPU1 to call hrtimer_start().
    
    Use hrtimer_is_queued() instead of hrtimer_active() and evrything is
    good.
    
    Reported-by: Torben Hohn <torbenh@linutronix.de>
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 52b2230ba2b957ab4a995f13cd7cd40310610755
Author: Linus Walleij <linus.walleij@linaro.org>
Date:   Tue Jun 10 10:54:16 2014 +0200

    usb: musb: ux500: don't propagate the OF node
    
    commit 82363cf2eeafeea6ba88849f5e2febdc8a05943f upstream.
    
    There is a regression in the upcoming v3.16-rc1, that is caused
    by a problem that has been around for a while but now finally
    hangs the system. The bootcrawl looks like this:
    
    pinctrl-nomadik soc:pinctrl: pin GPIO256_AF28 already
    requested by a03e0000.usb_per5; cannot claim for musb-hdrc.0.auto
    pinctrl-nomadik soc:pinctrl: pin-256 (musb-hdrc.0.auto) status -22
    pinctrl-nomadik soc:pinctrl: could not request pin 256
    (GPIO256_AF28) from group usb_a_1  on device pinctrl-nomadik
    musb-hdrc musb-hdrc.0.auto: Error applying setting, reverse
    things back
    HS USB OTG: no transceiver configured
    musb-hdrc musb-hdrc.0.auto: musb_init_controller failed
    with status -517
    platform musb-hdrc.0.auto: Driver musb-hdrc requests
    probe deferral
    (...)
    
    The ux500 MUSB driver propagates the OF node to the dynamically
    created musb-hdrc device, which is incorrect as it makes the OF
    core believe there are two devices spun from the very same
    DT node, which confuses other parts of the device core, notably
    the pin control subsystem, which will try to apply all the pin
    control settings also to the HDRC device as it gets
    instantiated. (The OMAP2430 for example, does not set the
    of_node member.)
    
    Cc: Arnd Bergmann <arnd@arndb.de>
    Acked-by: Lee Jones <lee.jones@linaro.org>
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 8a83c8563c19bd93a26c36f4c1e5bf64e63a3180
Author: Bjørn Mork <bjorn@mork.no>
Date:   Fri Jun 6 17:25:56 2014 +0200

    usb: option: add/modify Olivetti Olicard modems
    
    commit b0ebef36e93703e59003ad6a1a20227e47714417 upstream.
    
    Adding a couple of Olivetti modems and blacklisting the net
    function on a couple which are already supported.
    
    Reported-by: Lars Melin <larsm17@gmail.com>
    Signed-off-by: Bjørn Mork <bjorn@mork.no>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 245fbe911b4a92eb631ed77519cf8935665c7544
Author: Oliver Neukum <oneukum@suse.de>
Date:   Tue May 20 16:27:40 2014 +0200

    USB: option: add device ID for SpeedUp SU9800 usb 3g modem
    
    commit 1cab4c68e339086cdaff7535848e878e8f261fca upstream.
    
    Reported by Alif Mubarak Ahmad:
    
    This device vendor and product id is 1c9e:9800
    It is working as serial interface with generic usbserial driver.
    I thought it is more suitable to use usbserial option driver, which has
    better capability distinguishing between modem serial interface and
    micro sd storage interface.
    
    [ johan: style changes ]
    
    Signed-off-by: Oliver Neukum <oneukum@suse.de>
    Tested-by: Alif Mubarak Ahmad <alive4ever@live.com>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit f9b96e0f652471baae2bb58547c413002841a655
Author: Wang, Yu <yu.y.wang@intel.com>
Date:   Tue Jun 24 17:14:44 2014 +0300

    xhci: Fix runtime suspended xhci from blocking system suspend.
    
    commit d6236f6d1d885aa19d1cd7317346fe795227a3cc upstream.
    
    The system suspend flow as following:
    1, Freeze all user processes and kenrel threads.
    
    2, Try to suspend all devices.
    
    2.1, If pci device is in RPM suspended state, then pci driver will try
    to resume it to RPM active state in the prepare stage.
    
    2.2, xhci_resume function calls usb_hcd_resume_root_hub to queue two
    workqueue items to resume usb2&usb3 roothub devices.
    
    2.3, Call suspend callbacks of devices.
    
    2.3.1, All suspend callbacks of all hcd's children, including
    roothub devices are called.
    
    2.3.2, Finally, hcd_pci_suspend callback is called.
    
    Due to workqueue threads were already frozen in step 1, the workqueue
    items can't be scheduled, and the roothub devices can't be resumed in
    this flow. The HCD_FLAG_WAKEUP_PENDING flag which is set in
    usb_hcd_resume_root_hub won't be cleared. Finally,
    hcd_pci_suspend will return -EBUSY, and system suspend fails.
    
    The reason why this issue doesn't show up very often is due to that
    choose_wakeup will be called in step 2.3.1. In step 2.3.1, if
    udev->do_remote_wakeup is not equal to device_may_wakeup(&udev->dev), then
    udev will resume to RPM active for changing the wakeup settings. This
    has been a lucky hit which hides this issue.
    
    For some special xHCI controllers which have no USB2 port, then roothub
    will not match hub driver due to probe failed. Then its
    do_remote_wakeup will be set to zero, and we won't be as lucky.
    
    xhci driver doesn't need to resume roothub devices everytime like in
    the above case. It's only needed when there are pending event TRBs.
    
    This patch should be back-ported to kernels as old as 3.2, that
    contains the commit f69e3120df82391a0ee8118e0a156239a06b2afb
    "USB: XHCI: resume root hubs when the controller resumes"
    
    Signed-off-by: Wang, Yu <yu.y.wang@intel.com>
    Acked-by: Alan Stern <stern@rowland.harvard.edu>
    [use readl() instead of removed xhci_readl(), reword commit message -Mathias]
    Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 02fe41346ccc70b4d4b487072c644e3483d51a88
Author: Mathias Nyman <mathias.nyman@linux.intel.com>
Date:   Tue Jun 24 17:14:41 2014 +0300

    xhci: correct burst count field for isoc transfers on 1.0 xhci hosts
    
    commit 3213b151387df0b95f4eada104f68eb1c1409cb3 upstream.
    
    The transfer burst count (TBC) field in xhci 1.0 hosts should be set
    to the number of bursts needed to transfer all packets in a isoc TD.
    Supported values are 0-2 (1 to 3 bursts per service interval).
    
    Formula for TBC calculation is given in xhci spec section 4.11.2.3:
    TBC = roundup( Transfer Descriptor Packet Count / Max Burst Size +1 ) - 1
    
    This patch should be applied to stable kernels since 3.0 that contain
    the commit 5cd43e33b9519143f06f507dd7cbee6b7a621885
    "xhci 1.0: Set transfer burst count field."
    
    Suggested-by: ShiChun Ma <masc2008@qq.com>
    Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit e377f153e8522de510c3f1ded915e820db22cc54
Author: Paolo Bonzini <pbonzini@redhat.com>
Date:   Wed Jun 4 13:34:58 2014 +0200

    virtio-scsi: fix various bad behavior on aborted requests
    
    commit 8faeb529b2dabb9df691d614dda18910a43d05c9 upstream.
    
    Even though the virtio-scsi spec guarantees that all requests related
    to the TMF will have been completed by the time the TMF itself completes,
    the request queue's callback might not have run yet.  This causes requests
    to be completed more than once, and as a result triggers a variety of
    BUGs or oopses.
    
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Reviewed-by: Venkatesh Srinivas <venkateshs@google.com>
    Signed-off-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit ddefcdd6b6530ce870b66409a1d4a2eb34fd01ee
Author: Ulrich Obergfell <uobergfe@redhat.com>
Date:   Wed Jun 4 13:34:57 2014 +0200

    scsi_error: fix invalid setting of host byte
    
    commit 8922a908908ff947f1f211e07e2e97f1169ad3cb upstream.
    
    After scsi_try_to_abort_cmd returns, the eh_abort_handler may have
    already found that the command has completed in the device, causing
    the host_byte to be nonzero (e.g. it could be DID_ABORT).  When
    this happens, ORing DID_TIME_OUT into the host byte will corrupt
    the result field and initiate an unwanted command retry.
    
    Fix this by using set_host_byte instead, following the model of
    commit 2082ebc45af9c9c648383b8cde0dc1948eadbf31.
    
    Signed-off-by: Ulrich Obergfell <uobergfe@redhat.com>
    [Fix all instances according to review comments. - Paolo]
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Christoph Hellwig <hch@lst.de>
    Reviewed-by: Ewan D. Milne <emilne@redhat.com>
    Reviewed-by: Hannes Reinecke <hare@suse.de>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 424d0d5db0ee42556f21251760b4acde41caf553
Author: Paolo Bonzini <pbonzini@redhat.com>
Date:   Wed Jun 4 13:34:56 2014 +0200

    virtio-scsi: avoid cancelling uninitialized work items
    
    commit cdda0e5acbb78f7b777049f8c27899e5c5bb368f upstream.
    
    Calling the workqueue interface on uninitialized work items isn't a
    good idea even if they're zeroed. It's not failing catastrophically only
    through happy accidents.
    
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 4cd3c8a2ab579c2688b9db43aab1238411e10c93
Author: Brian King <brking@linux.vnet.ibm.com>
Date:   Fri May 23 10:52:11 2014 -0500

    ibmvscsi: Add memory barriers for send / receive
    
    commit 7114aae02742d6b5c5a0d39a41deb61d415d3717 upstream.
    
    Add a memory barrier prior to sending a new command to the VIOS
    to ensure the VIOS does not receive stale data in the command buffer.
    Also add a memory barrier when processing the CRQ for completed commands.
    
    Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
    Acked-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
    Signed-off-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit a9b8dab6a9870e6d919c41b460888f46dc94fa56
Author: Brian King <brking@linux.vnet.ibm.com>
Date:   Fri May 23 10:52:10 2014 -0500

    ibmvscsi: Abort init sequence during error recovery
    
    commit 9ee755974bea2f9880e517ec985dc9dede1b3a36 upstream.
    
    If a CRQ reset is triggered for some reason while in the middle
    of performing VSCSI adapter initialization, we don't want to
    call the done function for the initialization MAD commands as
    this will only result in two threads attempting initialization
    at the same time, resulting in failures.
    
    Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
    Acked-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
    Signed-off-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 9d1274d16846751a7a9d6ffa21cf06b6a0cf3bfa
Author: Takashi Iwai <tiwai@suse.de>
Date:   Wed Jun 25 14:24:47 2014 +0200

    ALSA: usb-audio: Fix races at disconnection and PCM closing
    
    commit 92a586bdc06de6629dae1b357dac221253f55ff8 upstream.
    
    When a USB-audio device is disconnected while PCM is still running, we
    still see some race: the disconnect callback calls
    snd_usb_endpoint_free() that calls release_urbs() and then kfree()
    while a PCM stream would be closed at the same time and calls
    stop_endpoints() that leads to wait_clear_urbs().  That is, the EP
    object might be deallocated while a PCM stream is syncing with
    wait_clear_urbs() with the same EP.
    
    Basically calling multiple wait_clear_urbs() would work fine, also
    calling wait_clear_urbs() and release_urbs() would work, too, as
    wait_clear_urbs() just reads some fields in ep.  The problem is the
    succeeding kfree() in snd_pcm_endpoint_free().
    
    This patch moves out the EP deallocation into the later point, the
    destructor callback.  At this stage, all PCMs must have been already
    closed, so it's safe to free the objects.
    
    Reported-by: Alan Stern <stern@rowland.harvard.edu>
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 1855b4bde5c72f1da35088452226b458bdadadb4
Author: Oleg Nesterov <oleg@redhat.com>
Date:   Sun Apr 13 20:58:54 2014 +0200

    tracing: Fix syscall_*regfunc() vs copy_process() race
    
    commit 4af4206be2bd1933cae20c2b6fb2058dbc887f7c upstream.
    
    syscall_regfunc() and syscall_unregfunc() should set/clear
    TIF_SYSCALL_TRACEPOINT system-wide, but do_each_thread() can race
    with copy_process() and miss the new child which was not added to
    the process/thread lists yet.
    
    Change copy_process() to update the child's TIF_SYSCALL_TRACEPOINT
    under tasklist.
    
    Link: http://lkml.kernel.org/p/20140413185854.GB20668@redhat.com
    
    Fixes: a871bd33a6c0 "tracing: Add syscall tracepoints"
    Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
    Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
    Signed-off-by: Oleg Nesterov <oleg@redhat.com>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 0ecae6cb9d66c8d962c2d0c4f073a6ea0c4b52db
Author: Steven Rostedt (Red Hat) <rostedt@goodmis.org>
Date:   Fri May 30 09:42:39 2014 -0400

    tracing: Try again for saved cmdline if failed due to locking
    
    commit 379cfdac37923653c9d4242d10052378b7563005 upstream.
    
    In order to prevent the saved cmdline cache from being filled when
    tracing is not active, the comms are only recorded after a trace event
    is recorded.
    
    The problem is, a comm can fail to be recorded if the trace_cmdline_lock
    is held. That lock is taken via a trylock to allow it to happen from
    any context (including NMI). If the lock fails to be taken, the comm
    is skipped. No big deal, as we will try again later.
    
    But! Because of the code that was added to only record after an event,
    we may not try again later as the recording is made as a oneshot per
    event per CPU.
    
    Only disable the recording of the comm if the comm is actually recorded.
    
    Fixes: 7ffbd48d5cab "tracing: Cache comms only after an event occurred"
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 0b052a0ddbb35ea807e0085624042171c22eac7e
Author: Jacob Keller <jacob.e.keller@intel.com>
Date:   Fri Jun 6 14:36:39 2014 -0700

    Documentation/SubmittingPatches: describe the Fixes: tag
    
    commit 8401aa1f59975c03eeebd3ac6d264cbdfe9af5de upstream.
    
    Update the SubmittingPatches process to include howto about the new
    'Fixes:' tag to be used when a patch fixes an issue in a previous commit
    (found by git-bisect for example).
    
    Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
    Tested-by: Aaron Brown <aaron.f.brown@intel.com>
    Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
    Cc: Randy Dunlap <rdunlap@infradead.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit fac842fd65ee900a65a3ffe48b4b41669b785291
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Thu Jul 3 16:06:57 2014 -0700

    lz4: add overrun checks to lz4_uncompress_unknownoutputsize()
    
    commit 4a3a99045177369700c60d074c0e525e8093b0fc upstream.
    
    Jan points out that I forgot to make the needed fixes to the
    lz4_uncompress_unknownoutputsize() function to mirror the changes done
    in lz4_decompress() with regards to potential pointer overflows.
    
    The only in-kernel user of this function is the zram code, which only
    takes data from a valid compressed buffer that it made itself, so it's
    not a big issue.  But due to external kernel modules using this
    function, it's better to be safe here.
    
    Reported-by: Jan Beulich <JBeulich@suse.com>
    Cc: "Don A. Bailey" <donb@securitymouse.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 2f1824407bf18b019d2c821881dd0956c6f0a254
Author: Tejun Heo <tj@kernel.org>
Date:   Thu Jul 3 15:43:15 2014 -0400

    ptrace,x86: force IRET path after a ptrace_stop()
    
    commit b9cd18de4db3c9ffa7e17b0dc0ca99ed5aa4d43a upstream.
    
    The 'sysret' fastpath does not correctly restore even all regular
    registers, much less any segment registers or reflags values.  That is
    very much part of why it's faster than 'iret'.
    
    Normally that isn't a problem, because the normal ptrace() interface
    catches the process using the signal handler infrastructure, which
    always returns with an iret.
    
    However, some paths can get caught using ptrace_event() instead of the
    signal path, and for those we need to make sure that we aren't going to
    return to user space using 'sysret'.  Otherwise the modifications that
    may have been done to the register set by the tracer wouldn't
    necessarily take effect.
    
    Fix it by forcing IRET path by setting TIF_NOTIFY_RESUME from
    arch_ptrace_stop_needed() which is invoked from ptrace_stop().
    
    Signed-off-by: Tejun Heo <tj@kernel.org>
    Reported-by: Andy Lutomirski <luto@amacapital.net>
    Acked-by: Oleg Nesterov <oleg@redhat.com>
    Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 8391d35ef8245102821c29553fa7b5db545f9446
Author: Peter Christensen <pch@ordbogen.com>
Date:   Sat May 24 21:40:12 2014 +0200

    ipvs: Fix panic due to non-linear skb
    
    commit f44a5f45f544561302e855e7bd104e5f506ec01b upstream.
    
    Receiving a ICMP response to an IPIP packet in a non-linear skb could
    cause a kernel panic in __skb_pull.
    
    The problem was introduced in
    commit f2edb9f7706dcb2c0d9a362b2ba849efe3a97f5e ("ipvs: implement
    passive PMTUD for IPIP packets").
    
    Signed-off-by: Peter Christensen <pch@ordbogen.com>
    Acked-by: Julian Anastasov <ja@ssi.bg>
    Signed-off-by: Simon Horman <horms@verge.net.au>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit e7f46b90acc0848bfc2d1906e2be285c7d81afbc
Author: Deng-Cheng Zhu <dengcheng.zhu@imgtec.com>
Date:   Tue Jun 24 10:31:08 2014 -0700

    MIPS: KVM: Fix memory leak on VCPU
    
    commit 8c9eb041cf76038eb3b62ee259607eec9b89f48d upstream.
    
    kvm_arch_vcpu_free() is called in 2 code paths:
    
    1) kvm_vm_ioctl()
           kvm_vm_ioctl_create_vcpu()
               kvm_arch_vcpu_destroy()
                   kvm_arch_vcpu_free()
    2) kvm_put_kvm()
           kvm_destroy_vm()
               kvm_arch_destroy_vm()
                   kvm_mips_free_vcpus()
                       kvm_arch_vcpu_free()
    
    Neither of the paths handles VCPU free. We need to do it in
    kvm_arch_vcpu_free() corresponding to the memory allocation in
    kvm_arch_vcpu_create().
    
    Signed-off-by: Deng-Cheng Zhu <dengcheng.zhu@imgtec.com>
    Reviewed-by: James Hogan <james.hogan@imgtec.com>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 13fa8defdc11fa6a21315072e18a05192c4072c6
Author: James Hogan <james.hogan@imgtec.com>
Date:   Thu May 29 10:16:44 2014 +0100

    MIPS: KVM: Remove redundant NULL checks before kfree()
    
    commit c6c0a6637f9da54f9472144d44f71cf847f92e20 upstream.
    
    The kfree() function already NULL checks the parameter so remove the
    redundant NULL checks before kfree() calls in arch/mips/kvm/.
    
    Signed-off-by: James Hogan <james.hogan@imgtec.com>
    Cc: Paolo Bonzini <pbonzini@redhat.com>
    Cc: Gleb Natapov <gleb@kernel.org>
    Cc: kvm@vger.kernel.org
    Cc: Ralf Baechle <ralf@linux-mips.org>
    Cc: linux-mips@linux-mips.org
    Cc: Sanjay Lal <sanjayl@kymasys.com>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit a4424b76ff576642a98409dd587631dd34891e62
Author: Jeff Mahoney <jeffm@suse.com>
Date:   Wed May 21 13:28:07 2014 -0400

    reiserfs: call truncate_setsize under tailpack mutex
    
    commit 22e7478ddbcb670e33fab72d0bbe7c394c3a2c84 upstream.
    
    Prior to commit 0e4f6a791b1e (Fix reiserfs_file_release()), reiserfs
    truncates serialized on i_mutex. They mostly still do, with the exception
    of reiserfs_file_release. That blocks out other writers via the tailpack
    mutex and the inode openers counter adjusted in reiserfs_file_open.
    
    However, NFS will call reiserfs_setattr without having called ->open, so
    we end up with a race when nfs is calling ->setattr while another
    process is releasing the file. Ultimately, it triggers the
    BUG_ON(inode->i_size != new_file_size) check in maybe_indirect_to_direct.
    
    The solution is to pull the lock into reiserfs_setattr to encompass the
    truncate_setsize call as well.
    
    Signed-off-by: Jeff Mahoney <jeffm@suse.com>
    Signed-off-by: Jan Kara <jack@suse.cz>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 24cba162f91747b0a52a82fb685d2315f8da9661
Author: Scott Wood <scottwood@freescale.com>
Date:   Tue Jun 24 20:15:51 2014 -0500

    powerpc: Don't skip ePAPR spin-table CPUs
    
    commit 6663a4fa6711050036562ddfd2086edf735fae21 upstream.
    
    Commit 59a53afe70fd530040bdc69581f03d880157f15a "powerpc: Don't setup
    CPUs with bad status" broke ePAPR SMP booting.  ePAPR says that CPUs
    that aren't presently running shall have status of disabled, with
    enable-method being used to determine whether the CPU can be enabled.
    
    Fix by checking for spin-table, which is currently the only supported
    enable-method.
    
    Signed-off-by: Scott Wood <scottwood@freescale.com>
    Cc: Michael Neuling <mikey@neuling.org>
    Cc: Emil Medve <Emilian.Medve@Freescale.com>
    Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 9994e2c2687395f69e86e744f0143a9eb540df1e
Author: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date:   Tue Jun 10 15:04:40 2014 +1000

    powerpc: Add AT_HWCAP2 to indicate V.CRYPTO category support
    
    commit dd58a092c4202f2bd490adab7285b3ff77f8e467 upstream.
    
    The Vector Crypto category instructions are supported by current POWER8
    chips, advertise them to userspace using a specific bit to properly
    differentiate with chips of the same architecture level that might not
    have them.
    
    Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit c5aee1fa7700baa30a466e2b9deff50fc0ac0f03
Author: Michael Neuling <mikey@neuling.org>
Date:   Fri Jun 6 14:28:51 2014 +1000

    powerpc: Don't setup CPUs with bad status
    
    commit 59a53afe70fd530040bdc69581f03d880157f15a upstream.
    
    OPAL will mark a CPU that is guarded as "bad" in the status property of the CPU
    node.
    
    Unfortunatley Linux doesn't check this property and will put the bad CPU in the
    present map.  This has caused hangs on booting when we try to unsplit the core.
    
    This patch checks the CPU is avaliable via this status property before putting
    it in the present map.
    
    Signed-off-by: Michael Neuling <mikey@neuling.org>
    Tested-by: Anton Blanchard <anton@samba.org>
    Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 2d16f738d166d803551e805d346b7204d1ba82a4
Author: Paul Bolle <pebolle@tiscali.nl>
Date:   Tue May 20 21:59:42 2014 +0200

    powerpc: fix typo 'CONFIG_PPC_CPU'
    
    commit b69a1da94f3d1589d1942b5d1b384d8cfaac4500 upstream.
    
    Commit cd64d1697cf0 ("powerpc: mtmsrd not defined") added a check for
    CONFIG_PPC_CPU were a check for CONFIG_PPC_FPU was clearly intended.
    
    Fixes: cd64d1697cf0 ("powerpc: mtmsrd not defined")
    Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
    Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 58da9b2550867775c2a15def4f3b177305afde33
Author: Michael Ellerman <mpe@ellerman.id.au>
Date:   Tue Jun 10 16:46:21 2014 +1000

    powerpc/perf: Ensure all EBB register state is cleared on fork()
    
    commit 3df48c981d5a9610e02e9270b1bc4274fb536710 upstream.
    
    In commit 330a1eb "Core EBB support for 64-bit book3s" I messed up
    clear_task_ebb(). It clears some but not all of the task's Event Based
    Branch (EBB) registers when we duplicate a task struct.
    
    That allows a child task to observe the EBBHR & EBBRR of its parent,
    which it should not be able to do.
    
    Fix it by clearing EBBHR & EBBRR.
    
    Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
    Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 10645ebc2ce2add8add218e8e360fd699ce60264
Author: Paul Bolle <pebolle@tiscali.nl>
Date:   Tue May 20 22:24:58 2014 +0200

    powerpc: fix typo 'CONFIG_PMAC'
    
    commit 6e0fdf9af216887e0032c19d276889aad41cad00 upstream.
    
    Commit b0d278b7d3ae ("powerpc/perf_event: Reduce latency of calling
    perf_event_do_pending") added a check for CONFIG_PMAC were a check for
    CONFIG_PPC_PMAC was clearly intended.
    
    Fixes: b0d278b7d3ae ("powerpc/perf_event: Reduce latency of calling perf_event_do_pending")
    Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
    Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit c3043360563dc5e2c10ba688ea5338e0696015a1
Author: Anton Blanchard <anton@samba.org>
Date:   Wed Jun 4 10:48:48 2014 +1000

    powerpc: 64bit sendfile is capped at 2GB
    
    commit 5d73320a96fcce80286f1447864c481b5f0b96fa upstream.
    
    commit 8f9c0119d7ba (compat: fs: Generic compat_sys_sendfile
    implementation) changed the PowerPC 64bit sendfile call from
    sys_sendile64 to sys_sendfile.
    
    Unfortunately this broke sendfile of lengths greater than 2G because
    sys_sendfile caps at MAX_NON_LFS. Restore what we had previously which
    fixes the bug.
    
    Signed-off-by: Anton Blanchard <anton@samba.org>
    Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 0c35d0ca33a7acb458a4cddc5897f4248e3ae317
Author: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date:   Tue Jun 3 17:33:41 2014 +1000

    powerpc/serial: Use saner flags when creating legacy ports
    
    commit c4cad90f9e9dcb85afc5e75a02ae3522ed077296 upstream.
    
    We had a mix & match of flags used when creating legacy ports
    depending on where we found them in the device-tree. Among others
    we were missing UPF_SKIP_TEST for some kind of ISA ports which is
    a problem as quite a few UARTs out there don't support the loopback
    test (such as a lot of BMCs).
    
    Let's pick the set of flags used by the SoC code and generalize it
    which means autoconf, no loopback test, irq maybe shared and fixed
    port.
    
    Sending to stable as the lack of UPF_SKIP_TEST is breaking
    serial on some machines so I want this back into distros
    
    Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 0ddc881b680a5e71352003e1777ca79ea9ff0f21
Author: Michael Ellerman <mpe@ellerman.id.au>
Date:   Wed May 28 18:21:17 2014 +1000

    powerpc/mm: Check paca psize is up to date for huge mappings
    
    commit 09567e7fd44291bfc08accfdd67ad8f467842332 upstream.
    
    We have a bug in our hugepage handling which exhibits as an infinite
    loop of hash faults. If the fault is being taken in the kernel it will
    typically trigger the softlockup detector, or the RCU stall detector.
    
    The bug is as follows:
    
     1. mmap(0xa0000000, ..., MAP_FIXED | MAP_HUGE_TLB | MAP_ANONYMOUS ..)
     2. Slice code converts the slice psize to 16M.
     3. The code on lines 539-540 of slice.c in slice_get_unmapped_area()
        synchronises the mm->context with the paca->context. So the paca slice
        mask is updated to include the 16M slice.
     3. Either:
        * mmap() fails because there are no huge pages available.
        * mmap() succeeds and the mapping is then munmapped.
        In both cases the slice psize remains at 16M in both the paca & mm.
     4. mmap(0xa0000000, ..., MAP_FIXED | MAP_ANONYMOUS ..)
     5. The slice psize is converted back to 64K. Because of the check on line 539
        of slice.c we DO NOT update the paca->context. The paca slice mask is now
        out of sync with the mm slice mask.
     6. User/kernel accesses 0xa0000000.
     7. The SLB miss handler slb_allocate_realmode() **uses the paca slice mask**
        to create an SLB entry and inserts it in the SLB.
    18. With the 16M SLB entry in place the hardware does a hash lookup, no entry
        is found so a data access exception is generated.
    19. The data access handler calls do_page_fault() -> handle_mm_fault().
    10. __handle_mm_fault() creates a THP mapping with do_huge_pmd_anonymous_page().
    11. The hardware retries the access, there is still nothing in the hash table
        so once again a data access exception is generated.
    12. hash_page() calls into __hash_page_thp() and inserts a mapping in the
        hash. Although the THP mapping maps 16M the hashing is done using 64K
        as the segment page size.
    13. hash_page() returns immediately after calling __hash_page_thp(), skipping
        over the code at line 1125. Resulting in the mismatch between the
        paca->context and mm->context not being detected.
    14. The hardware retries the access, the hash it generates using the 16M
        SLB entry does NOT match the hash we inserted.
    15. We take another data access and go into __hash_page_thp().
    16. We see a valid entry in the hpte_slot_array and so we call updatepp()
        which succeeds.
    17. Goto 14.
    
    We could fix this in two ways. The first would be to remove or modify
    the check on line 539 of slice.c.
    
    The second option is to cause the check of paca psize in hash_page() on
    line 1125 to also be done for THP pages.
    
    We prefer the latter, because the check & update of the paca psize is
    not done until we know it's necessary. It's also done only on the
    current cpu, so we don't need to IPI all other cpus.
    
    Without further rearranging the code, the simplest fix is to pull out
    the code that checks paca psize and call it in two places. Firstly for
    THP/hugetlb, and secondly for other mappings as before.
    
    Thanks to Dave Jones for trinity, which originally found this bug.
    
    Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
    Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
    Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit a27d1641371ea6599a7ff6cba8373d567a02ecb6
Author: Gavin Shan <gwshan@linux.vnet.ibm.com>
Date:   Thu Apr 24 18:00:21 2014 +1000

    powerpc/pseries: Fix overwritten PE state
    
    commit 54f112a3837d4e7532bbedbbbf27c0de277be510 upstream.
    
    In pseries_eeh_get_state(), EEH_STATE_UNAVAILABLE is always
    overwritten by EEH_STATE_NOT_SUPPORT because of the missed
    "break" there. The patch fixes the issue.
    
    Reported-by: Joe Perches <joe@perches.com>
    Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
    Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit b7c3aabcc089fcf599e08225cca4b53fa273c3c7
Author: Scott Mayhew <smayhew@redhat.com>
Date:   Fri Jun 20 08:44:42 2014 -0400

    nfs: Fix cache_validity check in nfs_write_pageuptodate()
    
    commit 18dd78c427513fb0f89365138be66e6ee8700d1b upstream.
    
    NFS_INO_INVALID_DATA cannot be ignored, even if we have a delegation.
    
    We're still having some problems with data corruption when multiple
    clients are appending to a file and those clients are being granted
    write delegations on open.
    
    To reproduce:
    
    Client A:
    vi /mnt/`hostname -s`
    while :; do echo "XXXXXXXXXXXXXXX" >>/mnt/file; sleep $(( $RANDOM % 5 )); done
    
    Client B:
    vi /mnt/`hostname -s`
    while :; do echo "YYYYYYYYYYYYYYY" >>/mnt/file; sleep $(( $RANDOM % 5 )); done
    
    What's happening is that in nfs_update_inode() we're recognizing that
    the file size has changed and we're setting NFS_INO_INVALID_DATA
    accordingly, but then we ignore the cache_validity flags in
    nfs_write_pageuptodate() because we have a delegation.  As a result,
    in nfs_updatepage() we're extending the write to cover the full page
    even though we've not read in the data to begin with.
    
    Signed-off-by: Scott Mayhew <smayhew@redhat.com>
    Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 708fc7633ef80d411ab112d2ec64dd5826c9863a
Author: Mateusz Guzik <mguzik@redhat.com>
Date:   Tue Jun 10 12:44:12 2014 +0200

    NFS: populate ->net in mount data when remounting
    
    commit a914722f333b3359d2f4f12919380a334176bb89 upstream.
    
    Otherwise the kernel oopses when remounting with IPv6 server because
    net is dereferenced in dev_get_by_name.
    
    Use net ns of current thread so that dev_get_by_name does not operate on
    foreign ns. Changing the address is prohibited anyway so this should not
    affect anything.
    
    Signed-off-by: Mateusz Guzik <mguzik@redhat.com>
    Cc: linux-nfs@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 9b8a9bf75003800ba4143b8b6c53bb41e57d00f9
Author: Trond Myklebust <trond.myklebust@primarydata.com>
Date:   Tue Apr 15 10:07:57 2014 -0400

    NFS: Don't declare inode uptodate unless all attributes were checked
    
    commit 43b6535e717d2f656f71d9bd16022136b781c934 upstream.
    
    Fix a bug, whereby nfs_update_inode() was declaring the inode to be
    up to date despite not having checked all the attributes.
    The bug occurs because the temporary variable in which we cache
    the validity information is 'sanitised' before reapplying to
    nfsi->cache_validity.
    
    Reported-by: Kinglong Mee <kinglongmee@gmail.com>
    Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 27b695cbbf2c3fabd4e29511521c469e62eb7b74
Author: Christoph Hellwig <hch@lst.de>
Date:   Wed May 28 10:46:13 2014 +0200

    nfsd: getattr for FATTR4_WORD0_FILES_AVAIL needs the statfs buffer
    
    commit 12337901d654415d9f764b5f5ba50052e9700f37 upstream.
    
    Note nobody's ever noticed because the typical client probably never
    requests FILES_AVAIL without also requesting something else on the list.
    
    Signed-off-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: J. Bruce Fields <bfields@redhat.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 803e56e270ff2d90a2bf144e9c5b237e83f9f341
Author: Trond Myklebust <trond.myklebust@primarydata.com>
Date:   Thu May 29 20:06:55 2014 -0400

    pNFS: Handle allocation errors correctly in filelayout_alloc_layout_hdr()
    
    commit 6df200f5d5191bdde4d2e408215383890f956781 upstream.
    
    Return the NULL pointer when the allocation fails.
    
    Reported-by: Fengguang Wu <fengguang.wu@intel.com>
    Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit be03560faf3cfd894fd783dd8f098a8c4a4be4cb
Author: Trond Myklebust <trond.myklebust@primarydata.com>
Date:   Sun May 18 14:05:22 2014 -0400

    SUNRPC: Fix a module reference leak in svc_handle_xprt
    
    commit c789102c20bbbdda6831a273e046715be9d6af79 upstream.
    
    If the accept() call fails, we need to put the module reference.
    
    Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
    Signed-off-by: J. Bruce Fields <bfields@redhat.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 45c5cf39b192acc22d45fe1076e2ecf212376457
Author: Bart Van Assche <bvanassche@acm.org>
Date:   Fri Jun 6 18:25:04 2014 +0200

    IB/umad: Fix use-after-free on close
    
    commit 60e1751cb52cc6d1ae04b6bd3c2b96e770b5823f upstream.
    
    Avoid that closing /dev/infiniband/umad<n> or /dev/infiniband/issm<n>
    triggers a use-after-free.  __fput() invokes f_op->release() before it
    invokes cdev_put().  Make sure that the ib_umad_device structure is
    freed by the cdev_put() call instead of f_op->release().  This avoids
    that changing the port mode from IB into Ethernet and back to IB
    followed by restarting opensmd triggers the following kernel oops:
    
        general protection fault: 0000 [#1] PREEMPT SMP
        RIP: 0010:[<ffffffff810cc65c>]  [<ffffffff810cc65c>] module_put+0x2c/0x170
        Call Trace:
         [<ffffffff81190f20>] cdev_put+0x20/0x30
         [<ffffffff8118e2ce>] __fput+0x1ae/0x1f0
         [<ffffffff8118e35e>] ____fput+0xe/0x10
         [<ffffffff810723bc>] task_work_run+0xac/0xe0
         [<ffffffff81002a9f>] do_notify_resume+0x9f/0xc0
         [<ffffffff814b8398>] int_signal+0x12/0x17
    
    Reference: https://bugzilla.kernel.org/show_bug.cgi?id=75051
    Signed-off-by: Bart Van Assche <bvanassche@acm.org>
    Reviewed-by: Yann Droneaud <ydroneaud@opteya.com>
    Signed-off-by: Roland Dreier <roland@purestorage.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 266b09f397670c5c10ae6aaea7d2b2fb873b4759
Author: Bart Van Assche <bvanassche@acm.org>
Date:   Tue May 20 10:33:41 2014 +0200

    IB/umad: Fix error handling
    
    commit 8ec0a0e6b58218bdc1db91dd70ebfcd6ad8dd6cd upstream.
    
    Avoid leaking a kref count in ib_umad_open() if port->ib_dev == NULL
    or if nonseekable_open() fails.
    
    Avoid leaking a kref count, that sm_sem is kept down and also that the
    IB_PORT_SM capability mask is not cleared in ib_umad_sm_open() if
    nonseekable_open() fails.
    
    Since container_of() never returns NULL, remove the code that tests
    whether container_of() returns NULL.
    
    Moving the kref_get() call from the start of ib_umad_*open() to the
    end is safe since it is the responsibility of the caller of these
    functions to ensure that the cdev pointer remains valid until at least
    when these functions return.
    
    Signed-off-by: Bart Van Assche <bvanassche@acm.org>
    
    [ydroneaud@opteya.com: rework a bit to reduce the amount of code changed]
    
    Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>
    
    [ nonseekable_open() can't actually fail, but....  - Roland ]
    
    Signed-off-by: Roland Dreier <roland@purestorage.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 237de203cc2ebaccc8c023fe9e2599bba967941a
Author: Bart Van Assche <bvanassche@acm.org>
Date:   Tue May 20 15:03:49 2014 +0200

    IB/srp: Fix a sporadic crash triggered by cable pulling
    
    commit 024ca90151f5e4296d30f72c13ff9a075e23c9ec upstream.
    
    Avoid that the loops that iterate over the request ring can encounter
    a pointer to a SCSI command in req->scmnd that is no longer associated
    with that request. If the function srp_unmap_data() is invoked twice
    for a SCSI command that is not in flight then that would cause
    ib_fmr_pool_unmap() to be invoked with an invalid pointer as argument,
    resulting in a kernel oops.
    
    Reported-by: Sagi Grimberg <sagig@mellanox.com>
    Reference: http://thread.gmane.org/gmane.linux.drivers.rdma/19068/focus=19069
    Signed-off-by: Bart Van Assche <bvanassche@acm.org>
    Reviewed-by: Sagi Grimberg <sagig@mellanox.com>
    Signed-off-by: Roland Dreier <roland@purestorage.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit aef0a9699424f94d75119862606a66b246d76572
Author: Dennis Dalessandro <dennis.dalessandro@intel.com>
Date:   Fri May 2 11:40:17 2014 -0400

    IB/ipath: Translate legacy diagpkt into newer extended diagpkt
    
    commit 7e6d3e5c70f13874fb06e6b67696ed90ce79bd48 upstream.
    
    This patch addresses an issue where the legacy diagpacket is sent in
    from the user, but the driver operates on only the extended
    diagpkt. This patch specifically initializes the extended diagpkt
    based on the legacy packet.
    
    Reported-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
    Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
    Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
    Signed-off-by: Roland Dreier <roland@purestorage.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 8bd7f7dad0838c11562fb1e0b5e4012da31ca805
Author: Mike Marciniszyn <mike.marciniszyn@intel.com>
Date:   Fri May 2 11:28:04 2014 -0400

    IB/qib: Fix port in pkey change event
    
    commit 911eccd284d13d78c92ec4f1f1092c03457d732a upstream.
    
    The code used a literal 1 in dispatching an IB_EVENT_PKEY_CHANGE.
    
    As of the dual port qib QDR card, this is not necessarily correct.
    
    Change to use the port as specified in the call.
    
    Reported-by: Alex Estrin <alex.estrin@intel.com>
    Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
    Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
    Signed-off-by: Roland Dreier <roland@purestorage.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 35d693c3e44aa97471f17439beda93c070fcb0de
Author: Yann Droneaud <ydroneaud@opteya.com>
Date:   Mon May 5 19:33:22 2014 +0200

    IB/mlx5: add missing padding at end of struct mlx5_ib_create_srq
    
    commit 43bc889380c2ad9aa230eccc03a15cc52cf710d4 upstream.
    
    The i386 ABI disagrees with most other ABIs regarding alignment of
    data type larger than 4 bytes: on most ABIs a padding must be added at
    end of the structures, while it is not required on i386.
    
    So for most ABIs struct mlx5_ib_create_srq gets implicitly padded to be
    aligned on a 8 bytes multiple, while for i386, such padding is not
    added.
    
    Tool pahole could be used to find such implicit padding:
    
      $ pahole --anon_include \
               --nested_anon_include \
               --recursive \
               --class_name mlx5_ib_create_srq \
               drivers/infiniband/hw/mlx5/mlx5_ib.o
    
    Then, structure layout can be compared between i386 and x86_64:
    
    #  +++ obj-i386/drivers/infiniband/hw/mlx5/mlx5_ib.o.pahole.txt    2014-03-28 11:43:07.386413682 +0100
    #  --- obj-x86_64/drivers/infiniband/hw/mlx5/mlx5_ib.o.pahole.txt  2014-03-27 13:06:17.788472721 +0100
    #  @@ -69,7 +68,6 @@ struct mlx5_ib_create_srq {
    #          __u64                      db_addr;              /*     8     8 */
    #          __u32                      flags;                /*    16     4 */
    #
    #  -       /* size: 20, cachelines: 1, members: 3 */
    #  -       /* last cacheline: 20 bytes */
    #  +       /* size: 24, cachelines: 1, members: 3 */
    #  +       /* padding: 4 */
    #  +       /* last cacheline: 24 bytes */
    #   };
    
    ABI disagreement will make an x86_64 kernel try to read past
    the buffer provided by an i386 binary.
    
    When boundary check will be implemented, the x86_64 kernel will
    refuse to read past the i386 userspace provided buffer and the
    uverb will fail.
    
    Anyway, if the structure lay in memory on a page boundary and
    next page is not mapped, ib_copy_from_udata() will fail and the
    uverb will fail.
    
    This patch makes create_srq_user() takes care of the input
    data size to handle the case where no padding was provided.
    
    This way, x86_64 kernel will be able to handle struct mlx5_ib_create_srq
    as sent by unpatched and patched i386 libmlx5.
    
    Link: http://marc.info/?i=cover.1399309513.git.ydroneaud@opteya.com
    Fixes: e126ba97dba9e ("mlx5: Add driver for Mellanox Connect-IB adapter")
    Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>
    Signed-off-by: Roland Dreier <roland@purestorage.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 52fbe34910b2eb98d4437404ef1add9942cec43c
Author: Yann Droneaud <ydroneaud@opteya.com>
Date:   Mon May 5 19:33:21 2014 +0200

    IB/mlx5: add missing padding at end of struct mlx5_ib_create_cq
    
    commit a8237b32a3faab155a5dc8f886452147ce73da3e upstream.
    
    The i386 ABI disagrees with most other ABIs regarding alignment of
    data type larger than 4 bytes: on most ABIs a padding must be added at
    end of the structures, while it is not required on i386.
    
    So for most ABI struct mlx5_ib_create_cq get padded to be aligned on a
    8 bytes multiple, while for i386, such padding is not added.
    
    The tool pahole can be used to find such implicit padding:
    
      $ pahole --anon_include \
      	 --nested_anon_include \
      	 --recursive \
      	 --class_name mlx5_ib_create_cq \
      	 drivers/infiniband/hw/mlx5/mlx5_ib.o
    
    Then, structure layout can be compared between i386 and x86_64:
    
    #  +++ obj-i386/drivers/infiniband/hw/mlx5/mlx5_ib.o.pahole.txt    2014-03-28 11:43:07.386413682 +0100
    #  --- obj-x86_64/drivers/infiniband/hw/mlx5/mlx5_ib.o.pahole.txt  2014-03-27 13:06:17.788472721 +0100
    #  @@ -34,9 +34,8 @@ struct mlx5_ib_create_cq {
    #          __u64                      db_addr;              /*     8     8 */
    #          __u32                      cqe_size;             /*    16     4 */
    #
    #  -       /* size: 20, cachelines: 1, members: 3 */
    #  -       /* last cacheline: 20 bytes */
    #  +       /* size: 24, cachelines: 1, members: 3 */
    #  +       /* padding: 4 */
    #  +       /* last cacheline: 24 bytes */
    #   };
    
    This ABI disagreement will make an x86_64 kernel try to read past the
    buffer provided by an i386 binary.
    
    When boundary check will be implemented, a x86_64 kernel will refuse
    to read past the i386 userspace provided buffer and the uverb will
    fail.
    
    Anyway, if the structure lies in memory on a page boundary and next
    page is not mapped, ib_copy_from_udata() will fail when trying to read
    the 4 bytes of padding and the uverb will fail.
    
    This patch makes create_cq_user() takes care of the input data size to
    handle the case where no padding is provided.
    
    This way, x86_64 kernel will be able to handle struct
    mlx5_ib_create_cq as sent by unpatched and patched i386 libmlx5.
    
    Link: http://marc.info/?i=cover.1399309513.git.ydroneaud@opteya.com
    Fixes: e126ba97dba9e ("mlx5: Add driver for Mellanox Connect-IB adapter")
    Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>
    Signed-off-by: Roland Dreier <roland@purestorage.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit ec03435f8102baf52e783b72d11359f8d31f3629
Author: gundberg <per.gundberg@icomera.com>
Date:   Thu Apr 24 15:49:19 2014 +0200

    watchdog: kempld-wdt: Use the correct value when configuring the prescaler with the watchdog
    
    commit a9e0436b303e94ba57d3bd4b1fcbeaa744b7ebeb upstream.
    
    Use the prescaler index, rather than its value, to configure the watchdog.
    This will prevent a mismatch with the prescaler used to calculate the cycles.
    
    Signed-off-by: Per Gundberg <per.gundberg@icomera.com>
    Reviewed-by: Guenter Roeck <linux@roeck-us.net>
    Reviewed-by: Michael Brunner <michael.brunner@kontron.com>
    Tested-by: Michael Brunner <michael.brunner@kontron.com>
    Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 17178d1a8770860f2ea6aa48413b77102e45edf9
Author: Gabor Juhos <juhosg@openwrt.org>
Date:   Wed Apr 16 11:34:41 2014 +0200

    watchdog: ath79_wdt: avoid spurious restarts on AR934x
    
    commit 23afeb613ec0e10aecfae7838a14d485db62ac52 upstream.
    
    On some AR934x based systems, where the frequency of
    the AHB bus is relatively high, the built-in watchdog
    causes a spurious restart when it gets enabled.
    
    The possible cause of these restarts is that the timeout
    value written into the TIMER register does not reaches
    the hardware in time.
    
    Add an explicit delay into the ath79_wdt_enable function
    to avoid the spurious restarts.
    
    Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
    Reviewed-by: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 3ffceee7c5ae8ccaf1ede159d8e3878be9c5c625
Author: Viresh Kumar <viresh.kumar@linaro.org>
Date:   Thu May 15 10:01:59 2014 +0530

    watchdog: sp805: Set watchdog_device->timeout from ->set_timeout()
    
    commit 938626d96a3ffb9eb54552bb0d3a4f2b30ffdeb0 upstream.
    
    Implementation of ->set_timeout() is supposed to set 'timeout' field of 'struct
    watchdog_device' passed to it. sp805 was rather setting this in a local
    variable. Fix it.
    
    Reported-by: Arun Ramamurthy <arun.ramamurthy@broadcom.com>
    Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
    Reviewed-by: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit c395e325c8bf59881fc68676ceed38c52b3051ea
Author: hujianyang <hujianyang@huawei.com>
Date:   Sat May 31 11:39:32 2014 +0800

    UBIFS: Remove incorrect assertion in shrink_tnc()
    
    commit 72abc8f4b4e8574318189886de627a2bfe6cd0da upstream.
    
    I hit the same assert failed as Dolev Raviv reported in Kernel v3.10
    shows like this:
    
    [ 9641.164028] UBIFS assert failed in shrink_tnc at 131 (pid 13297)
    [ 9641.234078] CPU: 1 PID: 13297 Comm: mmap.test Tainted: G           O 3.10.40 #1
    [ 9641.234116] [<c0011a6c>] (unwind_backtrace+0x0/0x12c) from [<c000d0b0>] (show_stack+0x20/0x24)
    [ 9641.234137] [<c000d0b0>] (show_stack+0x20/0x24) from [<c0311134>] (dump_stack+0x20/0x28)
    [ 9641.234188] [<c0311134>] (dump_stack+0x20/0x28) from [<bf22425c>] (shrink_tnc_trees+0x25c/0x350 [ubifs])
    [ 9641.234265] [<bf22425c>] (shrink_tnc_trees+0x25c/0x350 [ubifs]) from [<bf2245ac>] (ubifs_shrinker+0x25c/0x310 [ubifs])
    [ 9641.234307] [<bf2245ac>] (ubifs_shrinker+0x25c/0x310 [ubifs]) from [<c00cdad8>] (shrink_slab+0x1d4/0x2f8)
    [ 9641.234327] [<c00cdad8>] (shrink_slab+0x1d4/0x2f8) from [<c00d03d0>] (do_try_to_free_pages+0x300/0x544)
    [ 9641.234344] [<c00d03d0>] (do_try_to_free_pages+0x300/0x544) from [<c00d0a44>] (try_to_free_pages+0x2d0/0x398)
    [ 9641.234363] [<c00d0a44>] (try_to_free_pages+0x2d0/0x398) from [<c00c6a60>] (__alloc_pages_nodemask+0x494/0x7e8)
    [ 9641.234382] [<c00c6a60>] (__alloc_pages_nodemask+0x494/0x7e8) from [<c00f62d8>] (new_slab+0x78/0x238)
    [ 9641.234400] [<c00f62d8>] (new_slab+0x78/0x238) from [<c031081c>] (__slab_alloc.constprop.42+0x1a4/0x50c)
    [ 9641.234419] [<c031081c>] (__slab_alloc.constprop.42+0x1a4/0x50c) from [<c00f80e8>] (kmem_cache_alloc_trace+0x54/0x188)
    [ 9641.234459] [<c00f80e8>] (kmem_cache_alloc_trace+0x54/0x188) from [<bf227908>] (do_readpage+0x168/0x468 [ubifs])
    [ 9641.234553] [<bf227908>] (do_readpage+0x168/0x468 [ubifs]) from [<bf2296a0>] (ubifs_readpage+0x424/0x464 [ubifs])
    [ 9641.234606] [<bf2296a0>] (ubifs_readpage+0x424/0x464 [ubifs]) from [<c00c17c0>] (filemap_fault+0x304/0x418)
    [ 9641.234638] [<c00c17c0>] (filemap_fault+0x304/0x418) from [<c00de694>] (__do_fault+0xd4/0x530)
    [ 9641.234665] [<c00de694>] (__do_fault+0xd4/0x530) from [<c00e10c0>] (handle_pte_fault+0x480/0xf54)
    [ 9641.234690] [<c00e10c0>] (handle_pte_fault+0x480/0xf54) from [<c00e2bf8>] (handle_mm_fault+0x140/0x184)
    [ 9641.234716] [<c00e2bf8>] (handle_mm_fault+0x140/0x184) from [<c0316688>] (do_page_fault+0x150/0x3ac)
    [ 9641.234737] [<c0316688>] (do_page_fault+0x150/0x3ac) from [<c000842c>] (do_DataAbort+0x3c/0xa0)
    [ 9641.234759] [<c000842c>] (do_DataAbort+0x3c/0xa0) from [<c0314e38>] (__dabt_usr+0x38/0x40)
    
    After analyzing the code, I found a condition that may cause this failed
    in correct operations. Thus, I think this assertion is wrong and should be
    removed.
    
    Suppose there are two clean znodes and one dirty znode in TNC. So the
    per-filesystem atomic_t @clean_zn_cnt is (2). If commit start, dirty_znode
    is set to COW_ZNODE in get_znodes_to_commit() in case of potentially ops
    on this znode. We clear COW bit and DIRTY bit in write_index() without
    @tnc_mutex locked. We don't increase @clean_zn_cnt in this place. As the
    comments in write_index() shows, if another process hold @tnc_mutex and
    dirty this znode after we clean it, @clean_zn_cnt would be decreased to (1).
    We will increase @clean_zn_cnt to (2) with @tnc_mutex locked in
    free_obsolete_znodes() to keep it right.
    
    If shrink_tnc() performs between decrease and increase, it will release
    other 2 clean znodes it holds and found @clean_zn_cnt is less than zero
    (1 - 2 = -1), then hit the assertion. Because free_obsolete_znodes() will
    soon correct @clean_zn_cnt and no harm to fs in this case, I think this
    assertion could be removed.
    
    2 clean zondes and 1 dirty znode, @clean_zn_cnt == 2
    
    Thread A (commit)         Thread B (write or others)       Thread C (shrinker)
    ->write_index
       ->clear_bit(DIRTY_NODE)
       ->clear_bit(COW_ZNODE)
    
                @clean_zn_cnt == 2
                              ->mutex_locked(&tnc_mutex)
                              ->dirty_cow_znode
                                  ->!ubifs_zn_cow(znode)
                                  ->!test_and_set_bit(DIRTY_NODE)
                                  ->atomic_dec(&clean_zn_cnt)
                              ->mutex_unlocked(&tnc_mutex)
    
                @clean_zn_cnt == 1
                                                               ->mutex_locked(&tnc_mutex)
                                                               ->shrink_tnc
                                                                 ->destroy_tnc_subtree
                                                                 ->atomic_sub(&clean_zn_cnt, 2)
                                                                 ->ubifs_assert  <- hit
                                                               ->mutex_unlocked(&tnc_mutex)
    
                @clean_zn_cnt == -1
    ->mutex_lock(&tnc_mutex)
    ->free_obsolete_znodes
       ->atomic_inc(&clean_zn_cnt)
    ->mutux_unlock(&tnc_mutex)
    
                @clean_zn_cnt == 0 (correct after shrink)
    
    Signed-off-by: hujianyang <hujianyang@huawei.com>
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 9724ace0cc02e44fa5247a5924aefd24f7c1a72c
Author: hujianyang <hujianyang@huawei.com>
Date:   Wed Apr 30 14:06:06 2014 +0800

    UBIFS: fix an mmap and fsync race condition
    
    commit 691a7c6f28ac90cccd0dbcf81348ea90b211bdd0 upstream.
    
    There is a race condition in UBIFS:
    
    Thread A (mmap)                        Thread B (fsync)
    
    ->__do_fault                           ->write_cache_pages
       -> ubifs_vm_page_mkwrite
           -> budget_space
           -> lock_page
           -> release/convert_page_budget
           -> SetPagePrivate
           -> TestSetPageDirty
           -> unlock_page
                                           -> lock_page
                                               -> TestClearPageDirty
                                               -> ubifs_writepage
                                                   -> do_writepage
                                                       -> release_budget
                                                       -> ClearPagePrivate
                                                       -> unlock_page
       -> !(ret & VM_FAULT_LOCKED)
       -> lock_page
       -> set_page_dirty
           -> ubifs_set_page_dirty
               -> TestSetPageDirty (set page dirty without budgeting)
       -> unlock_page
    
    This leads to situation where we have a diry page but no budget allocated for
    this page, so further write-back may fail with -ENOSPC.
    
    In this fix we return from page_mkwrite without performing unlock_page. We
    return VM_FAULT_LOCKED instead. After doing this, the race above will not
    happen.
    
    Signed-off-by: hujianyang <hujianyang@huawei.com>
    Tested-by: Laurence Withers <lwithers@guralp.com>
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 8acb1c84456884115a0e7a8d077a88d074d79d20
Author: Markos Chandras <markos.chandras@imgtec.com>
Date:   Mon Jun 23 09:48:51 2014 +0100

    MIPS: MSC: Prevent out-of-bounds writes to MIPS SC ioremap'd region
    
    commit ab6c15bc6620ebe220970cc040b29bcb2757f373 upstream.
    
    Previously, the lower limit for the MIPS SC initialization loop was
    set incorrectly allowing one extra loop leading to writes
    beyond the MSC ioremap'd space. More precisely, the value of the 'imp'
    in the last loop increased beyond the msc_irqmap_t boundaries and
    as a result of which, the 'n' variable was loaded with an incorrect
    value. This value was used later on to calculate the offset in the
    MSC01_IC_SUP which led to random crashes like the following one:
    
    CPU 0 Unable to handle kernel paging request at virtual address e75c0200,
    epc == 8058dba4, ra == 8058db90
    [...]
    Call Trace:
    [<8058dba4>] init_msc_irqs+0x104/0x154
    [<8058b5bc>] arch_init_irq+0xd8/0x154
    [<805897b0>] start_kernel+0x220/0x36c
    
    Kernel panic - not syncing: Attempted to kill the idle task!
    
    This patch fixes the problem
    
    Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
    Reviewed-by: James Hogan <james.hogan@imgtec.com>
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/7118/
    Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 98eab24734a44d94e8ae53d8486c8e1751bccd8e
Author: Alex Smith <alex.smith@imgtec.com>
Date:   Tue Jun 17 10:39:53 2014 +0100

    recordmcount/MIPS: Fix possible incorrect mcount_loc table entries in modules
    
    commit 91ad11d7cc6f4472ebf177a6252fbf0fd100d798 upstream.
    
    On MIPS calls to _mcount in modules generate 2 instructions to load
    the _mcount address (and therefore 2 relocations). The mcount_loc
    table should only reference the first of these, so the second is
    filtered out by checking the relocation offset and ignoring ones that
    immediately follow the previous one seen.
    
    However if a module has an _mcount call at offset 0, the second
    relocation would not be filtered out due to old_r_offset == 0
    being taken to mean that the current relocation is the first one
    seen, and both would end up in the mcount_loc table.
    
    This results in ftrace_make_nop() patching both (adjacent)
    instructions to branches over the _mcount call sequence like so:
    
      0xffffffffc08a8000:  04 00 00 10     b       0xffffffffc08a8014
      0xffffffffc08a8004:  04 00 00 10     b       0xffffffffc08a8018
      0xffffffffc08a8008:  2d 08 e0 03     move    at,ra
      ...
    
    The second branch is in the delay slot of the first, which is
    defined to be unpredictable - on the platform on which this bug was
    encountered, it triggers a reserved instruction exception.
    
    Fix by initializing old_r_offset to ~0 and using that instead of 0
    to determine whether the current relocation is the first seen.
    
    Signed-off-by: Alex Smith <alex.smith@imgtec.com>
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/7098/
    Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 99579b19a034c87f814f9243434c2974cdde3e48
Author: Asai Thambi S P <asamymuthupa@micron.com>
Date:   Wed Apr 16 20:30:16 2014 -0700

    mtip32xx: Remove dfs_parent after pci unregister
    
    commit af5ded8ccf21627f9614afc03b356712666ed225 upstream.
    
    In module exit, dfs_parent and it's subtree were removed before
    unregistering with pci. When debugfs entry for each device is attempted
    to remove in pci_remove() context, they don't exist, as dfs_parent and
    its children were already ripped apart.
    
    Modified to first unregister with pci and then remove dfs_parent.
    
    Signed-off-by: Asai Thambi S P <asamymuthupa@micron.com>
    Signed-off-by: Jens Axboe <axboe@fb.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit a44da38f73befbd7889c81049b5c6a1143ec8402
Author: Asai Thambi S P <asamymuthupa@micron.com>
Date:   Wed Apr 16 20:27:54 2014 -0700

    mtip32xx: Increase timeout for STANDBY IMMEDIATE command
    
    commit 670a641420a3d9586eebe7429dfeec4e7ed447aa upstream.
    
    Increased timeout for STANDBY IMMEDIATE command to 2 minutes.
    
    Signed-off-by: Selvan Mani <smani@micron.com>
    Signed-off-by: Asai Thambi S P <asamymuthupa@micron.com>
    Signed-off-by: Jens Axboe <axboe@fb.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 0522e9243cd04bbcdf5e54b93666a04c9d191550
Author: Asai Thambi S P <asamymuthupa@micron.com>
Date:   Thu Mar 13 18:45:15 2014 -0700

    mtip32xx: Fix ERO and NoSnoop values in PCIe upstream on AMD systems
    
    commit d1e714db8129a1d3670e449b87719c78e2c76f9f upstream.
    
    A hardware quirk in P320h/P420m interfere with PCIe transactions on some
    AMD chipsets, making P320h/P420m unusable. This workaround is to disable
    ERO and NoSnoop bits in the parent and root complex for normal
    functioning of these devices
    
    NOTE: This workaround is specific to AMD chipset with a PCIe upstream
    device with device id 0x5aXX
    
    Signed-off-by: Asai Thambi S P <asamymuthupa@micron.com>
    Signed-off-by: Sam Bradshaw <sbradshaw@micron.com>
    Signed-off-by: Jens Axboe <axboe@fb.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 7e24fdf73b7c921f98b3137b95fe33d99c0da840
Author: Bjorn Helgaas <bhelgaas@google.com>
Date:   Sat Apr 5 15:14:22 2014 -0600

    PCI: Fix incorrect vgaarb conditional in WARN_ON()
    
    commit 67ebd8140dc8923c65451fa0f6a8eee003c4dcd3 upstream.
    
    3448a19da479 "vgaarb: use bridges to control VGA routing where possible"
    added the "flags & PCI_VGA_STATE_CHANGE_DECODES" condition to an existing
    WARN_ON(), but used bitwise AND (&) instead of logical AND (&&), so the
    condition is never true.  Replace with logical AND.
    
    Found by Coverity (CID 142811).
    
    Fixes: 3448a19da479 "vgaarb: use bridges to control VGA routing where possible"
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
    Acked-by: Yinghai Lu <yinghai@kernel.org>
    Acked-by: David Airlie <airlied@redhat.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 4ed86cf3d86c5a2f6c69450426b26955a00ad14c
Author: Thomas Jarosch <thomas.jarosch@intra2net.com>
Date:   Mon Apr 7 15:10:32 2014 +0200

    PCI: Add new ID for Intel GPU "spurious interrupt" quirk
    
    commit 7c82126a94e69bbbac586f0249e7ef11e681246c upstream.
    
    After a CPU upgrade while keeping the same mainboard, we faced "spurious
    interrupt" problems again.
    
    It turned out that the new CPU also featured a new GPU with a different PCI
    ID.
    
    Add this PCI ID to the quirk table.  Probably all other Intel GPU PCI IDs
    are affected, too, but I don't want to add them without a test system.
    
    See f67fd55fa96f ("PCI: Add quirk for still enabled interrupts on Intel
    Sandy Bridge GPUs") for some history.
    
    [bhelgaas: add f67fd55fa96f reference, stable tag]
    Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 98cd9c0a1313779a90bde789e464f75ab6e49800
Author: Hans de Goede <hdegoede@redhat.com>
Date:   Sat Jun 7 23:07:13 2014 -0700

    Input: elantech - don't set bit 1 of reg_10 when the no_hw_res quirk is set
    
    commit fb4f8f568a9def02240ef9bf7aabd246dc63a081 upstream.
    
    The touchpad on the GIGABYTE U2442 not only stops communicating when we try
    to set bit 3 (enable real hardware resolution) of reg_10, but on some BIOS
    versions also when we set bit 1 (enable two finger mode auto correct).
    
    I've asked the original reporter of:
    https://bugzilla.kernel.org/show_bug.cgi?id=61151
    
    To check that not setting bit 1 does not lead to any adverse effects on his
    model / BIOS revision, and it does not, so this commit fixes the touchpad
    not working on these versions by simply never setting bit 1 for laptop
    models with the no_hw_res quirk.
    
    Reported-and-tested-by: James Lademann <jwlademann@gmail.com>
    Tested-by: Philipp Wolfer <ph.wolfer@gmail.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 56f9d41164c04546995e1174a6d5b4ef22f50cd2
Author: Hans de Goede <hdegoede@redhat.com>
Date:   Sat Jun 7 22:35:07 2014 -0700

    Input: elantech - deal with clickpads reporting right button events
    
    commit cd9e83e2754465856097f31c7ab933ce74c473f8 upstream.
    
    At least the Dell Vostro 5470 elantech *clickpad* reports right button
    clicks when clicked in the right bottom area:
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1103528
    
    This is different from how (elantech) clickpads normally operate, normally
    no matter where the user clicks on the pad the pad always reports a left
    button event, since there is only 1 hardware button beneath the path.
    
    It looks like Dell has put 2 buttons under the pad, one under each bottom
    corner, causing this.
    
    Since this however still clearly is a real clickpad hardware-wise, we still
    want to report it as such to userspace, so that things like finger movement
    in the bottom area can be properly ignored as it should be on clickpads.
    
    So deal with this weirdness by simply mapping a right click to a left click
    on elantech clickpads. As an added advantage this is something which we can
    simply do on all elantech clickpads, so no need to add special quirks for
    this weird model.
    
    Reported-and-tested-by: Elder Marco <eldermarco@gmail.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit fbdaec25419c5029987904a83d49e53e6c4dd870
Author: Mikulas Patocka <mpatocka@redhat.com>
Date:   Mon Jun 23 13:42:37 2014 -0400

    iscsi-target: fix iscsit_del_np deadlock on unload
    
    commit 81a9c5e72bdf7109a65102ca61d8cbd722cf4021 upstream.
    
    On uniprocessor preemptible kernel, target core deadlocks on unload. The
    following events happen:
    * iscsit_del_np is called
    * it calls send_sig(SIGINT, np->np_thread, 1);
    * the scheduler switches to the np_thread
    * the np_thread is woken up, it sees that kthread_should_stop() returns
      false, so it doesn't terminate
    * the np_thread clears signals with flush_signals(current); and goes back
      to sleep in iscsit_accept_np
    * the scheduler switches back to iscsit_del_np
    * iscsit_del_np calls kthread_stop(np->np_thread);
    * the np_thread is waiting in iscsit_accept_np and it doesn't respond to
      kthread_stop
    
    The deadlock could be resolved if the administrator sends SIGINT signal to
    the np_thread with killall -INT iscsi_np
    
    The reproducible deadlock was introduced in commit
    db6077fd0b7dd41dc6ff18329cec979379071f87, but the thread-stopping code was
    racy even before.
    
    This patch fixes the problem. Using kthread_should_stop to stop the
    np_thread is unreliable, so we test np_thread_state instead. If
    np_thread_state equals ISCSI_NP_THREAD_SHUTDOWN, the thread exits.
    
    Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit c411d69a1d72adbc882373daa209952210e97bbd
Author: Nicholas Bellinger <nab@linux-iscsi.org>
Date:   Tue Jun 17 21:54:38 2014 +0000

    iscsi-target: Explicily clear login response PDU in exception path
    
    commit 683497566d48f86e04d026de1ee658dd74fc1077 upstream.
    
    This patch adds a explicit memset to the login response PDU
    exception path in iscsit_tx_login_rsp().
    
    This addresses a regression bug introduced in commit baa4d64b
    where the initiator would end up not receiving the login
    response and associated status class + detail, before closing
    the login connection.
    
    Reported-by: Christophe Vu-Brugier <cvubrugier@yahoo.fr>
    Tested-by: Christophe Vu-Brugier <cvubrugier@yahoo.fr>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit aec80fa7f28ed7e28e1799aac6a25ad31f51d1d4
Author: Nicholas Bellinger <nab@linux-iscsi.org>
Date:   Fri Jun 20 10:59:57 2014 -0700

    iscsi-target: Avoid rejecting incorrect ITT for Data-Out
    
    commit 97c99b47ac58bacb7c09e1f47d5d184434f6b06a upstream.
    
    This patch changes iscsit_check_dataout_hdr() to dump the incoming
    Data-Out payload when the received ITT is not associated with a
    WRITE, instead of calling iscsit_reject_cmd() for the non WRITE
    ITT descriptor.
    
    This addresses a bug where an initiator sending an Data-Out for
    an ITT associated with a READ would end up generating a reject
    for the READ, eventually resulting in list corruption.
    
    Reported-by: Santosh Kulkarni <santosh.kulkarni@calsoftinc.com>
    Reported-by: Arshad Hussain <arshad.hussain@calsoftinc.com>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 659489c914e8f1c88a453f8b91134dab58cdf8b6
Author: Nicholas Bellinger <nab@linux-iscsi.org>
Date:   Mon Jun 16 20:25:54 2014 +0000

    target: Fix left-over se_lun->lun_sep pointer OOPs
    
    commit 83ff42fcce070801a3aa1cd6a3269d7426271a8d upstream.
    
    This patch fixes a left-over se_lun->lun_sep pointer OOPs when one
    of the /sys/kernel/config/target/$FABRIC/$WWPN/$TPGT/lun/$LUN/alua*
    attributes is accessed after the $DEVICE symlink has been removed.
    
    To address this bug, go ahead and clear se_lun->lun_sep memory in
    core_dev_unexport(), so that the existing checks for show/store
    ALUA attributes in target_core_fabric_configfs.c work as expected.
    
    Reported-by: Sebastian Herbszt <herbszt@gmx.de>
    Tested-by: Sebastian Herbszt <herbszt@gmx.de>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 0c57bb135d3cc97273d7dd8c58d6dbb6b0078cc3
Author: Thomas Gleixner <tglx@linutronix.de>
Date:   Mon Jul 7 16:56:37 2014 +0200

    rtmutex: Plug slow unlock race
    
    commit 27e35715df54cbc4f2d044f681802ae30479e7fb upstream.
    
    When the rtmutex fast path is enabled the slow unlock function can
    create the following situation:
    
    spin_lock(foo->m->wait_lock);
    foo->m->owner = NULL;
    	    			rt_mutex_lock(foo->m); <-- fast path
    				free = atomic_dec_and_test(foo->refcnt);
    				rt_mutex_unlock(foo->m); <-- fast path
    				if (free)
    				   kfree(foo);
    
    spin_unlock(foo->m->wait_lock); <--- Use after free.
    
    Plug the race by changing the slow unlock to the following scheme:
    
         while (!rt_mutex_has_waiters(m)) {
         	    /* Clear the waiters bit in m->owner */
    	    clear_rt_mutex_waiters(m);
          	    owner = rt_mutex_owner(m);
          	    spin_unlock(m->wait_lock);
          	    if (cmpxchg(m->owner, owner, 0) == owner)
          	       return;
          	    spin_lock(m->wait_lock);
         }
    
    So in case of a new waiter incoming while the owner tries the slow
    path unlock we have two situations:
    
     unlock(wait_lock);
    					lock(wait_lock);
     cmpxchg(p, owner, 0) == owner
     	    	   			mark_rt_mutex_waiters(lock);
    	 				acquire(lock);
    
    Or:
    
     unlock(wait_lock);
    					lock(wait_lock);
    	 				mark_rt_mutex_waiters(lock);
     cmpxchg(p, owner, 0) != owner
    					enqueue_waiter();
    					unlock(wait_lock);
     lock(wait_lock);
     wakeup_next waiter();
     unlock(wait_lock);
    					lock(wait_lock);
    					acquire(lock);
    
    If the fast path is disabled, then the simple
    
       m->owner = NULL;
       unlock(m->wait_lock);
    
    is sufficient as all access to m->owner is serialized via
    m->wait_lock;
    
    Also document and clarify the wakeup_next_waiter function as suggested
    by Oleg Nesterov.
    
    Reported-by: Steven Rostedt <rostedt@goodmis.org>
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Reviewed-by: Steven Rostedt <rostedt@goodmis.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Link: http://lkml.kernel.org/r/20140611183852.937945560@linutronix.de
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: Mike Galbraith <umgwanakikbuti@gmail.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit a2e64fcdc83c645813f7b93e4df291841ba7c625
Author: Thomas Gleixner <tglx@linutronix.de>
Date:   Mon Jul 7 16:56:28 2014 +0200

    rtmutex: Handle deadlock detection smarter
    
    commit 3d5c9340d1949733eb37616abd15db36aef9a57c upstream.
    
    Even in the case when deadlock detection is not requested by the
    caller, we can detect deadlocks. Right now the code stops the lock
    chain walk and keeps the waiter enqueued, even on itself. Silly not to
    yell when such a scenario is detected and to keep the waiter enqueued.
    
    Return -EDEADLK unconditionally and handle it at the call sites.
    
    The futex calls return -EDEADLK. The non futex ones dequeue the
    waiter, throw a warning and put the task into a schedule loop.
    
    Tagged for stable as it makes the code more robust.
    
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Brad Mouring <bmouring@ni.com>
    Link: http://lkml.kernel.org/r/20140605152801.836501969@linutronix.de
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: Mike Galbraith <umgwanakikbuti@gmail.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 7ae4100dfa6e14122dfe684fd324954ada793d65
Author: Thomas Gleixner <tglx@linutronix.de>
Date:   Mon Jul 7 16:56:17 2014 +0200

    rtmutex: Detect changes in the pi lock chain
    
    commit 82084984383babe728e6e3c9a8e5c46278091315 upstream.
    
    When we walk the lock chain, we drop all locks after each step. So the
    lock chain can change under us before we reacquire the locks. That's
    harmless in principle as we just follow the wrong lock path. But it
    can lead to a false positive in the dead lock detection logic:
    
    T0 holds L0
    T0 blocks on L1 held by T1
    T1 blocks on L2 held by T2
    T2 blocks on L3 held by T3
    T4 blocks on L4 held by T4
    
    Now we walk the chain
    
    lock T1 -> lock L2 -> adjust L2 -> unlock T1 ->
         lock T2 ->  adjust T2 ->  drop locks
    
    T2 times out and blocks on L0
    
    Now we continue:
    
    lock T2 -> lock L0 -> deadlock detected, but it's not a deadlock at all.
    
    Brad tried to work around that in the deadlock detection logic itself,
    but the more I looked at it the less I liked it, because it's crystal
    ball magic after the fact.
    
    We actually can detect a chain change very simple:
    
    lock T1 -> lock L2 -> adjust L2 -> unlock T1 -> lock T2 -> adjust T2 ->
    
         next_lock = T2->pi_blocked_on->lock;
    
    drop locks
    
    T2 times out and blocks on L0
    
    Now we continue:
    
    lock T2 ->
    
         if (next_lock != T2->pi_blocked_on->lock)
         	   return;
    
    So if we detect that T2 is now blocked on a different lock we stop the
    chain walk. That's also correct in the following scenario:
    
    lock T1 -> lock L2 -> adjust L2 -> unlock T1 -> lock T2 -> adjust T2 ->
    
         next_lock = T2->pi_blocked_on->lock;
    
    drop locks
    
    T3 times out and drops L3
    T2 acquires L3 and blocks on L4 now
    
    Now we continue:
    
    lock T2 ->
    
         if (next_lock != T2->pi_blocked_on->lock)
         	   return;
    
    We don't have to follow up the chain at that point, because T2
    propagated our priority up to T4 already.
    
    [ Folded a cleanup patch from peterz ]
    
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Reported-by: Brad Mouring <bmouring@ni.com>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Link: http://lkml.kernel.org/r/20140605152801.930031935@linutronix.de
    Signed-off-by: Mike Galbraith <umgwanakikbuti@gmail.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 9e30d69979937783defb086751b8b60f4c776388
Author: Thomas Gleixner <tglx@linutronix.de>
Date:   Mon Jul 7 16:56:03 2014 +0200

    rtmutex: Fix deadlock detector for real
    
    commit 397335f004f41e5fcf7a795e94eb3ab83411a17c upstream.
    
    The current deadlock detection logic does not work reliably due to the
    following early exit path:
    
    	/*
    	 * Drop out, when the task has no waiters. Note,
    	 * top_waiter can be NULL, when we are in the deboosting
    	 * mode!
    	 */
    	if (top_waiter && (!task_has_pi_waiters(task) ||
    			   top_waiter != task_top_pi_waiter(task)))
    		goto out_unlock_pi;
    
    So this not only exits when the task has no waiters, it also exits
    unconditionally when the current waiter is not the top priority waiter
    of the task.
    
    So in a nested locking scenario, it might abort the lock chain walk
    and therefor miss a potential deadlock.
    
    Simple fix: Continue the chain walk, when deadlock detection is
    enabled.
    
    We also avoid the whole enqueue, if we detect the deadlock right away
    (A-A). It's an optimization, but also prevents that another waiter who
    comes in after the detection and before the task has undone the damage
    observes the situation and detects the deadlock and returns
    -EDEADLOCK, which is wrong as the other task is not in a deadlock
    situation.
    
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Reviewed-by: Steven Rostedt <rostedt@goodmis.org>
    Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
    Link: http://lkml.kernel.org/r/20140522031949.725272460@linutronix.de
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: Mike Galbraith <umgwanakikbuti@gmail.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 26e4e17c737bfae5a0734a8b3811d5df792b95d0
Author: Florian Westphal <fw@strlen.de>
Date:   Wed Jul 16 10:26:48 2014 +0200

    netfilter: nf_nat: fix oops on netns removal
    
    [ Upstream commit 945b2b2d259d1a4364a2799e80e8ff32f8c6ee6f ]
    
    Quoting Samu Kallio:
    
     Basically what's happening is, during netns cleanup,
     nf_nat_net_exit gets called before ipv4_net_exit. As I understand
     it, nf_nat_net_exit is supposed to kill any conntrack entries which
     have NAT context (through nf_ct_iterate_cleanup), but for some
     reason this doesn't happen (perhaps something else is still holding
     refs to those entries?).
    
     When ipv4_net_exit is called, conntrack entries (including those
     with NAT context) are cleaned up, but the
     nat_bysource hashtable is long gone - freed in nf_nat_net_exit. The
     bug happens when attempting to free a conntrack entry whose NAT hash
     'prev' field points to a slot in the freed hash table (head for that
     bin).
    
    We ignore conntracks with null nat bindings.  But this is wrong,
    as these are in bysource hash table as well.
    
    Restore nat-cleaning for the netns-is-being-removed case.
    
    bug:
    https://bugzilla.kernel.org/show_bug.cgi?id=65191
    
    Cc: <stable@vger.kernel.org> # 3.15.x
    Cc: <stable@vger.kernel.org> # 3.14.x
    Cc: <stable@vger.kernel.org> # 3.12.x
    Cc: <stable@vger.kernel.org> # 3.10.x
    Fixes: c2d421e1718 ('netfilter: nf_nat: fix race when unloading protocol modules')
    Reported-by: Samu Kallio <samu.kallio@aberdeencloud.com>
    Debugged-by: Samu Kallio <samu.kallio@aberdeencloud.com>
    Signed-off-by: Florian Westphal <fw@strlen.de>
    Tested-by: Samu Kallio <samu.kallio@aberdeencloud.com>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit f730d2ab16bae1111f796d01d3ab0b7d53e805f3
Author: Julian Anastasov <ja@ssi.bg>
Date:   Wed Jul 16 10:26:47 2014 +0200

    ipvs: stop tot_stats estimator only under CONFIG_SYSCTL
    
    [ Upstream commit 9802d21e7a0b0d2167ef745edc1f4ea7a0fc6ea3 ]
    
    The tot_stats estimator is started only when CONFIG_SYSCTL
    is defined. But it is stopped without checking CONFIG_SYSCTL.
    Fix the crash by moving ip_vs_stop_estimator into
    ip_vs_control_net_cleanup_sysctl.
    
    The change is needed after commit 14e405461e664b
    ("IPVS: Add __ip_vs_control_{init,cleanup}_sysctl()") from 2.6.39.
    
    Cc: <stable@vger.kernel.org> # 3.15.x
    Cc: <stable@vger.kernel.org> # 3.14.x
    Cc: <stable@vger.kernel.org> # 3.12.x
    Cc: <stable@vger.kernel.org> # 3.10.x
    Cc: <stable@vger.kernel.org> # 3.2.x
    Reported-by: Jet Chen <jet.chen@intel.com>
    Tested-by: Jet Chen <jet.chen@intel.com>
    Signed-off-by: Julian Anastasov <ja@ssi.bg>
    Sgned-off-by: Simon Horman <horms@verge.net.au>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>

commit 48e8cad86bb1241c08bdaa80db022c25068ff8e0
Author: Jiri Slaby <jslaby@suse.cz>
Date:   Mon Jul 14 15:20:17 2014 +0200

    Revert "aio: fix kernel memory disclosure in io_getevents() introduced in v3.10"
    
    This reverts commit 0e2e24e5dc6eb6f0698e9dc97e652f132b885624, which
    was applied twice mistakenly. The first one is
    bee3f7b8188d4b2a5dfaeb2eb4a68d99f67daecf.
    
    Reported-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>
    Cc: Benjamin LaHaise <bcrl@kvack.org>
    Cc: Mateusz Guzik <mguzik@redhat.com>
    Cc: Petr Matousek <pmatouse@redhat.com>
    Cc: Kent Overstreet <kmo@daterainc.com>
    Cc: Jeff Moyer <jmoyer@redhat.com>