commit 2023c00d650dfa409e58539596aca7d9deded824
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Sun Oct 5 14:52:37 2014 -0700

    Linux 3.14.20

commit bf3dbab538e64f75825cce34bdb2e611a3a2d8b9
Author: Rajendra Nayak <rnayak@ti.com>
Date:   Wed Aug 27 19:38:22 2014 -0600

    ARM: DRA7: Add support for soc_is_dra74x() and soc_is_dra72x() variants
    
    commit af438fec6cb99fc2e2faf8b16b865af26ce722e6 upstream.
    
    Use the corresponding compatibles to identify the devices.
    
    Signed-off-by: Rajendra Nayak <rnayak@ti.com>
    Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
    Acked-by: Nishanth Menon <nm@ti.com>
    Tested-by: Nishanth Menon <nm@ti.com>
    Signed-off-by: Paul Walmsley <paul@pwsan.com>
    Cc: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 62336a52a98bd23ecf781331ee96c0c9dca79ce9
Author: Stephen Boyd <sboyd@codeaurora.org>
Date:   Tue Jul 8 18:36:06 2014 -0700

    clk: qcom: mdp_lut_clk is a child of mdp_src
    
    commit f87dfcabc6f173cc811d185d33327f50a8c88399 upstream.
    
    The mdp_lut_clk isn't a child of the mdp_clk. Instead it's the
    child of the mdp_src clock. Fix it.
    
    Fixes: 6d00b56fe "clk: qcom: Add support for MSM8960's multimedia clock controller (MMCC)"
    Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 4a6c0a1ad62f6005889558bb33c29da77ee95b7a
Author: Stephen Boyd <sboyd@codeaurora.org>
Date:   Tue Jul 8 18:36:06 2014 -0700

    clk: qcom: Fix MN frequency tables, parent map, and jpegd
    
    commit ff20783f7b9f35b29e768d8ecc7076c1ca1a60ca upstream.
    
    Clocks that don't have a pre-divider don't list any pre-divider
    in their frequency tables, but their tables are initialized using
    aggregate initializers. Use tagged initializers so we properly
    assign the m and n values for each frequency. Furthermore, the
    mmcc_pxo_pll8_pll2_pll3 array improperly mapped the second
    element to pll2 instead of pll8, causing the clock driver to
    recalculate the wrong rate for any clocks using this array along
    with a rate that uses pll2. Plus the .num_parents field is 3
    instead of 4 so you can't even switch the parent to pll3. Finally
    I noticed that the jpegd clock improperly indicates that the
    pre-divider width is only 2, when it's actually 4 bits wide.
    
    Fixes: 6d00b56fe "clk: qcom: Add support for MSM8960's multimedia clock controller (MMCC)"
    Tested-by: Rob Clark <robdclark@gmail.com>
    Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 5cbde12cc945fabb8c2dae48ea9b0805d707439b
Author: Arnd Bergmann <arnd@arndb.de>
Date:   Fri Jun 20 14:23:28 2014 +0200

    staging/lustre: disable virtual block device for 64K pages
    
    commit 0bf22be0da8ea74bc7ccc5b07d7855830be16eca upstream.
    
    The lustre virtual block device cannot handle 64K pages and fails at compile
    time. To avoid running into this error, let's disable the Kconfig option
    for this driver in cases it doesn't support.
    
    Reported-by: Dann Frazier <dann.frazier@canonical.com>
    Signed-off-by: Arnd Bergmann <arnd@arndb.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 0be0ec9c364fc3a44837d58c2210432690a27ff4
Author: Gu Zheng <guz.fnst@cn.fujitsu.com>
Date:   Wed Sep 3 17:45:44 2014 +0800

    aio: block exit_aio() until all context requests are completed
    
    commit 6098b45b32e6baeacc04790773ced9340601d511 upstream.
    
    It seems that exit_aio() also needs to wait for all iocbs to complete (like
    io_destroy), but we missed the wait step in current implemention, so fix
    it in the same way as we did in io_destroy.
    
    Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
    Signed-off-by: Benjamin LaHaise <bcrl@kvack.org>
    [bwh: Backported to 3.16: adjust context]
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit ed7150a026415687de272a8c58e13af0dd269b35
Author: Tero Kristo <t-kristo@ti.com>
Date:   Thu Aug 21 16:47:45 2014 +0300

    clk: prevent erronous parsing of children during rate change
    
    commit 067bb1741c27c8d3b74ac98c0b8fc12b31e67005 upstream.
    
    In some cases, clocks can switch their parent with clk_set_rate, for
    example clk_mux can do this in some cases. Current implementation of
    clk_change_rate uses un-safe list iteration on the clock children, which
    will cause wrong clocks to be parsed in case any of the clock children
    change their parents during the change rate operation. Fixed by using
    the safe list iterator instead.
    
    The problem was detected due to some divide by zero errors generated
    by clock init on dra7-evm board, see discussion under
    http://article.gmane.org/gmane.linux.ports.arm.kernel/349180 for details.
    
    Fixes: 71472c0c06cf ("clk: add support for clock reparent on set_rate")
    Signed-off-by: Tero Kristo <t-kristo@ti.com>
    Reported-by: Nishanth Menon <nm@ti.com>
    Signed-off-by: Mike Turquette <mturquette@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 2968314094d8db0af32de20ad51349a30ea54a01
Author: Venkatesh Srinivas <venkateshs@google.com>
Date:   Thu Mar 13 12:36:26 2014 -0700

    perf/x86/intel: Use rdmsrl_safe() when initializing RAPL PMU
    
    commit 24223657806a0ebd0ae5c9caaf7b021091889cf2 upstream.
    
    CPUs which should support the RAPL counters according to
    Family/Model/Stepping may still issue #GP when attempting to access
    the RAPL MSRs. This may happen when Linux is running under KVM and
    we are passing-through host F/M/S data, for example. Use rdmsrl_safe
    to first access the RAPL_POWER_UNIT MSR; if this fails, do not
    attempt to use this PMU.
    
    Signed-off-by: Venkatesh Srinivas <venkateshs@google.com>
    Signed-off-by: Peter Zijlstra <peterz@infradead.org>
    Link: http://lkml.kernel.org/r/1394739386-22260-1-git-send-email-venkateshs@google.com
    Cc: zheng.z.yan@intel.com
    Cc: eranian@google.com
    Cc: ak@linux.intel.com
    Cc: linux-kernel@vger.kernel.org
    [ The patch also silently fixes another bug: rapl_pmu_init() didn't handle the memory alloc failure case previously. ]
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    [backport by whissi]
    Cc: Thomas D <whissi@whissi.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 763e95c4aca6a85577fdbb1ec8493f2c5cc41ee0
Author: Dan Carpenter <dan.carpenter@oracle.com>
Date:   Tue Aug 5 11:09:59 2014 +0300

    partitions: aix.c: off by one bug
    
    commit d97a86c170b4e432f76db072a827fe30b4d6f659 upstream.
    
    The lvip[] array has "state->limit" elements so the condition here
    should be >= instead of >.
    
    Fixes: 6ceea22bbbc8 ('partitions: add aix lvm partition support files')
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Acked-by: Philippe De Muyter <phdm@macqel.be>
    Signed-off-by: Jens Axboe <axboe@fb.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 5257a3de5b34b7f89f71026fb553a0b84736ff66
Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date:   Wed Jun 18 12:15:38 2014 +0300

    dmaengine: dw: don't perform DMA when dmaengine_submit is called
    
    commit dd8ecfcac66b4485416b2d1df0ec4798b198d7d6 upstream.
    
    Accordingly to discussion [1] and followed up documentation the DMA controller
    driver shouldn't start any DMA operations when dmaengine_submit() is called.
    
    This patch fixes the workflow in dw_dmac driver to follow the documentation.
    
    [1] http://www.spinics.net/lists/arm-kernel/msg125987.html
    
    Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
    Signed-off-by: Vinod Koul <vinod.koul@intel.com>
    Cc: "Petallo, MauriceX R" <mauricex.r.petallo@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 97a4115f3d3b7add0983dcc78dfd99ff19007bdd
Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date:   Wed Jun 18 12:15:36 2014 +0300

    dmaengine: dw: introduce dwc_dostart_first_queued() helper
    
    commit e7637c6c0382485f4d2e20715d058dae6f2b6a7c upstream.
    
    We have a duplicate code which starts first descriptor in the queue. Let's make
    this as a separate helper that can be used in future as well.
    
    Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
    Signed-off-by: Vinod Koul <vinod.koul@intel.com>
    Cc: "Petallo, MauriceX R" <mauricex.r.petallo@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit cc8705553c72df0e085c3950191aa6405f84d44e
Author: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Date:   Mon Apr 28 15:59:56 2014 +0300

    serial: 8250_dma: check the result of TX buffer mapping
    
    commit d4089a332883ad969700aac5dd4dd5f1c4fee825 upstream.
    
    Using dma_mapping_error() to make sure the mapping did not
    fail.
    
    Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
    Cc: "Petallo, MauriceX R" <mauricex.r.petallo@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 80a5285d665d690dfc29caf496a6b90d5d34e716
Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Date:   Mon May 26 13:40:53 2014 +0200

    PM / sleep: Use valid_state() for platform-dependent sleep states only
    
    commit 43e8317b0bba1d6eb85f38a4a233d82d7c20d732 upstream.
    
    Use the observation that, for platform-dependent sleep states
    (PM_SUSPEND_STANDBY, PM_SUSPEND_MEM), a given state is either
    always supported or always unsupported and store that information
    in pm_states[] instead of calling valid_state() every time we
    need to check it.
    
    Also do not use valid_state() for PM_SUSPEND_FREEZE, which is always
    valid, and move the pm_test_level validity check for PM_SUSPEND_FREEZE
    directly into enter_state().
    
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Cc: Brian Norris <computersforpeace@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 31a52a9e9d71afc65afb9c54479052b1663a5532
Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Date:   Mon May 26 13:40:47 2014 +0200

    PM / sleep: Add state field to pm_states[] entries
    
    commit 27ddcc6596e50cb8f03d2e83248897667811d8f6 upstream.
    
    To allow sleep states corresponding to the "mem", "standby" and
    "freeze" lables to be different from the pm_states[] indexes of
    those strings, introduce struct pm_sleep_state, consisting of
    a string label and a state number, and turn pm_states[] into an
    array of objects of that type.
    
    This modification should not lead to any functional changes.
    
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Cc: Brian Norris <computersforpeace@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 9321e2ecf40ab73eb3f74183d8f7a521d8b7eb52
Author: Julian Anastasov <ja@ssi.bg>
Date:   Fri Aug 22 17:53:41 2014 +0300

    ipvs: fix ipv6 hook registration for local replies
    
    commit eb90b0c734ad793d5f5bf230a9e9a4dcc48df8aa upstream.
    
    commit fc604767613b6d2036cdc35b660bc39451040a47
    ("ipvs: changes for local real server") from 2.6.37
    introduced DNAT support to local real server but the
    IPv6 LOCAL_OUT handler ip_vs_local_reply6() is
    registered incorrectly as IPv4 hook causing any outgoing
    IPv4 traffic to be dropped depending on the IP header values.
    
    Chris tracked down the problem to CONFIG_IP_VS_IPV6=y
    Bug report: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1349768
    
    Reported-by: Chris J Arges <chris.j.arges@canonical.com>
    Tested-by: Chris J Arges <chris.j.arges@canonical.com>
    Signed-off-by: Julian Anastasov <ja@ssi.bg>
    Signed-off-by: Simon Horman <horms@verge.net.au>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit fcfebe9bc6c789eba97c06e125f23b3f9e261efa
Author: Daniel Borkmann <dborkman@redhat.com>
Date:   Mon Aug 18 15:46:28 2014 +0200

    netfilter: x_tables: allow to use default cgroup match
    
    commit caa8ad94edf686d02b555c65a6162c0d1b434958 upstream.
    
    There's actually no good reason why we cannot use cgroup id 0,
    so lets just remove this artificial barrier.
    
    Reported-by: Alexey Perevalov <a.perevalov@samsung.com>
    Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
    Tested-by: Alexey Perevalov <a.perevalov@samsung.com>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit e19c985650c94578655f47cb6d856767c23b3433
Author: Alex Gartrell <agartrell@fb.com>
Date:   Wed Jul 16 15:57:34 2014 -0700

    ipvs: Maintain all DSCP and ECN bits for ipv6 tun forwarding
    
    commit 76f084bc10004b3050b2cff9cfac29148f1f6088 upstream.
    
    Previously, only the four high bits of the tclass were maintained in the
    ipv6 case.  This matches the behavior of ipv4, though whether or not we
    should reflect ECN bits may be up for debate.
    
    Signed-off-by: Alex Gartrell <agartrell@fb.com>
    Acked-by: Julian Anastasov <ja@ssi.bg>
    Signed-off-by: Simon Horman <horms@verge.net.au>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 6598554879509476a47929be742b858b3a42372a
Author: Eric Dumazet <edumazet@google.com>
Date:   Thu Jul 24 06:36:50 2014 +0200

    netfilter: xt_hashlimit: perform garbage collection from process context
    
    commit 7bd8490eef9776ced7632345df5133384b6be0fe upstream.
    
    xt_hashlimit cannot be used with large hash tables, because garbage
    collector is run from a timer. If table is really big, its possible
    to hold cpu for more than 500 msec, which is unacceptable.
    
    Switch to a work queue, and use proper scheduling points to remove
    latencies spikes.
    
    Later, we also could switch to a smoother garbage collection done
    at lookup time, one bucket at a time...
    
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Cc: Florian Westphal <fw@strlen.de>
    Cc: Patrick McHardy <kaber@trash.net>
    Reviewed-by: Florian Westphal <fw@strlen.de>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit fd29286dc5c7fa0f135ce30ca59c8c4130c87601
Author: Julian Anastasov <ja@ssi.bg>
Date:   Thu Jul 10 09:24:01 2014 +0300

    ipvs: avoid netns exit crash on ip_vs_conn_drop_conntrack
    
    commit 2627b7e15c5064ddd5e578e4efd948d48d531a3f upstream.
    
    commit 8f4e0a18682d91 ("IPVS netns exit causes crash in conntrack")
    added second ip_vs_conn_drop_conntrack call instead of just adding
    the needed check. As result, the first call still can cause
    crash on netns exit. Remove it.
    
    Signed-off-by: Julian Anastasov <ja@ssi.bg>
    Signed-off-by: Hans Schillstrom <hans@schillstrom.com>
    Signed-off-by: Simon Horman <horms@verge.net.au>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 2d433af81cb56603d8541dfe118bb02c69570d6c
Author: NeilBrown <neilb@suse.de>
Date:   Mon Sep 22 10:06:23 2014 +1000

    md/raid1: intialise start_next_window for READ case to avoid hang
    
    commit f0cc9a057151892b885be21a1d19b0185568281d upstream.
    
    r1_bio->start_next_window is not initialised in the READ
    case, so allow_barrier may incorrectly decrement
       conf->current_window_requests
    which can cause raise_barrier() to block forever.
    
    Fixes: 79ef3a8aa1cb1523cc231c9a90a278333c21f761
    Reported-by: Brassow Jonathan <jbrassow@redhat.com>
    Signed-off-by: NeilBrown <neilb@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit a2e286965a1ddf3ae1bdd89ad23d6aad3eb58a00
Author: NeilBrown <neilb@suse.de>
Date:   Thu Sep 18 11:09:04 2014 +1000

    md/raid1: fix_read_error should act on all non-faulty devices.
    
    commit b8cb6b4c121e1bf1963c16ed69e7adcb1bc301cd upstream.
    
    If a devices is being recovered it is not InSync and is not Faulty.
    
    If a read error is experienced on that device, fix_read_error()
    will be called, but it ignores non-InSync devices.  So it will
    neither fix the error nor fail the device.
    
    It is incorrect that fix_read_error() ignores non-InSync devices.
    It should only ignore Faulty devices.  So fix it.
    
    This became a bug when we allowed reading from a device that was being
    recovered.  It is suitable for any subsequent -stable kernel.
    
    Fixes: da8840a747c0dbf49506ec906757a6b87b9741e9
    Reported-by: Alexander Lyakas <alex.bolshoy@gmail.com>
    Tested-by: Alexander Lyakas <alex.bolshoy@gmail.com>
    Signed-off-by: NeilBrown <neilb@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 3cb3fd625636b43f0e1d5c0aa14fb1145442ac4c
Author: NeilBrown <neilb@suse.de>
Date:   Tue Sep 16 12:14:14 2014 +1000

    md/raid1: count resync requests in nr_pending.
    
    commit 34e97f170149bfa14979581c4c748bc9b4b79d5b upstream.
    
    Both normal IO and resync IO can be retried with reschedule_retry()
    and so be counted into ->nr_queued, but only normal IO gets counted in
    ->nr_pending.
    
    Before the recent improvement to RAID1 resync there could only
    possibly have been one or the other on the queue.  When handling a
    read failure it could only be normal IO.  So when handle_read_error()
    called freeze_array() the fact that freeze_array only compares
    ->nr_queued against ->nr_pending was safe.
    
    But now that these two types can interleave, we can have both normal
    and resync IO requests queued, so we need to count them both in
    nr_pending.
    
    This error can lead to freeze_array() hanging if there is a read
    error, so it is suitable for -stable.
    
    Fixes: 79ef3a8aa1cb1523cc231c9a90a278333c21f761
    Reported-by: Brassow Jonathan <jbrassow@redhat.com>
    Signed-off-by: NeilBrown <neilb@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 58e62ed358d38a3ce7a31f169e1f317f53b8938f
Author: NeilBrown <neilb@suse.de>
Date:   Wed Sep 10 16:01:24 2014 +1000

    md/raid1: update next_resync under resync_lock.
    
    commit c2fd4c94deedb89ac1746c4a53219be499372c06 upstream.
    
    raise_barrier() uses next_resync as part of its calculations, so it
    really should be updated first, instead of afterwards.
    
    next_resync is always used under resync_lock so update it under
    resync lock to, just before it is used.  That is safest.
    
    This could cause normal IO and resync IO to interact badly so
    it suitable for -stable.
    
    Fixes: 79ef3a8aa1cb1523cc231c9a90a278333c21f761
    Signed-off-by: NeilBrown <neilb@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit ff96e1acf2b7d3e8b86374ec1b5d30a2194e43d1
Author: NeilBrown <neilb@suse.de>
Date:   Wed Sep 10 15:56:57 2014 +1000

    md/raid1: Don't use next_resync to determine how far resync has progressed
    
    commit 235549605eb7f1c5a37cef8b09d12e6d412c5cd6 upstream.
    
    next_resync is (approximately) the location for the next resync request.
    However it does *not* reliably determine the earliest location
    at which resync might be happening.
    This is because resync requests can complete out of order, and
    we only limit the number of current requests, not the distance
    from the earliest pending request to the latest.
    
    mddev->curr_resync_completed is a reliable indicator of the earliest
    position at which resync could be happening.   It is updated less
    frequently, but is actually reliable which is more important.
    
    So use it to determine if a write request is before the region
    being resynced and so safe from conflict.
    
    This error can allow resync IO to interfere with normal IO which
    could lead to data corruption. Hence: stable.
    
    Fixes: 79ef3a8aa1cb1523cc231c9a90a278333c21f761
    Signed-off-by: NeilBrown <neilb@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 9dcea9a8c1440e9db950634c89030f511704dfe0
Author: NeilBrown <neilb@suse.de>
Date:   Wed Sep 10 15:01:49 2014 +1000

    md/raid1: make sure resync waits for conflicting writes to complete.
    
    commit 2f73d3c55d09ce60647b96ad2a9b539c95a530ee upstream.
    
    The resync/recovery process for raid1 was recently changed
    so that writes could happen in parallel with resync providing
    they were in different regions of the device.
    
    There is a problem though:  While a write request will always
    wait for conflicting resync to complete, a resync request
    will *not* always wait for conflicting writes to complete.
    
    Two changes are needed to fix this:
    
    1/ raise_barrier (which waits until it is safe to do resync)
       must wait until current_window_requests is zero
    2/ wait_battier (which waits at the start of a new write request)
       must update current_window_requests if the request could
       possible conflict with a concurrent resync.
    
    As concurrent writes and resync can lead to data loss,
    this patch is suitable for -stable.
    
    Fixes: 79ef3a8aa1cb1523cc231c9a90a278333c21f761
    Cc: majianpeng <majianpeng@gmail.com>
    Signed-off-by: NeilBrown <neilb@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 849815fe007950418ee816d1e8c7c6ce26233a07
Author: NeilBrown <neilb@suse.de>
Date:   Tue Sep 9 13:49:46 2014 +1000

    md/raid1: be more cautious where we read-balance during resync.
    
    commit c6d119cf1b5a778e9ed60a006e2a434fcc4471a2 upstream.
    
    commit 79ef3a8aa1cb1523cc231c9a90a278333c21f761 made
    it possible for reads to happen concurrently with resync.
    This means that we need to be more careful where read_balancing
    is allowed during resync - we can no longer be sure that any
    resync that has already started will definitely finish.
    
    So keep read_balancing to before recovery_cp, which is conservative
    but safe.
    
    This bug makes it possible to read from a device that doesn't
    have up-to-date data, so it can cause data corruption.
    So it is suitable for any kernel since 3.11.
    
    Fixes: 79ef3a8aa1cb1523cc231c9a90a278333c21f761
    Signed-off-by: NeilBrown <neilb@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 4d57fec84b64556fbb9a1527a791d68404b5bc60
Author: NeilBrown <neilb@suse.de>
Date:   Thu Sep 4 16:30:38 2014 +1000

    md/raid1: clean up request counts properly in close_sync()
    
    commit 669cc7ba77864e7b1ac39c9f2b2afb8730f341f4 upstream.
    
    If there are outstanding writes when close_sync is called,
    the change to ->start_next_window might cause them to
    decrement the wrong counter when they complete.  Fix this
    by merging the two counters into the one that will be decremented.
    
    Having an incorrect value in a counter can cause raise_barrier()
    to hangs, so this is suitable for -stable.
    
    Fixes: 79ef3a8aa1cb1523cc231c9a90a278333c21f761
    Signed-off-by: NeilBrown <neilb@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 4f31b027c3f2671d3d1da47666a23eca930baafb
Author: Hans Verkuil <hverkuil@xs4all.nl>
Date:   Fri Sep 12 06:02:02 2014 -0300

    media: adv7604: fix inverted condition
    
    commit 77639ff2b3404a913b8037d230a384798b854bae upstream.
    
    The log_status function should show HDMI information, but the test checking for
    an HDMI input was inverted. Fix this.
    
    Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
    Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 66c644d7226b430e499757177c27872ba3479b23
Author: Hans Verkuil <hans.verkuil@cisco.com>
Date:   Tue Aug 26 02:59:53 2014 -0300

    media: cx18: fix kernel oops with tda8290 tuner
    
    commit 6a03dc92cc2edfa2257502557b9f714893987383 upstream.
    
    This was caused by an uninitialized setup.config field.
    
    Based on a suggestion from Devin Heitmueller.
    
    Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
    Thanks-to: Devin Heitmueller <dheitmueller@kernellabs.com>
    Reported-by: Scott Robinson <scott.robinson55@gmail.com>
    Tested-by: Hans Verkuil <hans.verkuil@cisco.com>
    Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit b842c478ae2f02576bcada28babe0afec6e4725b
Author: Malcolm Priestley <tvboxspy@gmail.com>
Date:   Tue Aug 5 06:19:16 2014 -0300

    media: af9035: new IDs: add support for PCTV 78e and PCTV 79e
    
    commit a04646c045cab08a9e62b9be8f01ecbb0632d24e upstream.
    
    add the following IDs
    USB_PID_PCTV_78E (0x025a) for PCTV 78e
    USB_PID_PCTV_79E (0x0262) for PCTV 79e
    
    For these it9135 devices.
    
    Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
    Cc: Antti Palosaari <crope@iki.fi>
    Signed-off-by: Antti Palosaari <crope@iki.fi>
    Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit c9bf87daad34a80e4f742a94238cf8449e444add
Author: Prarit Bhargava <prarit@redhat.com>
Date:   Wed Sep 10 10:12:08 2014 -0400

    cpufreq: release policy->rwsem on error
    
    commit 7106e02baed4a72fb23de56b02ad4d31daa74d95 upstream.
    
    While debugging a cpufreq-related hardware failure on a system I saw the
    following lockdep warning:
    
     =========================
     [ BUG: held lock freed! ] 3.17.0-rc4+ #1 Tainted: G            E
     -------------------------
     insmod/2247 is freeing memory ffff88006e1b1400-ffff88006e1b17ff, with a lock still held there!
      (&policy->rwsem){+.+...}, at: [<ffffffff8156d37d>] __cpufreq_add_dev.isra.21+0x47d/0xb80
     3 locks held by insmod/2247:
      #0:  (subsys mutex#5){+.+.+.}, at: [<ffffffff81485579>] subsys_interface_register+0x69/0x120
      #1:  (cpufreq_rwsem){.+.+.+}, at: [<ffffffff8156cf73>] __cpufreq_add_dev.isra.21+0x73/0xb80
      #2:  (&policy->rwsem){+.+...}, at: [<ffffffff8156d37d>] __cpufreq_add_dev.isra.21+0x47d/0xb80
    
     stack backtrace:
     CPU: 0 PID: 2247 Comm: insmod Tainted: G            E  3.17.0-rc4+ #1
     Hardware name: HP ProLiant MicroServer Gen8, BIOS J06 08/24/2013
      0000000000000000 000000008f3063c4 ffff88006f87bb30 ffffffff8171b358
      ffff88006bcf3750 ffff88006f87bb68 ffffffff810e09e1 ffff88006e1b1400
      ffffea0001b86c00 ffffffff8156d327 ffff880073003500 0000000000000246
     Call Trace:
      [<ffffffff8171b358>] dump_stack+0x4d/0x66
      [<ffffffff810e09e1>] debug_check_no_locks_freed+0x171/0x180
      [<ffffffff8156d327>] ? __cpufreq_add_dev.isra.21+0x427/0xb80
      [<ffffffff8121412b>] kfree+0xab/0x2b0
      [<ffffffff8156d327>] __cpufreq_add_dev.isra.21+0x427/0xb80
      [<ffffffff81724cf7>] ? _raw_spin_unlock+0x27/0x40
      [<ffffffffa003517f>] ? pcc_cpufreq_do_osc+0x17f/0x17f [pcc_cpufreq]
      [<ffffffff8156da8e>] cpufreq_add_dev+0xe/0x10
      [<ffffffff814855d1>] subsys_interface_register+0xc1/0x120
      [<ffffffff8156bcf2>] cpufreq_register_driver+0x112/0x340
      [<ffffffff8121415a>] ? kfree+0xda/0x2b0
      [<ffffffffa003517f>] ? pcc_cpufreq_do_osc+0x17f/0x17f [pcc_cpufreq]
      [<ffffffffa003562e>] pcc_cpufreq_init+0x4af/0xe81 [pcc_cpufreq]
      [<ffffffffa003517f>] ? pcc_cpufreq_do_osc+0x17f/0x17f [pcc_cpufreq]
      [<ffffffff81002144>] do_one_initcall+0xd4/0x210
      [<ffffffff811f7472>] ? __vunmap+0xd2/0x120
      [<ffffffff81127155>] load_module+0x1315/0x1b70
      [<ffffffff811222a0>] ? store_uevent+0x70/0x70
      [<ffffffff811229d9>] ? copy_module_from_fd.isra.44+0x129/0x180
      [<ffffffff81127b86>] SyS_finit_module+0xa6/0xd0
      [<ffffffff81725b69>] system_call_fastpath+0x16/0x1b
     cpufreq: __cpufreq_add_dev: ->get() failed
    insmod: ERROR: could not insert module pcc-cpufreq.ko: No such device
    
    The warning occurs in the __cpufreq_add_dev() code which does
    
            down_write(&policy->rwsem);
    	...
            if (cpufreq_driver->get && !cpufreq_driver->setpolicy) {
                    policy->cur = cpufreq_driver->get(policy->cpu);
                    if (!policy->cur) {
                            pr_err("%s: ->get() failed\n", __func__);
                            goto err_get_freq;
                    }
    
    If cpufreq_driver->get(policy->cpu) returns an error we execute the
    code at err_get_freq, which does not up the policy->rwsem.  This causes
    the lockdep warning.
    
    Trivial patch to up the policy->rwsem in the error path.
    
    After the patch has been applied, and an error occurs in the
    cpufreq_driver->get(policy->cpu) call we will now see
    
    cpufreq: __cpufreq_add_dev: ->get() failed
    cpufreq: __cpufreq_add_dev: ->get() failed
    modprobe: ERROR: could not insert 'pcc_cpufreq': No such device
    
    Fixes: 4e97b631f24c (cpufreq: Initialize governor for a new policy under policy->rwsem)
    Signed-off-by: Prarit Bhargava <prarit@redhat.com>
    Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 65439f28c296101cb38c33a8266ad5ca58f7c5b9
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Wed Jul 30 14:55:26 2014 +0200

    nl80211: clear skb cb before passing to netlink
    
    commit bd8c78e78d5011d8111bc2533ee73b13a3bd6c42 upstream.
    
    In testmode and vendor command reply/event SKBs we use the
    skb cb data to store nl80211 parameters between allocation
    and sending. This causes the code for CONFIG_NETLINK_MMAP
    to get confused, because it takes ownership of the skb cb
    data when the SKB is handed off to netlink, and it doesn't
    explicitly clear it.
    
    Clear the skb cb explicitly when we're done and before it
    gets passed to netlink to avoid this issue.
    
    Reported-by: Assaf Azulay <assaf.azulay@intel.com>
    Reported-by: David Spinadel <david.spinadel@intel.com>
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit a382565412227d626ef66aad73a00a527f371d60
Author: Anton Altaparmakov <aia21@cam.ac.uk>
Date:   Mon Sep 22 01:53:03 2014 +0100

    Fix nasty 32-bit overflow bug in buffer i/o code.
    
    commit f2d5a94436cc7cc0221b9a81bba2276a25187dd3 upstream.
    
    On 32-bit architectures, the legacy buffer_head functions are not always
    handling the sector number with the proper 64-bit types, and will thus
    fail on 4TB+ disks.
    
    Any code that uses __getblk() (and thus bread(), breadahead(),
    sb_bread(), sb_breadahead(), sb_getblk()), and calls it using a 64-bit
    block on a 32-bit arch (where "long" is 32-bit) causes an inifinite loop
    in __getblk_slow() with an infinite stream of errors logged to dmesg
    like this:
    
      __find_get_block_slow() failed. block=6740375944, b_blocknr=2445408648
      b_state=0x00000020, b_size=512
      device sda1 blocksize: 512
    
    Note how in hex block is 0x191C1F988 and b_blocknr is 0x91C1F988 i.e. the
    top 32-bits are missing (in this case the 0x1 at the top).
    
    This is because grow_dev_page() is broken and has a 32-bit overflow due
    to shifting the page index value (a pgoff_t - which is just 32 bits on
    32-bit architectures) left-shifted as the block number.  But the top
    bits to get lost as the pgoff_t is not type cast to sector_t / 64-bit
    before the shift.
    
    This patch fixes this issue by type casting "index" to sector_t before
    doing the left shift.
    
    Note this is not a theoretical bug but has been seen in the field on a
    4TiB hard drive with logical sector size 512 bytes.
    
    This patch has been verified to fix the infinite loop problem on 3.17-rc5
    kernel using a 4TB disk image mounted using "-o loop".  Without this patch
    doing a "find /nt" where /nt is an NTFS volume causes the inifinite loop
    100% reproducibly whilst with the patch it works fine as expected.
    
    Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit fc7884a1fd56038e2137572095acf38500de04b5
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Fri Sep 12 18:00:53 2014 -0400

    drm/radeon/px: fix module unload
    
    commit 2e97140dd58cab8772bf77d73eabda213e45202d upstream.
    
    Use the new vga_switcheroo_fini_domain_pm_ops function
    to unregister the pm ops.
    
    Based on a patch from:
    Pali Rohár <pali.rohar@gmail.com>
    
    bug:
    https://bugzilla.kernel.org/show_bug.cgi?id=84431
    
    Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
    Cc: Ben Skeggs <bskeggs@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 92ebad9165af9db2677cdc37dee9afee65f8cc0f
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Fri Sep 12 18:06:56 2014 -0400

    drm/nouveau/runpm: fix module unload
    
    commit 53beaa01e0fe8e4202f43485a03b32fcf5dfea74 upstream.
    
    Use the new vga_switcheroo_fini_domain_pm_ops function
    to unregister the pm ops.
    
    Based on a patch from:
    Pali Rohár <pali.rohar@gmail.com>
    
    bug:
    https://bugzilla.kernel.org/show_bug.cgi?id=84431
    
    Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Cc: Ben Skeggs <bskeggs@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit f7b47e107ddc21e37c925c5ebe4df61cdc6e265b
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Fri Sep 12 17:51:29 2014 -0400

    vgaswitcheroo: add vga_switcheroo_fini_domain_pm_ops
    
    commit 766a53d059d1500c9755c8af017bd411bd8f1b20 upstream.
    
    Drivers should call this on unload to unregister pmops.
    
    Bug:
    https://bugzilla.kernel.org/show_bug.cgi?id=84431
    
    Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
    Cc: Ben Skeggs <bskeggs@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 77eeda2a01c46598857a5f128ed1e0158ec6e6c4
Author: Cong Wang <cwang@twopensource.com>
Date:   Tue Sep 2 15:27:20 2014 -0700

    perf: Fix a race condition in perf_remove_from_context()
    
    commit 3577af70a2ce4853d58e57d832e687d739281479 upstream.
    
    We saw a kernel soft lockup in perf_remove_from_context(),
    it looks like the `perf` process, when exiting, could not go
    out of the retry loop. Meanwhile, the target process was forking
    a child. So either the target process should execute the smp
    function call to deactive the event (if it was running) or it should
    do a context switch which deactives the event.
    
    It seems we optimize out a context switch in perf_event_context_sched_out(),
    and what's more important, we still test an obsolete task pointer when
    retrying, so no one actually would deactive that event in this situation.
    Fix it directly by reloading the task pointer in perf_remove_from_context().
    
    This should cure the above soft lockup.
    
    Signed-off-by: Cong Wang <cwang@twopensource.com>
    Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
    Signed-off-by: Peter Zijlstra <peterz@infradead.org>
    Cc: Paul Mackerras <paulus@samba.org>
    Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Link: http://lkml.kernel.org/r/1409696840-843-1-git-send-email-xiyou.wangcong@gmail.com
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit def258584a2986b46659552cbd4b4b555be43042
Author: Matan Barak <matanb@mellanox.com>
Date:   Tue Sep 2 15:32:34 2014 +0300

    IB/core: When marshaling uverbs path, clear unused fields
    
    commit a59c5850f09b4c2d6ad2fc47e5e1be8d654529d6 upstream.
    
    When marsheling a user path to the kernel struct ib_sa_path, need
    to zero smac, dmac and set the vlan id to the "no vlan" value.
    
    Fixes: dd5f03beb4f7 ("IB/core: Ethernet L2 attributes in verbs/cm structures")
    Reported-by: Aleksey Senin <alekseys@mellanox.com>
    Signed-off-by: Matan Barak <matanb@mellanox.com>
    Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
    Signed-off-by: Roland Dreier <roland@purestorage.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit cb264bf0c428cb776a364a7f75122a6d40cbb7bd
Author: Moni Shoua <monis@mellanox.com>
Date:   Thu Aug 21 14:28:38 2014 +0300

    IB/mlx4: Don't duplicate the default RoCE GID
    
    commit f5c4834d9328c4ed9fe5dcbec6128d6da16db69a upstream.
    
    When reading the IPv6 addresses from the net-device, make sure to
    avoid adding a duplicate entry to the GID table because of equality
    between the default GID we generate and the default IPv6 link-local
    address of the device.
    
    Fixes: acc4fccf4eff ("IB/mlx4: Make sure GID index 0 is always occupied")
    Signed-off-by: Moni Shoua <monis@mellanox.com>
    Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
    Signed-off-by: Roland Dreier <roland@purestorage.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 3554cf91ce37c3d6e6ac3ad5f89a65a41c3852af
Author: Moni Shoua <monis@mellanox.com>
Date:   Thu Aug 21 14:28:37 2014 +0300

    IB/mlx4: Avoid null pointer dereference in mlx4_ib_scan_netdevs()
    
    commit e381835cf1b8e3b2857277dbc3b77d8c5350f70a upstream.
    
    When Ethernet netdev is not present for a port (e.g. when the link
    layer type of the port is InfiniBand) it's possible to dereference a
    null pointer when we do netdevice scanning.
    
    To fix that, we move a section of code that needs to run only when
    netdev is present to a proper if () statement.
    
    Fixes: ad4885d279b6 ("IB/mlx4: Build the port IBoE GID table properly under bonding")
    Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: Moni Shoua <monis@mellanox.com>
    Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
    Signed-off-by: Roland Dreier <roland@purestorage.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit dcbcb3f64878ce4e43ba3500ba13e87e2c35397a
Author: Mike Marciniszyn <mike.marciniszyn@intel.com>
Date:   Fri Sep 19 08:32:19 2014 -0400

    IB/qib: Correct reference counting in debugfs qp_stats
    
    commit 85cbb7c728bf39c45a9789b88c9471c0d7a58b0e upstream.
    
    This particular reference count is not needed with the rcu protection,
    and the current code leaks a reference count, causing a hang in
    qib_qp_destroy().
    
    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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 192ffa5bb712446637fbf738b726a4fb873a7aac
Author: Al Viro <viro@ZenIV.linux.org.uk>
Date:   Fri Sep 12 20:56:04 2014 +0100

    GFS2: fix d_splice_alias() misuses
    
    commit cfb2f9d5c921e38b0f12bb26fed10b877664444d upstream.
    
    Callers of d_splice_alias(dentry, inode) don't need iput(), neither
    on success nor on failure.  Either the reference to inode is stored
    in a previously negative dentry, or it's dropped.  In either case
    inode reference the caller used to hold is consumed.
    
    __gfs2_lookup() does iput() in case when d_splice_alias() has failed.
    Double iput() if we ever hit that.  And gfs2_create_inode() ends up
    not only with double iput(), but with link count dropped to zero - on
    an inode it has just found in directory.
    
    Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
    Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 0d67673fea1c9a8910431f7cffeb5ff4b7fd2c8c
Author: Richard Larocque <rlarocque@google.com>
Date:   Tue Sep 9 18:31:05 2014 -0700

    alarmtimer: Lock k_itimer during timer callback
    
    commit 474e941bed9262f5fa2394f9a4a67e24499e5926 upstream.
    
    Locks the k_itimer's it_lock member when handling the alarm timer's
    expiry callback.
    
    The regular posix timers defined in posix-timers.c have this lock held
    during timout processing because their callbacks are routed through
    posix_timer_fn().  The alarm timers follow a different path, so they
    ought to grab the lock somewhere else.
    
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Ingo Molnar <mingo@kernel.org>
    Cc: Richard Cochran <richardcochran@gmail.com>
    Cc: Prarit Bhargava <prarit@redhat.com>
    Cc: Sharvil Nanavati <sharvil@google.com>
    Signed-off-by: Richard Larocque <rlarocque@google.com>
    Signed-off-by: John Stultz <john.stultz@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 012c0f413d5d28c2e49f22d39a51d9e65cc87ee7
Author: Richard Larocque <rlarocque@google.com>
Date:   Tue Sep 9 18:31:04 2014 -0700

    alarmtimer: Do not signal SIGEV_NONE timers
    
    commit 265b81d23a46c39df0a735a3af4238954b41a4c2 upstream.
    
    Avoids sending a signal to alarm timers created with sigev_notify set to
    SIGEV_NONE by checking for that special case in the timeout callback.
    
    The regular posix timers avoid sending signals to SIGEV_NONE timers by
    not scheduling any callbacks for them in the first place.  Although it
    would be possible to do something similar for alarm timers, it's simpler
    to handle this as a special case in the timeout.
    
    Prior to this patch, the alarm timer would ignore the sigev_notify value
    and try to deliver signals to the process anyway.  Even worse, the
    sanity check for the value of sigev_signo is skipped when SIGEV_NONE was
    specified, so the signal number could be bogus.  If sigev_signo was an
    unitialized value (as it often would be if SIGEV_NONE is used), then
    it's hard to predict which signal will be sent.
    
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Ingo Molnar <mingo@kernel.org>
    Cc: Richard Cochran <richardcochran@gmail.com>
    Cc: Prarit Bhargava <prarit@redhat.com>
    Cc: Sharvil Nanavati <sharvil@google.com>
    Signed-off-by: Richard Larocque <rlarocque@google.com>
    Signed-off-by: John Stultz <john.stultz@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 6050dbd80f0f30c034bd2d1fb50ee3547954da79
Author: Richard Larocque <rlarocque@google.com>
Date:   Tue Sep 9 18:31:03 2014 -0700

    alarmtimer: Return relative times in timer_gettime
    
    commit e86fea764991e00a03ff1e56409ec9cacdbda4c9 upstream.
    
    Returns the time remaining for an alarm timer, rather than the time at
    which it is scheduled to expire.  If the timer has already expired or it
    is not currently scheduled, the it_value's members are set to zero.
    
    This new behavior matches that of the other posix-timers and the POSIX
    specifications.
    
    This is a change in user-visible behavior, and may break existing
    applications.  Hopefully, few users rely on the old incorrect behavior.
    
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Ingo Molnar <mingo@kernel.org>
    Cc: Richard Cochran <richardcochran@gmail.com>
    Cc: Prarit Bhargava <prarit@redhat.com>
    Cc: Sharvil Nanavati <sharvil@google.com>
    Signed-off-by: Richard Larocque <rlarocque@google.com>
    [jstultz: minor style tweak]
    Signed-off-by: John Stultz <john.stultz@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 0dd3e23fcb70daa8d879c5f320ff65029da2b371
Author: John David Anglin <dave.anglin@bell.net>
Date:   Mon Sep 22 20:54:50 2014 -0400

    parisc: Only use -mfast-indirect-calls option for 32-bit kernel builds
    
    commit d26a7730b5874a5fa6779c62f4ad7c5065a94723 upstream.
    
    In spite of what the GCC manual says, the -mfast-indirect-calls has
    never been supported in the 64-bit parisc compiler. Indirect calls have
    always been done using function descriptors irrespective of the
    -mfast-indirect-calls option.
    
    Recently, it was noticed that a function descriptor was always requested
    when the -mfast-indirect-calls option was specified. This caused
    problems when the option was used in  application code and doesn't make
    any sense because the whole point of the option is to avoid using a
    function descriptor for indirect calls.
    
    Fixing this broke 64-bit kernel builds.
    
    I will fix GCC but for now we need the attached change. This results in
    the same kernel code as before.
    
    Signed-off-by: John David Anglin <dave.anglin@bell.net>
    Signed-off-by: Helge Deller <deller@gmx.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit a00e2af70dd39117d292fbc4ba30411d932e46a0
Author: Guy Martin <gmsoft@tuxicoman.be>
Date:   Fri Sep 12 18:02:34 2014 +0200

    parisc: Implement new LWS CAS supporting 64 bit operations.
    
    commit 89206491201cbd1571009b36292af781cef74c1b upstream.
    
    The current LWS cas only works correctly for 32bit. The new LWS allows
    for CAS operations of variable size.
    
    Signed-off-by: Guy Martin <gmsoft@tuxicoman.be>
    Signed-off-by: Helge Deller <deller@gmx.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit aed47136eb7505bd7f08cb790e7c288c9f3a2fb1
Author: Al Viro <viro@zeniv.linux.org.uk>
Date:   Sat Sep 13 21:55:46 2014 -0400

    don't bugger nd->seq on set_root_rcu() from follow_dotdot_rcu()
    
    commit 7bd88377d482e1eae3c5329b12e33cfd664fa6a9 upstream.
    
    return the value instead, and have path_init() do the assignment.  Broken by
    "vfs: Fix absolute RCU path walk failures due to uninitialized seq number",
    which was Cc-stable with 2.6.38+ as destination.  This one should go where
    it went.
    
    To avoid dummy value returned in case when root is already set (it would do
    no harm, actually, since the only caller that doesn't ignore the return value
    is guaranteed to have nd->root *not* set, but it's more obvious that way),
    lift the check into callers.  And do the same to set_root(), to keep them
    in sync.
    
    Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit afb3378f30b6fe6079d04c84052c7308661c27a9
Author: Michael Ellerman <mpe@ellerman.id.au>
Date:   Thu Aug 7 15:36:18 2014 +1000

    powerpc: Add smp_mb()s to arch_spin_unlock_wait()
    
    commit 78e05b1421fa41ae8457701140933baa5e7d9479 upstream.
    
    Similar to the previous commit which described why we need to add a
    barrier to arch_spin_is_locked(), we have a similar problem with
    spin_unlock_wait().
    
    We need a barrier on entry to ensure any spinlock we have previously
    taken is visibly locked prior to the load of lock->slock.
    
    It's also not clear if spin_unlock_wait() is intended to have ACQUIRE
    semantics. For now be conservative and add a barrier on exit to give it
    ACQUIRE semantics.
    
    Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
    Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 4d4626b1fd183208b8f3e844964fc6b61625c90d
Author: Michael Ellerman <mpe@ellerman.id.au>
Date:   Thu Aug 7 15:36:17 2014 +1000

    powerpc: Add smp_mb() to arch_spin_is_locked()
    
    commit 51d7d5205d3389a32859f9939f1093f267409929 upstream.
    
    The kernel defines the function spin_is_locked(), which can be used to
    check if a spinlock is currently locked.
    
    Using spin_is_locked() on a lock you don't hold is obviously racy. That
    is, even though you may observe that the lock is unlocked, it may become
    locked at any time.
    
    There is (at least) one exception to that, which is if two locks are
    used as a pair, and the holder of each checks the status of the other
    before doing any update.
    
    Assuming *A and *B are two locks, and *COUNTER is a shared non-atomic
    value:
    
    The first CPU does:
    
    	spin_lock(*A)
    
    	if spin_is_locked(*B)
    		# nothing
    	else
    		smp_mb()
    		LOAD r = *COUNTER
    		r++
    		STORE *COUNTER = r
    
    	spin_unlock(*A)
    
    And the second CPU does:
    
    	spin_lock(*B)
    
    	if spin_is_locked(*A)
    		# nothing
    	else
    		smp_mb()
    		LOAD r = *COUNTER
    		r++
    		STORE *COUNTER = r
    
    	spin_unlock(*B)
    
    Although this is a strange locking construct, it should work.
    
    It seems to be understood, but not documented, that spin_is_locked() is
    not a memory barrier, so in the examples above and below the caller
    inserts its own memory barrier before acting on the result of
    spin_is_locked().
    
    For now we assume spin_is_locked() is implemented as below, and we break
    it out in our examples:
    
    	bool spin_is_locked(*LOCK) {
    		LOAD l = *LOCK
    		return l.locked
    	}
    
    Our intuition is that there should be no problem even if the two code
    sequences run simultaneously such as:
    
    	CPU 0			CPU 1
    	==================================================
    	spin_lock(*A)		spin_lock(*B)
    	LOAD b = *B		LOAD a = *A
    	if b.locked # true	if a.locked # true
    	# nothing		# nothing
    	spin_unlock(*A)		spin_unlock(*B)
    
    If one CPU gets the lock before the other then it will do the update and
    the other CPU will back off:
    
    	CPU 0			CPU 1
    	==================================================
    	spin_lock(*A)
    	LOAD b = *B
    				spin_lock(*B)
    	if b.locked # false	LOAD a = *A
    	else			if a.locked # true
    	smp_mb()		# nothing
    	LOAD r1 = *COUNTER	spin_unlock(*B)
    	r1++
    	STORE *COUNTER = r1
    	spin_unlock(*A)
    
    However in reality spin_lock() itself is not indivisible. On powerpc we
    implement it as a load-and-reserve and store-conditional.
    
    Ignoring the retry logic for the lost reservation case, it boils down to:
    	spin_lock(*LOCK) {
    		LOAD l = *LOCK
    		l.locked = true
    		STORE *LOCK = l
    		ACQUIRE_BARRIER
    	}
    
    The ACQUIRE_BARRIER is required to give spin_lock() ACQUIRE semantics as
    defined in memory-barriers.txt:
    
         This acts as a one-way permeable barrier.  It guarantees that all
         memory operations after the ACQUIRE operation will appear to happen
         after the ACQUIRE operation with respect to the other components of
         the system.
    
    On modern powerpc systems we use lwsync for ACQUIRE_BARRIER. lwsync is
    also know as "lightweight sync", or "sync 1".
    
    As described in Power ISA v2.07 section B.2.1.1, in this scenario the
    lwsync is not the barrier itself. It instead causes the LOAD of *LOCK to
    act as the barrier, preventing any loads or stores in the locked region
    from occurring prior to the load of *LOCK.
    
    Whether this behaviour is in accordance with the definition of ACQUIRE
    semantics in memory-barriers.txt is open to discussion, we may switch to
    a different barrier in future.
    
    What this means in practice is that the following can occur:
    
    	CPU 0			CPU 1
    	==================================================
    	LOAD a = *A 		LOAD b = *B
    	a.locked = true		b.locked = true
    	LOAD b = *B		LOAD a = *A
    	STORE *A = a		STORE *B = b
    	if b.locked # false	if a.locked # false
    	else			else
    	smp_mb()		smp_mb()
    	LOAD r1 = *COUNTER	LOAD r2 = *COUNTER
    	r1++			r2++
    	STORE *COUNTER = r1
    				STORE *COUNTER = r2	# Lost update
    	spin_unlock(*A)		spin_unlock(*B)
    
    That is, the load of *B can occur prior to the store that makes *A
    visibly locked. And similarly for CPU 1. The result is both CPUs hold
    their lock and believe the other lock is unlocked.
    
    The easiest fix for this is to add a full memory barrier to the start of
    spin_is_locked(), so adding to our previous definition would give us:
    
    	bool spin_is_locked(*LOCK) {
    		smp_mb()
    		LOAD l = *LOCK
    		return l.locked
    	}
    
    The new barrier orders the store to the lock we are locking vs the load
    of the other lock:
    
    	CPU 0			CPU 1
    	==================================================
    	LOAD a = *A 		LOAD b = *B
    	a.locked = true		b.locked = true
    	STORE *A = a		STORE *B = b
    	smp_mb()		smp_mb()
    	LOAD b = *B		LOAD a = *A
    	if b.locked # true	if a.locked # true
    	# nothing		# nothing
    	spin_unlock(*A)		spin_unlock(*B)
    
    Although the above example is theoretical, there is code similar to this
    example in sem_lock() in ipc/sem.c. This commit in addition to the next
    commit appears to be a fix for crashes we are seeing in that code where
    we believe this race happens in practice.
    
    Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
    Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 3539b5d04feed394c2301bcb08e3b61abc25265d
Author: Anton Blanchard <anton@samba.org>
Date:   Tue Aug 26 12:44:15 2014 +1000

    powerpc/perf: Fix ABIv2 kernel backtraces
    
    commit 85101af13bb854a6572fa540df7c7201958624b9 upstream.
    
    ABIv2 kernels are failing to backtrace through the kernel. An example:
    
    39.30%  readseek2_proce  [kernel.kallsyms]    [k] find_get_entry
                |
                --- find_get_entry
                   __GI___libc_read
    
    The problem is in valid_next_sp() where we check that the new stack
    pointer is at least STACK_FRAME_OVERHEAD below the previous one.
    
    ABIv1 has a minimum stack frame size of 112 bytes consisting of 48 bytes
    and 64 bytes of parameter save area. ABIv2 changes that to 32 bytes
    with no paramter save area.
    
    STACK_FRAME_OVERHEAD is in theory the minimum stack frame size,
    but we over 240 uses of it, some of which assume that it includes
    space for the parameter area.
    
    We need to work through all our stack defines and rationalise them
    but let's fix perf now by creating STACK_FRAME_MIN_SIZE and using
    in valid_next_sp(). This fixes the issue:
    
    30.64%  readseek2_proce  [kernel.kallsyms]    [k] find_get_entry
                |
                --- find_get_entry
                   pagecache_get_page
                   generic_file_read_iter
                   new_sync_read
                   vfs_read
                   sys_read
                   syscall_exit
                   __GI___libc_read
    
    Reported-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
    Signed-off-by: Anton Blanchard <anton@samba.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 66e0196cea2b5801dd1c6280cae8e9dfab72edcc
Author: Arend van Spriel <arend@broadcom.com>
Date:   Fri Sep 12 16:19:30 2014 +0200

    brcmfmac: handle IF event for P2P_DEVICE interface
    
    commit 87c4790330810fe5caf0172d9320cf24ef19cebe upstream.
    
    The firmware notifies about interface changes through the IF event
    which has a NO_IF flag that means host can ignore the event. This
    behaviour was introduced in the driver by:
    
      commit 2ee8382fc6c763c76396a6aaff77a27089eed3aa
      Author: Arend van Spriel <arend@broadcom.com>
      Date:   Sat Aug 10 12:27:24 2013 +0200
    
          brcmfmac: ignore IF event if firmware indicates it
    
    It turns out that the IF event for the P2P_DEVICE also has this
    flag set, but the event should not be ignored in this scenario.
    The mentioned commit caused a regression in 3.12 kernel in creation
    of the P2P_DEVICE interface.
    
    Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
    Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
    Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
    Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
    Signed-off-by: Arend van Spriel <arend@broadcom.com>
    Signed-off-by: John W. Linville <linville@tuxdriver.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 5d8890fc2dd88809457422c9721077dbf09d138c
Author: Wanpeng Li <wanpeng.li@linux.intel.com>
Date:   Wed Sep 24 16:38:05 2014 +0800

    sched: Fix unreleased llc_shared_mask bit during CPU hotplug
    
    commit 03bd4e1f7265548832a76e7919a81f3137c44fd1 upstream.
    
    The following bug can be triggered by hot adding and removing a large number of
    xen domain0's vcpus repeatedly:
    
    	BUG: unable to handle kernel NULL pointer dereference at 0000000000000004 IP: [..] find_busiest_group
    	PGD 5a9d5067 PUD 13067 PMD 0
    	Oops: 0000 [#3] SMP
    	[...]
    	Call Trace:
    	load_balance
    	? _raw_spin_unlock_irqrestore
    	idle_balance
    	__schedule
    	schedule
    	schedule_timeout
    	? lock_timer_base
    	schedule_timeout_uninterruptible
    	msleep
    	lock_device_hotplug_sysfs
    	online_store
    	dev_attr_store
    	sysfs_write_file
    	vfs_write
    	SyS_write
    	system_call_fastpath
    
    Last level cache shared mask is built during CPU up and the
    build_sched_domain() routine takes advantage of it to setup
    the sched domain CPU topology.
    
    However, llc_shared_mask is not released during CPU disable,
    which leads to an invalid sched domainCPU topology.
    
    This patch fix it by releasing the llc_shared_mask correctly
    during CPU disable.
    
    Yasuaki also reported that this can happen on real hardware:
    
      https://lkml.org/lkml/2014/7/22/1018
    
    His case is here:
    
    	==
    	Here is an example on my system.
    	My system has 4 sockets and each socket has 15 cores and HT is
    	enabled. In this case, each core of sockes is numbered as
    	follows:
    
    		 | CPU#
    	Socket#0 | 0-14 , 60-74
    	Socket#1 | 15-29, 75-89
    	Socket#2 | 30-44, 90-104
    	Socket#3 | 45-59, 105-119
    
    	Then llc_shared_mask of CPU#30 has 0x3fff80000001fffc0000000.
    
    	It means that last level cache of Socket#2 is shared with
    	CPU#30-44 and 90-104.
    
    	When hot-removing socket#2 and #3, each core of sockets is
    	numbered as follows:
    
    		 | CPU#
    	Socket#0 | 0-14 , 60-74
    	Socket#1 | 15-29, 75-89
    
    	But llc_shared_mask is not cleared. So llc_shared_mask of CPU#30
    	remains having 0x3fff80000001fffc0000000.
    
    	After that, when hot-adding socket#2 and #3, each core of
    	sockets is numbered as follows:
    
    		 | CPU#
    	Socket#0 | 0-14 , 60-74
    	Socket#1 | 15-29, 75-89
    	Socket#2 | 30-59
    	Socket#3 | 90-119
    
    	Then llc_shared_mask of CPU#30 becomes
    	0x3fff8000fffffffc0000000. It means that last level cache of
    	Socket#2 is shared with CPU#30-59 and 90-104. So the mask has
    	the wrong value.
    
    Signed-off-by: Wanpeng Li <wanpeng.li@linux.intel.com>
    Tested-by: Linn Crosetto <linn@hp.com>
    Reviewed-by: Borislav Petkov <bp@suse.de>
    Reviewed-by: Toshi Kani <toshi.kani@hp.com>
    Reviewed-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
    Cc: David Rientjes <rientjes@google.com>
    Cc: Prarit Bhargava <prarit@redhat.com>
    Cc: Steven Rostedt <srostedt@redhat.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Link: http://lkml.kernel.org/r/1411547885-48165-1-git-send-email-wanpeng.li@linux.intel.com
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 3e272e4fe150d565189c1558e51fdf6e801c97ce
Author: Peter Feiner <pfeiner@google.com>
Date:   Thu Sep 25 16:05:29 2014 -0700

    mm: softdirty: keep bit when zapping file pte
    
    commit dbab31aa2ceec2d201966fa0b552f151310ba5f4 upstream.
    
    This fixes the same bug as b43790eedd31 ("mm: softdirty: don't forget to
    save file map softdiry bit on unmap") and 9aed8614af5a ("mm/memory.c:
    don't forget to set softdirty on file mapped fault") where the return
    value of pte_*mksoft_dirty was being ignored.
    
    To be sure that no other pte/pmd "mk" function return values were being
    ignored, I annotated the functions in arch/x86/include/asm/pgtable.h
    with __must_check and rebuilt.
    
    The userspace effect of this bug is that the softdirty mark might be
    lost if a file mapped pte get zapped.
    
    Signed-off-by: Peter Feiner <pfeiner@google.com>
    Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
    Cc: Pavel Emelyanov <xemul@parallels.com>
    Cc: Jamie Liu <jamieliu@google.com>
    Cc: Hugh Dickins <hughd@google.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 168e7c5696a1bed56c3d52ebef97a280e404daaf
Author: David Rientjes <rientjes@google.com>
Date:   Thu Sep 25 16:05:20 2014 -0700

    mm, slab: initialize object alignment on cache creation
    
    commit d4a5fca592b9ab52b90bb261a90af3c8f53be011 upstream.
    
    Since commit 4590685546a3 ("mm/sl[aou]b: Common alignment code"), the
    "ralign" automatic variable in __kmem_cache_create() may be used as
    uninitialized.
    
    The proper alignment defaults to BYTES_PER_WORD and can be overridden by
    SLAB_RED_ZONE or the alignment specified by the caller.
    
    This fixes https://bugzilla.kernel.org/show_bug.cgi?id=85031
    
    Signed-off-by: David Rientjes <rientjes@google.com>
    Reported-by: Andrei Elovikov <a.elovikov@gmail.com>
    Acked-by: Christoph Lameter <cl@linux.com>
    Cc: Pekka Enberg <penberg@kernel.org>
    Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 868086710ba74f3b81bf9acc822a470cd3de816b
Author: Joseph Qi <joseph.qi@huawei.com>
Date:   Thu Sep 25 16:05:16 2014 -0700

    ocfs2/dlm: do not get resource spinlock if lockres is new
    
    commit 5760a97c7143c208fa3a8f8cad0ed7dd672ebd28 upstream.
    
    There is a deadlock case which reported by Guozhonghua:
      https://oss.oracle.com/pipermail/ocfs2-devel/2014-September/010079.html
    
    This case is caused by &res->spinlock and &dlm->master_lock
    misordering in different threads.
    
    It was introduced by commit 8d400b81cc83 ("ocfs2/dlm: Clean up refmap
    helpers").  Since lockres is new, it doesn't not require the
    &res->spinlock.  So remove it.
    
    Fixes: 8d400b81cc83 ("ocfs2/dlm: Clean up refmap helpers")
    Signed-off-by: Joseph Qi <joseph.qi@huawei.com>
    Reviewed-by: joyce.xue <xuejiufei@huawei.com>
    Reported-by: Guozhonghua <guozhonghua@h3c.com>
    Cc: Joel Becker <jlbec@evilplan.org>
    Cc: Mark Fasheh <mfasheh@suse.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 550a7377dad61b91022a820f99cd99b91f08a298
Author: Andreas Rohner <andreas.rohner@gmx.net>
Date:   Thu Sep 25 16:05:14 2014 -0700

    nilfs2: fix data loss with mmap()
    
    commit 56d7acc792c0d98f38f22058671ee715ff197023 upstream.
    
    This bug leads to reproducible silent data loss, despite the use of
    msync(), sync() and a clean unmount of the file system.  It is easily
    reproducible with the following script:
    
      ----------------[BEGIN SCRIPT]--------------------
      mkfs.nilfs2 -f /dev/sdb
      mount /dev/sdb /mnt
    
      dd if=/dev/zero bs=1M count=30 of=/mnt/testfile
    
      umount /mnt
      mount /dev/sdb /mnt
      CHECKSUM_BEFORE="$(md5sum /mnt/testfile)"
    
      /root/mmaptest/mmaptest /mnt/testfile 30 10 5
    
      sync
      CHECKSUM_AFTER="$(md5sum /mnt/testfile)"
      umount /mnt
      mount /dev/sdb /mnt
      CHECKSUM_AFTER_REMOUNT="$(md5sum /mnt/testfile)"
      umount /mnt
    
      echo "BEFORE MMAP:\t$CHECKSUM_BEFORE"
      echo "AFTER MMAP:\t$CHECKSUM_AFTER"
      echo "AFTER REMOUNT:\t$CHECKSUM_AFTER_REMOUNT"
      ----------------[END SCRIPT]--------------------
    
    The mmaptest tool looks something like this (very simplified, with
    error checking removed):
    
      ----------------[BEGIN mmaptest]--------------------
      data = mmap(NULL, file_size - file_offset, PROT_READ | PROT_WRITE,
                  MAP_SHARED, fd, file_offset);
    
      for (i = 0; i < write_count; ++i) {
            memcpy(data + i * 4096, buf, sizeof(buf));
            msync(data, file_size - file_offset, MS_SYNC))
      }
      ----------------[END mmaptest]--------------------
    
    The output of the script looks something like this:
    
      BEFORE MMAP:    281ed1d5ae50e8419f9b978aab16de83  /mnt/testfile
      AFTER MMAP:     6604a1c31f10780331a6850371b3a313  /mnt/testfile
      AFTER REMOUNT:  281ed1d5ae50e8419f9b978aab16de83  /mnt/testfile
    
    So it is clear, that the changes done using mmap() do not survive a
    remount.  This can be reproduced a 100% of the time.  The problem was
    introduced in commit 136e8770cd5d ("nilfs2: fix issue of
    nilfs_set_page_dirty() for page at EOF boundary").
    
    If the page was read with mpage_readpage() or mpage_readpages() for
    example, then it has no buffers attached to it.  In that case
    page_has_buffers(page) in nilfs_set_page_dirty() will be false.
    Therefore nilfs_set_file_dirty() is never called and the pages are never
    collected and never written to disk.
    
    This patch fixes the problem by also calling nilfs_set_file_dirty() if the
    page has no buffers attached to it.
    
    [akpm@linux-foundation.org: s/PAGE_SHIFT/PAGE_CACHE_SHIFT/]
    Signed-off-by: Andreas Rohner <andreas.rohner@gmx.net>
    Tested-by: Andreas Rohner <andreas.rohner@gmx.net>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit b16d8955e2561fc923bb75478e63d6822ba7039e
Author: Andrey Vagin <avagin@openvz.org>
Date:   Tue Sep 9 14:51:06 2014 -0700

    fs/notify: don't show f_handle if exportfs_encode_inode_fh failed
    
    commit 7e8824816bda16bb11ff5ff1e1212d642e57b0b3 upstream.
    
    Currently we handle only ENOSPC.  In case of other errors the file_handle
    variable isn't filled properly and we will show a part of stack.
    
    Signed-off-by: Andrey Vagin <avagin@openvz.org>
    Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
    Cc: Alexander Viro <viro@zeniv.linux.org.uk>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 0a76dbd0209834f50f3a02c3a4b958cf33b96269
Author: Andrey Vagin <avagin@openvz.org>
Date:   Tue Sep 9 14:51:04 2014 -0700

    fsnotify/fdinfo: use named constants instead of hardcoded values
    
    commit 1fc98d11cac6dd66342e5580cb2687e5b1e9a613 upstream.
    
    MAX_HANDLE_SZ is equal to 128, but currently the size of pad is only 64
    bytes, so exportfs_encode_inode_fh can return an error.
    
    Signed-off-by: Andrey Vagin <avagin@openvz.org>
    Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
    Cc: Alexander Viro <viro@zeniv.linux.org.uk>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 25e8cc20e42c6931cae11e702201911a2590df2e
Author: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Date:   Tue Sep 9 14:51:01 2014 -0700

    kcmp: fix standard comparison bug
    
    commit acbbe6fbb240a927ee1f5994f04d31267d422215 upstream.
    
    The C operator <= defines a perfectly fine total ordering on the set of
    values representable in a long.  However, unlike its namesake in the
    integers, it is not translation invariant, meaning that we do not have
    "b <= c" iff "a+b <= a+c" for all a,b,c.
    
    This means that it is always wrong to try to boil down the relationship
    between two longs to a question about the sign of their difference,
    because the resulting relation [a LEQ b iff a-b <= 0] is neither
    anti-symmetric or transitive.  The former is due to -LONG_MIN==LONG_MIN
    (take any two a,b with a-b = LONG_MIN; then a LEQ b and b LEQ a, but a !=
    b).  The latter can either be seen observing that x LEQ x+1 for all x,
    implying x LEQ x+1 LEQ x+2 ...  LEQ x-1 LEQ x; or more directly with the
    simple example a=LONG_MIN, b=0, c=1, for which a-b < 0, b-c < 0, but a-c >
    0.
    
    Note that it makes absolutely no difference that a transmogrying bijection
    has been applied before the comparison is done.  In fact, had the
    obfuscation not been done, one could probably not observe the bug
    (assuming all values being compared always lie in one half of the address
    space, the mathematical value of a-b is always representable in a long).
    As it stands, one can easily obtain three file descriptors exhibiting the
    non-transitivity of kcmp().
    
    Side note 1: I can't see that ensuring the MSB of the multiplier is
    set serves any purpose other than obfuscating the obfuscating code.
    
    Side note 2:
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <fcntl.h>
    #include <unistd.h>
    #include <assert.h>
    #include <sys/syscall.h>
    
    enum kcmp_type {
            KCMP_FILE,
            KCMP_VM,
            KCMP_FILES,
            KCMP_FS,
            KCMP_SIGHAND,
            KCMP_IO,
            KCMP_SYSVSEM,
            KCMP_TYPES,
    };
    pid_t pid;
    
    int kcmp(pid_t pid1, pid_t pid2, int type,
    	 unsigned long idx1, unsigned long idx2)
    {
    	return syscall(SYS_kcmp, pid1, pid2, type, idx1, idx2);
    }
    int cmp_fd(int fd1, int fd2)
    {
    	int c = kcmp(pid, pid, KCMP_FILE, fd1, fd2);
    	if (c < 0) {
    		perror("kcmp");
    		exit(1);
    	}
    	assert(0 <= c && c < 3);
    	return c;
    }
    int cmp_fdp(const void *a, const void *b)
    {
    	static const int normalize[] = {0, -1, 1};
    	return normalize[cmp_fd(*(int*)a, *(int*)b)];
    }
    #define MAX 100 /* This is plenty; I've seen it trigger for MAX==3 */
    int main(int argc, char *argv[])
    {
    	int r, s, count = 0;
    	int REL[3] = {0,0,0};
    	int fd[MAX];
    	pid = getpid();
    	while (count < MAX) {
    		r = open("/dev/null", O_RDONLY);
    		if (r < 0)
    			break;
    		fd[count++] = r;
    	}
    	printf("opened %d file descriptors\n", count);
    	for (r = 0; r < count; ++r) {
    		for (s = r+1; s < count; ++s) {
    			REL[cmp_fd(fd[r], fd[s])]++;
    		}
    	}
    	printf("== %d\t< %d\t> %d\n", REL[0], REL[1], REL[2]);
    	qsort(fd, count, sizeof(fd[0]), cmp_fdp);
    	memset(REL, 0, sizeof(REL));
    
    	for (r = 0; r < count; ++r) {
    		for (s = r+1; s < count; ++s) {
    			REL[cmp_fd(fd[r], fd[s])]++;
    		}
    	}
    	printf("== %d\t< %d\t> %d\n", REL[0], REL[1], REL[2]);
    	return (REL[0] + REL[2] != 0);
    }
    
    Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
    Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
    "Eric W. Biederman" <ebiederm@xmission.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit aab5fa657db6271f2f37772c0b9e8f908f38429e
Author: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Date:   Tue Sep 9 14:50:51 2014 -0700

    eventpoll: fix uninitialized variable in epoll_ctl
    
    commit c680e41b3a2e944185c74bf60531e3d316d3ecc4 upstream.
    
    When calling epoll_ctl with operation EPOLL_CTL_DEL, structure epds is
    not initialized but ep_take_care_of_epollwakeup reads its event field.
    When this unintialized field has EPOLLWAKEUP bit set, a capability check
    is done for CAP_BLOCK_SUSPEND in ep_take_care_of_epollwakeup.  This
    produces unexpected messages in the audit log, such as (on a system
    running SELinux):
    
        type=AVC msg=audit(1408212798.866:410): avc:  denied
        { block_suspend } for  pid=7754 comm="dbus-daemon" capability=36
        scontext=unconfined_u:unconfined_r:unconfined_t
        tcontext=unconfined_u:unconfined_r:unconfined_t
        tclass=capability2 permissive=1
    
        type=SYSCALL msg=audit(1408212798.866:410): arch=c000003e syscall=233
        success=yes exit=0 a0=3 a1=2 a2=9 a3=7fffd4d66ec0 items=0 ppid=1
        pid=7754 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0
        fsgid=0 tty=(none) ses=3 comm="dbus-daemon"
        exe="/usr/bin/dbus-daemon"
        subj=unconfined_u:unconfined_r:unconfined_t key=(null)
    
    ("arch=c000003e syscall=233 a1=2" means "epoll_ctl(op=EPOLL_CTL_DEL)")
    
    Remove use of epds in epoll_ctl when op == EPOLL_CTL_DEL.
    
    Fixes: 4d7e30d98939 ("epoll: Add a flag, EPOLLWAKEUP, to prevent suspend while epoll events are ready")
    Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
    Cc: Alexander Viro <viro@zeniv.linux.org.uk>
    Cc: Arve Hjønnevåg <arve@android.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 32fcd59e6ba2fec1707bca80da3c4e5a5f5558a5
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Mon Aug 25 12:08:09 2014 +0200

    Revert "mac80211: disable uAPSD if all ACs are under ACM"
    
    commit bb512ad0732232f1d2693bb68f31a76bed8f22ae upstream.
    
    This reverts commit 24aa11ab8ae03292d38ec0dbd9bc2ac49fe8a6dd.
    
    That commit was wrong since it uses data that hasn't even been set
    up yet, but might be a hold-over from a previous connection.
    
    Additionally, it seems like a driver-specific workaround that
    shouldn't have been in mac80211 to start with.
    
    Fixes: 24aa11ab8ae0 ("mac80211: disable uAPSD if all ACs are under ACM")
    Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit bd6f4290fa6cdd0583b936b4217dd8428d17186b
Author: Felipe Balbi <balbi@ti.com>
Date:   Wed Sep 3 16:13:37 2014 -0500

    usb: dwc3: core: fix ordering for PHY suspend
    
    commit dc99f16f076559235c92d3eb66d03d1310faea08 upstream.
    
    We can't suspend the PHYs before dwc3_core_exit_mode()
    has been called, that's because the host and/or device
    sides might still need to communicate with the far end
    link partner.
    
    Fixes: 8ba007a (usb: dwc3: core: enable the USB2 and USB3 phy in probe)
    Suggested-by: Alan Stern <stern@rowland.harvard.edu>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 518ad432d1fd90f7221a45e7f1227534aa74efb9
Author: Felipe Balbi <balbi@ti.com>
Date:   Tue Sep 2 14:57:20 2014 -0500

    usb: dwc3: core: fix order of PM runtime calls
    
    commit fed33afce0eda44a46ae24d93aec1b5198c0bac4 upstream.
    
    Currently, we disable pm_runtime before all register
    accesses are done, this is dangerous and might lead
    to abort exceptions due to the driver trying to access
    a register which is clocked by a clock which was long
    gated.
    
    Fix that by moving pm_runtime_put_sync() and pm_runtime_disable()
    as the last thing we do before returning from our ->remove()
    method.
    
    Fixes: 72246da (usb: Introduce DesignWare USB3 DRD Driver)
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 9783e9905e58eab4ddbdccbf66d83e9aecbf50d1
Author: Jens Axboe <axboe@fb.com>
Date:   Tue Sep 16 13:38:51 2014 -0600

    genhd: fix leftover might_sleep() in blk_free_devt()
    
    commit 46f341ffcfb5d8530f7d1e60f3be06cce6661b62 upstream.
    
    Commit 2da78092 changed the locking from a mutex to a spinlock,
    so we now longer sleep in this context. But there was a leftover
    might_sleep() in there, which now triggers since we do the final
    free from an RCU callback. Get rid of it.
    
    Reported-by: Pontus Fuchs <pontus.fuchs@gmail.com>
    Signed-off-by: Jens Axboe <axboe@fb.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 0c99fc04f3d4f8a0731c2cc1b2b4d363542b9bbe
Author: Trond Myklebust <trond.myklebust@primarydata.com>
Date:   Thu Jun 5 11:31:01 2014 -0400

    lockdep: Revert lockdep check in raw_seqcount_begin()
    
    commit 22fdcf02f6e80d64a927f702dd9d631a927d87d4 upstream.
    
    This commit reverts the addition of lockdep checking to raw_seqcount_begin
    for the following reasons:
    
     1) It violates the naming convention that raw_* functions should not
        do lockdep checks (a convention that is also followed by the other
        raw_*_seqcount_begin functions).
    
     2) raw_seqcount_begin does not spin, so it can only be part of an ABBA
        deadlock in very special circumstances (for instance if a lock
        is held across the entire raw_seqcount_begin()+read_seqcount_retry()
        loop while also being taken inside the write_seqcount protected area).
    
     3) It is causing false positives with some existing callers, and there
        is no non-lockdep alternative for those callers to use.
    
    None of the three existing callers (__d_lookup_rcu, netdev_get_name, and
    the NFS state code) appear to use the function in a manner that is ABBA
    deadlock prone.
    
    Fixes: 1ca7d67cf5d5: seqcount: Add lockdep functionality to seqcount/seqlock
    Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
    Signed-off-by: Peter Zijlstra <peterz@infradead.org>
    Cc: John Stultz <john.stultz@linaro.org>
    Cc: "David S. Miller" <davem@davemloft.net>
    Cc: Al Viro <viro@zeniv.linux.org.uk>
    Cc: Waiman Long <Waiman.Long@hp.com>
    Cc: Stephen Boyd <sboyd@codeaurora.org>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Link: http://lkml.kernel.org/r/CAHQdGtRR6SvEhXiqWo24hoUh9AU9cL82Z8Z-d8-7u951F_d+5g@mail.gmail.com
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 26935f7537395220e89ccab23b792862e8eacb09
Author: J. Bruce Fields <bfields@redhat.com>
Date:   Fri Aug 29 16:25:50 2014 -0400

    lockd: fix rpcbind crash on lockd startup failure
    
    commit 7c17705e77b12b20fb8afb7c1b15dcdb126c0c12 upstream.
    
    Nikita Yuschenko reported that booting a kernel with init=/bin/sh and
    then nfs mounting without portmap or rpcbind running using a busybox
    mount resulted in:
    
      # mount -t nfs 10.30.130.21:/opt /mnt
      svc: failed to register lockdv1 RPC service (errno 111).
      lockd_up: makesock failed, error=-111
      Unable to handle kernel paging request for data at address 0x00000030
      Faulting instruction address: 0xc055e65c
      Oops: Kernel access of bad area, sig: 11 [#1]
      MPC85xx CDS
      Modules linked in:
      CPU: 0 PID: 1338 Comm: mount Not tainted 3.10.44.cge #117
      task: cf29cea0 ti: cf35c000 task.ti: cf35c000
      NIP: c055e65c LR: c0566490 CTR: c055e648
      REGS: cf35dad0 TRAP: 0300   Not tainted  (3.10.44.cge)
      MSR: 00029000 <CE,EE,ME>  CR: 22442488  XER: 20000000
      DEAR: 00000030, ESR: 00000000
    
      GPR00: c05606f4 cf35db80 cf29cea0 cf0ded80 cf0dedb8 00000001 1dec3086
      00000000
      GPR08: 00000000 c07b1640 00000007 1dec3086 22442482 100b9758 00000000
      10090ae8
      GPR16: 00000000 000186a5 00000000 00000000 100c3018 bfa46edc 100b0000
      bfa46ef0
      GPR24: cf386ae0 c07834f0 00000000 c0565f88 00000001 cf0dedb8 00000000
      cf0ded80
      NIP [c055e65c] call_start+0x14/0x34
      LR [c0566490] __rpc_execute+0x70/0x250
      Call Trace:
      [cf35db80] [00000080] 0x80 (unreliable)
      [cf35dbb0] [c05606f4] rpc_run_task+0x9c/0xc4
      [cf35dbc0] [c0560840] rpc_call_sync+0x50/0xb8
      [cf35dbf0] [c056ee90] rpcb_register_call+0x54/0x84
      [cf35dc10] [c056f24c] rpcb_register+0xf8/0x10c
      [cf35dc70] [c0569e18] svc_unregister.isra.23+0x100/0x108
      [cf35dc90] [c0569e38] svc_rpcb_cleanup+0x18/0x30
      [cf35dca0] [c0198c5c] lockd_up+0x1dc/0x2e0
      [cf35dcd0] [c0195348] nlmclnt_init+0x2c/0xc8
      [cf35dcf0] [c015bb5c] nfs_start_lockd+0x98/0xec
      [cf35dd20] [c015ce6c] nfs_create_server+0x1e8/0x3f4
      [cf35dd90] [c0171590] nfs3_create_server+0x10/0x44
      [cf35dda0] [c016528c] nfs_try_mount+0x158/0x1e4
      [cf35de20] [c01670d0] nfs_fs_mount+0x434/0x8c8
      [cf35de70] [c00cd3bc] mount_fs+0x20/0xbc
      [cf35de90] [c00e4f88] vfs_kern_mount+0x50/0x104
      [cf35dec0] [c00e6e0c] do_mount+0x1d0/0x8e0
      [cf35df10] [c00e75ac] SyS_mount+0x90/0xd0
      [cf35df40] [c000ccf4] ret_from_syscall+0x0/0x3c
    
    The addition of svc_shutdown_net() resulted in two calls to
    svc_rpcb_cleanup(); the second is no longer necessary and crashes when
    it calls rpcb_register_call with clnt=NULL.
    
    Reported-by: Nikita Yushchenko <nyushchenko@dev.rtsoft.ru>
    Fixes: 679b033df484 "lockd: ensure we tear down any live sockets when socket creation fails during lockd_up"
    Acked-by: Jeff Layton <jlayton@primarydata.com>
    Signed-off-by: J. Bruce Fields <bfields@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 93ad3949633f88e4b7d30c4425db3a1df09bb31d
Author: Larry Finger <Larry.Finger@lwfinger.net>
Date:   Sun Aug 24 17:49:43 2014 -0500

    rtlwifi: rtl8192cu: Add new ID
    
    commit c66517165610b911e4c6d268f28d8c640832dbd1 upstream.
    
    The Sitecom WLA-2102 adapter uses this driver.
    
    Reported-by: Nico Baggus <nico-linux@noci.xs4all.nl>
    Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
    Cc: Nico Baggus <nico-linux@noci.xs4all.nl>
    Signed-off-by: John W. Linville <linville@tuxdriver.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 14abd3ae920e0b1102e5320deaba374f13bde8ff
Author: Eliad Peller <eliad@wizery.com>
Date:   Wed Jun 11 10:23:35 2014 +0300

    regulatory: add NUL to alpha2
    
    commit a5fe8e7695dc3f547e955ad2b662e3e72969e506 upstream.
    
    alpha2 is defined as 2-chars array, but is used in multiple
    places as string (e.g. with nla_put_string calls), which
    might leak kernel data.
    
    Solve it by simply adding an extra char for the NULL
    terminator, making such operations safe.
    
    Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit a43ff216853cfa92bd45e06c619a5c81af627e14
Author: Tejun Heo <tj@kernel.org>
Date:   Fri Aug 15 16:06:10 2014 -0400

    percpu: perform tlb flush after pcpu_map_pages() failure
    
    commit 849f5169097e1ba35b90ac9df76b5bb6f9c0aabd upstream.
    
    If pcpu_map_pages() fails midway, it unmaps the already mapped pages.
    Currently, it doesn't flush tlb after the partial unmapping.  This may
    be okay in most cases as the established mapping hasn't been used at
    that point but it can go wrong and when it goes wrong it'd be
    extremely difficult to track down.
    
    Flush tlb after the partial unmapping.
    
    Signed-off-by: Tejun Heo <tj@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 6d5d76b07571706adc73e02a6e0d72a6749ddc83
Author: Tejun Heo <tj@kernel.org>
Date:   Fri Aug 15 16:06:06 2014 -0400

    percpu: fix pcpu_alloc_pages() failure path
    
    commit f0d279654dea22b7a6ad34b9334aee80cda62cde upstream.
    
    When pcpu_alloc_pages() fails midway, pcpu_free_pages() is invoked to
    free what has already been allocated.  The invocation is across the
    whole requested range and pcpu_free_pages() will try to free all
    non-NULL pages; unfortunately, this is incorrect as
    pcpu_get_pages_and_bitmap(), unlike what its comment suggests, doesn't
    clear the pages array and thus the array may have entries from the
    previous invocations making the partial failure path free incorrect
    pages.
    
    Fix it by open-coding the partial freeing of the already allocated
    pages.
    
    Signed-off-by: Tejun Heo <tj@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit b25d2579bfd58c46fe23452d32cdd8943041cb77
Author: Honggang Li <enjoymindful@gmail.com>
Date:   Tue Aug 12 21:36:15 2014 +0800

    percpu: free percpu allocation info for uniprocessor system
    
    commit 3189eddbcafcc4d827f7f19facbeddec4424eba8 upstream.
    
    Currently, only SMP system free the percpu allocation info.
    Uniprocessor system should free it too. For example, one x86 UML
    virtual machine with 256MB memory, UML kernel wastes one page memory.
    
    Signed-off-by: Honggang Li <enjoymindful@gmail.com>
    Signed-off-by: Tejun Heo <tj@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 41722f462d7adb0f330454e96bca2bf43c87cfa3
Author: James Ralston <james.d.ralston@intel.com>
Date:   Wed Aug 27 14:31:58 2014 -0700

    ata_piix: Add Device IDs for Intel 9 Series PCH
    
    commit 6cad1376954e591c3c41500c4e586e183e7ffe6d upstream.
    
    This patch adds the IDE mode SATA Device IDs for the Intel 9 Series PCH.
    
    Signed-off-by: James Ralston <james.d.ralston@intel.com>
    Signed-off-by: Tejun Heo <tj@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 41950abc621b8d66510d7983d2b26e31da7b2c8c
Author: Robert Coulson <rob.coulson@gmail.com>
Date:   Thu Aug 28 10:45:43 2014 -0700

    hwmon: (ds1621) Update zbits after conversion rate change
    
    commit 39c627a084475e8a690a4a9e7601410ca173ddd2 upstream.
    
    After the conversion rate is changed, the zbits are not updated,
    but should be, since they are used later in the set_temp function.
    
    Fixes: a50d9a4d9ad3 ("hwmon: (ds1621) Fix temperature rounding operations")
    Reported-by: Murat Ilsever <murat.ilsever@gmail.com>
    Signed-off-by: Robert Coulson <rob.coulson@gmail.com>
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit e6fe40c1752c08b272d24cb918d90a257526ce8c
Author: Hans de Goede <hdegoede@redhat.com>
Date:   Thu Sep 11 10:10:26 2014 -0700

    Input: i8042 - add nomux quirk for Avatar AVIU-145A6
    
    commit d2682118f4bb3ceb835f91c1a694407a31bb7378 upstream.
    
    The sys_vendor / product_name are somewhat generic unfortunately, so this
    may lead to some false positives. But nomux usually does no harm, where as
    not having it clearly is causing problems on the Avatar AVIU-145A6.
    
    https://bugzilla.kernel.org/show_bug.cgi?id=77391
    
    Reported-by: Hugo P <saurosii@gmail.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 098dfe6be140adf6f33d72e8a0f07612ee63dbbe
Author: Hans de Goede <hdegoede@redhat.com>
Date:   Wed Sep 10 13:53:37 2014 -0700

    Input: i8042 - add Fujitsu U574 to no_timeout dmi table
    
    commit cc18a69c92d0972bc2fc5a047ee3be1e8398171b upstream.
    
    https://bugzilla.kernel.org/show_bug.cgi?id=69731
    
    Reported-by: Jason Robinson <mail@jasonrobinson.me>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 5dcececa31c60252a6b418bae6cba030279a34b7
Author: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date:   Wed Sep 10 13:50:37 2014 -0700

    Input: atkbd - do not try 'deactivate' keyboard on any LG laptops
    
    commit c01206796139e2b1feb7539bc72174fef1c6dc6e upstream.
    
    We are getting more and more reports about LG laptops not having
    functioning keyboard if we try to deactivate keyboard during probe.
    Given that having keyboard deactivated is merely "nice to have"
    instead of a hard requirement for probing, let's disable it on all
    LG boxes instead of trying to hunt down particular models.
    
    This change is prompted by patches trying to add "LG Electronics"/"ROCKY"
    and "LG Electronics"/"LW60-F27B" to the DMI list.
    
    https://bugzilla.kernel.org/show_bug.cgi?id=77051
    
    Reported-by: Jaime Velasco Juan <jsagarribay@gmail.com>
    Reported-by: Georgios Tsalikis <georgios@tsalikis.net>
    Tested-by: Jaime Velasco Juan <jsagarribay@gmail.com>
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 3018c530b213ebba9325cc259fd0836b60bd5734
Author: Hans de Goede <hdegoede@redhat.com>
Date:   Mon Sep 8 14:39:52 2014 -0700

    Input: elantech - fix detection of touchpad on ASUS s301l
    
    commit 271329b3c798b2102120f5df829071c211ef00ed upstream.
    
    Adjust Elantech signature validation to account fo rnewer models of
    touchpads.
    
    Reported-and-tested-by: Màrius Monton <marius.monton@gmail.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit f7129d071d0d94d8aa52d49153c5b200d2006198
Author: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date:   Sat Aug 30 13:51:06 2014 -0700

    Input: synaptics - add support for ForcePads
    
    commit 5715fc764f7753d464dbe094b5ef9cffa6e479a4 upstream.
    
    ForcePads are found on HP EliteBook 1040 laptops. They lack any kind of
    physical buttons, instead they generate primary button click when user
    presses somewhat hard on the surface of the touchpad. Unfortunately they
    also report primary button click whenever there are 2 or more contacts
    on the pad, messing up all multi-finger gestures (2-finger scrolling,
    multi-finger tapping, etc). To cope with this behavior we introduce a
    delay (currently 50 msecs) in reporting primary press in case more
    contacts appear.
    
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 6bba67cd0563d715840e872b290f3ca0cd5ae325
Author: John Sung <penmount.touch@gmail.com>
Date:   Tue Sep 9 10:06:51 2014 -0700

    Input: serport - add compat handling for SPIOCSTYPE ioctl
    
    commit a80d8b02751060a178bb1f7a6b7a93645a7a308b upstream.
    
    When running a 32-bit inputattach utility in a 64-bit system, there will be
    error code "inputattach: can't set device type". This is caused by the
    serport device driver not supporting compat_ioctl, so that SPIOCSTYPE ioctl
    fails.
    
    Signed-off-by: John Sung <penmount.touch@gmail.com>
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 0e61f65ec2a9558d6bc01419584ac06c412dbd4a
Author: Mikulas Patocka <mpatocka@redhat.com>
Date:   Thu Aug 28 11:09:31 2014 -0400

    dm crypt: fix access beyond the end of allocated space
    
    commit d49ec52ff6ddcda178fc2476a109cf1bd1fa19ed upstream.
    
    The DM crypt target accesses memory beyond allocated space resulting in
    a crash on 32 bit x86 systems.
    
    This bug is very old (it dates back to 2.6.25 commit 3a7f6c990ad04 "dm
    crypt: use async crypto").  However, this bug was masked by the fact
    that kmalloc rounds the size up to the next power of two.  This bug
    wasn't exposed until 3.17-rc1 commit 298a9fa08a ("dm crypt: use per-bio
    data").  By switching to using per-bio data there was no longer any
    padding beyond the end of a dm-crypt allocated memory block.
    
    To minimize allocation overhead dm-crypt puts several structures into one
    block allocated with kmalloc.  The block holds struct ablkcipher_request,
    cipher-specific scratch pad (crypto_ablkcipher_reqsize(any_tfm(cc))),
    struct dm_crypt_request and an initialization vector.
    
    The variable dmreq_start is set to offset of struct dm_crypt_request
    within this memory block.  dm-crypt allocates the block with this size:
    cc->dmreq_start + sizeof(struct dm_crypt_request) + cc->iv_size.
    
    When accessing the initialization vector, dm-crypt uses the function
    iv_of_dmreq, which performs this calculation: ALIGN((unsigned long)(dmreq
    + 1), crypto_ablkcipher_alignmask(any_tfm(cc)) + 1).
    
    dm-crypt allocated "cc->iv_size" bytes beyond the end of dm_crypt_request
    structure.  However, when dm-crypt accesses the initialization vector, it
    takes a pointer to the end of dm_crypt_request, aligns it, and then uses
    it as the initialization vector.  If the end of dm_crypt_request is not
    aligned on a crypto_ablkcipher_alignmask(any_tfm(cc)) boundary the
    alignment causes the initialization vector to point beyond the allocated
    space.
    
    Fix this bug by calculating the variable iv_size_padding and adding it
    to the allocated size.
    
    Also correct the alignment of dm_crypt_request.  struct dm_crypt_request
    is specific to dm-crypt (it isn't used by the crypto subsystem at all),
    so it is aligned on __alignof__(struct dm_crypt_request).
    
    Also align per_bio_data_size on ARCH_KMALLOC_MINALIGN, so that it is
    aligned as if the block was allocated with kmalloc.
    
    Reported-by: Krzysztof Kolasa <kkolasa@winsoft.pl>
    Tested-by: Milan Broz <gmazyland@gmail.com>
    Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
    Signed-off-by: Mike Snitzer <snitzer@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 6f0e09c86dea00dd6b9a346e8ea62a97794bf80c
Author: Anssi Hannula <anssi.hannula@iki.fi>
Date:   Fri Sep 5 03:11:28 2014 +0300

    dm cache: fix race causing dirty blocks to be marked as clean
    
    commit 40aa978eccec61347cd47b97c598df49acde8be5 upstream.
    
    When a writeback or a promotion of a block is completed, the cell of
    that block is removed from the prison, the block is marked as clean, and
    the clear_dirty() callback of the cache policy is called.
    
    Unfortunately, performing those actions in this order allows an incoming
    new write bio for that block to come in before clearing the dirty status
    is completed and therefore possibly causing one of these two scenarios:
    
    Scenario A:
    
    Thread 1                      Thread 2
    cell_defer()                  .
    - cell removed from prison    .
    - detained bios queued        .
    .                             incoming write bio
    .                             remapped to cache
    .                             set_dirty() called,
    .                               but block already dirty
    .                               => it does nothing
    clear_dirty()                 .
    - block marked clean          .
    - policy clear_dirty() called .
    
    Result: Block is marked clean even though it is actually dirty. No
    writeback will occur.
    
    Scenario B:
    
    Thread 1                      Thread 2
    cell_defer()                  .
    - cell removed from prison    .
    - detained bios queued        .
    clear_dirty()                 .
    - block marked clean          .
    .                             incoming write bio
    .                             remapped to cache
    .                             set_dirty() called
    .                             - block marked dirty
    .                             - policy set_dirty() called
    - policy clear_dirty() called .
    
    Result: Block is properly marked as dirty, but policy thinks it is clean
    and therefore never asks us to writeback it.
    This case is visible in "dmsetup status" dirty block count (which
    normally decreases to 0 on a quiet device).
    
    Fix these issues by calling clear_dirty() before calling cell_defer().
    Incoming bios for that block will then be detained in the cell and
    released only after clear_dirty() has completed, so the race will not
    occur.
    
    Found by inspecting the code after noticing spurious dirty counts
    (scenario B).
    
    Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
    Acked-by: Joe Thornber <ejt@redhat.com>
    Signed-off-by: Mike Snitzer <snitzer@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 5f9b9210b5eb01efe35901f7e78aa0204520563a
Author: Keith Busch <keith.busch@intel.com>
Date:   Tue Aug 26 09:05:36 2014 -0600

    block: Fix dev_t minor allocation lifetime
    
    commit 2da78092dda13f1efd26edbbf99a567776913750 upstream.
    
    Releases the dev_t minor when all references are closed to prevent
    another device from acquiring the same major/minor.
    
    Since the partition's release may be invoked from call_rcu's soft-irq
    context, the ext_dev_idr's mutex had to be replaced with a spinlock so
    as not so sleep.
    
    Signed-off-by: Keith Busch <keith.busch@intel.com>
    Signed-off-by: Jens Axboe <axboe@fb.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 0652fc95fb0fa0f35cd4abad26f5eabc0ecf64a3
Author: Thomas Gleixner <tglx@linutronix.de>
Date:   Thu Sep 11 23:44:35 2014 +0200

    futex: Unlock hb->lock in futex_wait_requeue_pi() error path
    
    commit 13c42c2f43b19aab3195f2d357db00d1e885eaa8 upstream.
    
    futex_wait_requeue_pi() calls futex_wait_setup(). If
    futex_wait_setup() succeeds it returns with hb->lock held and
    preemption disabled. Now the sanity check after this does:
    
            if (match_futex(&q.key, &key2)) {
    	   	ret = -EINVAL;
    		goto out_put_keys;
    	}
    
    which releases the keys but does not release hb->lock.
    
    So we happily return to user space with hb->lock held and therefor
    preemption disabled.
    
    Unlock hb->lock before taking the exit route.
    
    Reported-by: Dave "Trinity" Jones <davej@redhat.com>
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Reviewed-by: Darren Hart <dvhart@linux.intel.com>
    Reviewed-by: Davidlohr Bueso <dave@stgolabs.net>
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Link: http://lkml.kernel.org/r/alpine.DEB.2.10.1409112318500.4178@nanos
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 41619333d63259a5c31fc6e29e405698e4f824dc
Author: Tejun Heo <tj@kernel.org>
Date:   Sat Sep 13 04:14:30 2014 +0900

    workqueue: apply __WQ_ORDERED to create_singlethread_workqueue()
    
    commit e09c2c295468476a239d13324ce9042ec4de05eb upstream.
    
    create_singlethread_workqueue() is a compat interface for single
    threaded workqueue which maps to ordered workqueue w/ rescuer in the
    current implementation.  create_singlethread_workqueue() currently
    implemented by invoking alloc_workqueue() w/ appropriate parameters.
    
    8719dceae2f9 ("workqueue: reject adjusting max_active or applying
    attrs to ordered workqueues") introduced __WQ_ORDERED to protect
    ordered workqueues against dynamic attribute changes which can break
    ordering guarantees but forgot to apply it to
    create_singlethread_workqueue().  This in itself is okay as nobody
    currently uses dynamic attribute change on workqueues created with
    create_singlethread_workqueue().
    
    However, 4c16bd327c ("workqueue: implement NUMA affinity for unbound
    workqueues") broke singlethreaded guarantee for ordered workqueues
    through allocating a separate pool_workqueue on each NUMA node by
    default.  A later change 8a2b75384444 ("workqueue: fix ordered
    workqueues in NUMA setups") fixed it by allocating only one global
    pool_workqueue if __WQ_ORDERED is set.
    
    Combined, the __WQ_ORDERED omission in create_singlethread_workqueue()
    became critical breaking its single threadedness and ordering
    guarantee.
    
    Let's make create_singlethread_workqueue() wrap
    alloc_ordered_workqueue() instead so that it inherits __WQ_ORDERED and
    can implicitly track future ordered_workqueue changes.
    
    v2: I missed that __WQ_ORDERED now protects against pwq splitting
        across NUMA nodes and incorrectly described the patch as a
        nice-to-have fix to protect against future dynamic attribute
        usages.  Oleg pointed out that this is actually a critical
        breakage due to 8a2b75384444 ("workqueue: fix ordered workqueues
        in NUMA setups").
    
    Signed-off-by: Tejun Heo <tj@kernel.org>
    Reported-by: Mike Anderson <mike.anderson@us.ibm.com>
    Cc: Oleg Nesterov <onestero@redhat.com>
    Cc: Gustavo Luiz Duarte <gduarte@redhat.com>
    Cc: Tomas Henzl <thenzl@redhat.com>
    Fixes: 4c16bd327c ("workqueue: implement NUMA affinity for unbound workqueues")
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit d5789e7f0b03f86d4f921796007adf30563ddb56
Author: Eyal Shapira <eyal@wizery.com>
Date:   Tue Sep 2 18:39:21 2014 +0300

    iwlwifi: mvm: treat EAPOLs like mgmt frames wrt rate
    
    commit aa11bbf3df026d6b1c6b528bef634fd9de7c2619 upstream.
    
    Using the LQ table which is initially set according to
    the rssi could lead to EAPOLs being sent in high legacy
    rates like 54mbps.
    It's better to avoid sending EAPOLs in high rates as it reduces
    the chances of a successful 4-Way handshake.
    Avoid this and treat them like other mgmt frames which would
    initially get sent at the basic rate.
    
    Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com>
    Reviewed-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 78563f7b6196e02ce2da8856c60015bec6741cac
Author: Eliad Peller <eliad@wizery.com>
Date:   Tue Aug 26 11:23:11 2014 +0300

    iwlwifi: increase DEFAULT_MAX_TX_POWER
    
    commit 22d059a5c7c5de61e53c88e30b65e55fbfd91e91 upstream.
    
    The chip is able to transmit up to 22dBm, so set
    the constant appropriately.
    
    Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
    Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit fef5f384937961e16f037b17ec5284ddf5d7e0e4
Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Date:   Thu Jul 31 14:32:37 2014 +0300

    iwlwifi: mvm: fix endianity issues with Smart Fifo commands
    
    commit 86974bff066dd8b98be46d7c7d3aba89034f0833 upstream.
    
    This code was broken on big endian systems. Sparse didn't
    catch the bug since the firmware command was not tagged as
    little endian.
    Fix the bug for big endian systems and tag the field in the
    firmware command to prevent such issues in the future.
    
    Fixes: 1f3b0ff8ec ("iwlwifi: mvm: Add Smart FIFO support")
    Reviewed-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 253ba6c8856b9f00bca7fd32d170d9f319039aa7
Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Date:   Sun Aug 31 22:11:11 2014 +0300

    Revert "iwlwifi: dvm: don't enable CTS to self"
    
    commit f47f46d7b09cf1d09e4b44b6cc4dd7d68a08028c upstream.
    
    This reverts commit 43d826ca5979927131685cc2092c7ce862cb91cd.
    
    This commit caused packet loss.
    
    Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 86fdf9ed355b37df7ca19bfa47f399494935a00d
Author: Mike Christie <michaelc@cs.wisc.edu>
Date:   Wed Sep 3 00:00:39 2014 -0500

    SCSI: libiscsi: fix potential buffer overrun in __iscsi_conn_send_pdu
    
    commit db9bfd64b14a3a8f1868d2164518fdeab1b26ad1 upstream.
    
    This patches fixes a potential buffer overrun in __iscsi_conn_send_pdu.
    This function is used by iscsi drivers and userspace to send iscsi PDUs/
    commands. For login commands, we have a set buffer size. For all other
    commands we do not support data buffers.
    
    This was reported by Dan Carpenter here:
    http://www.spinics.net/lists/linux-scsi/msg66838.html
    
    Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
    Reviewed-by: Sagi Grimberg <sagig@mellanox.com>
    Signed-off-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: James Bottomley <JBottomley@Parallels.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 621f496ffae1da0095a4f7b0338821bb25225323
Author: Dan Carpenter <dan.carpenter@oracle.com>
Date:   Mon Sep 1 20:27:29 2014 +0300

    NFC: microread: Potential overflows in microread_target_discovered()
    
    commit d07f1e8600ccb885c8f4143402b8912f7d827bcb upstream.
    
    Smatch says that skb->data is untrusted so we need to check to make sure
    that the memcpy() doesn't overflow.
    
    Fixes: cfad1ba87150 ('NFC: Initial support for Inside Secure microread')
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit f3c8aba3bc795c2241aeaf3d1e92ab4d5a6c0682
Author: Nicholas Bellinger <nab@linux-iscsi.org>
Date:   Wed Sep 17 11:45:17 2014 -0700

    iscsi-target: Fix memory corruption in iscsit_logout_post_handler_diffcid
    
    commit b53b0d99d6fbf7d44330395349a895521cfdbc96 upstream.
    
    This patch fixes a bug in iscsit_logout_post_handler_diffcid() where
    a pointer used as storage for list_for_each_entry() was incorrectly
    being used to determine if no matching entry had been found.
    
    This patch changes iscsit_logout_post_handler_diffcid() to key off
    bool conn_found to determine if the function needs to exit early.
    
    Reported-by: Joern Engel <joern@logfs.org>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit b329630e27bcbcbc12e4b29d5bdbb82b5702968b
Author: Joern Engel <joern@logfs.org>
Date:   Tue Sep 2 17:49:54 2014 -0400

    iscsi-target: avoid NULL pointer in iscsi_copy_param_list failure
    
    commit 8ae757d09c45102b347a1bc2867f54ffc1ab8fda upstream.
    
    In iscsi_copy_param_list() a failed iscsi_param_list memory allocation
    currently invokes iscsi_release_param_list() to cleanup, and will promptly
    trigger a NULL pointer dereference.
    
    Instead, go ahead and return for the first iscsi_copy_param_list()
    failure case.
    
    Found by coverity.
    
    Signed-off-by: Joern Engel <joern@logfs.org>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 2a46c329707bb19180960f59580e6d33d61c6368
Author: Sebastian Herbszt <herbszt@gmx.de>
Date:   Mon Sep 1 00:17:53 2014 +0200

    target: Fix inverted logic in SE_DEV_ALUA_SUPPORT_STATE_STORE
    
    commit 1f0b030c45c781f9fe568e5e2a813d6c8567a051 upstream.
    
    Fix inverted logic in SE_DEV_ALUA_SUPPORT_STATE_STORE for setting
    the supported ALUA access states via configfs, originally introduced
    in commit b0a382c5.
    
    A value of 1 should enable the support, not disable it.
    
    Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit c103904716b14a07a102db2ed425c5c7ac18cf58
Author: Sagi Grimberg <sagig@mellanox.com>
Date:   Wed Jul 2 16:19:25 2014 +0300

    Target/iser: Don't put isert_conn inside disconnected handler
    
    commit 0fc4ea701fcf5bc51ace4e288af5be741465f776 upstream.
    
    disconnected_handler is invoked on several CM events (such
    as DISCONNECTED, DEVICE_REMOVAL, TIMEWAIT_EXIT...). Since
    multiple  events can occur while before isert_free_conn is
    invoked, we might put all isert_conn references and free
    the connection too early.
    
    Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit a659b62daed52ec4427975a6825d6e8ad8371bc1
Author: Sagi Grimberg <sagig@mellanox.com>
Date:   Wed Jul 2 16:19:24 2014 +0300

    Target/iser: Get isert_conn reference once got to connected_handler
    
    commit c2f88b17a1d97ca4ecd96cc22333a7a4f1407d39 upstream.
    
    In case the connection didn't reach connected state, disconnected
    handler will never be invoked thus the second kref_put on
    isert_conn will be missing.
    
    Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit cc97152a71882eb513da24549d233fdf79cf9611
Author: Johannes Pointner <johannes.pointner@gmail.com>
Date:   Mon Aug 25 09:04:00 2014 +0100

    iio:inkern: fix overwritten -EPROBE_DEFER in of_iio_channel_get_by_name
    
    commit 872687f626e033b4ddfaec1e410057cfc6636d77 upstream.
    
    Fixes: a2c12493ed7e ('iio: of_iio_channel_get_by_name() returns non-null pointers for error legs')
    
    which improperly assumes that of_iio_channel_get_by_name must always
    return NULL and thus now hides -EPROBE_DEFER.
    
    Signed-off-by: Johannes Pointner <johannes.pointner@br-automation.com>
    Reviewed-by: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: Jonathan Cameron <jic23@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 4dd3e84596137f28fbc557281276460154300766
Author: Denis CIOCCA <denis.ciocca@st.com>
Date:   Thu Oct 9 13:55:00 2014 +0100

    iio:magnetometer: bugfix magnetometers gain values
    
    commit a31d0928999fbf33b3a6042e8bcb7b7f7e07d094 upstream.
    
    This patch fix gains values. The first driver was designed using
    engineering samples, in mass production the values are changed.
    
    Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
    Signed-off-by: Jonathan Cameron <jic23@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 9d9032ee5e1cf1e7198caa375b81d3c1a429d1da
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Fri Aug 22 21:48:00 2014 +0100

    iio: adc: ad_sigma_delta: Fix indio_dev->trig assignment
    
    commit 9e5846be33277802c0c76e5c12825d0e4d27f639 upstream.
    
    This can result in wrong reference count for trigger device, call
    iio_trigger_get to increment reference.
    Refer to http://www.spinics.net/lists/linux-iio/msg13669.html for discussion
    with Jonathan.
    
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Acked-by: Lars-Peter Clausen <lars@metafoo.de>
    Signed-off-by: Jonathan Cameron <jic23@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 894c1857bb709dcbf083f9df496862ef6176924f
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Fri Aug 22 21:48:00 2014 +0100

    iio: st_sensors: Fix indio_dev->trig assignment
    
    commit f0e84acd7056e6d7ade551c6439531606ae30a46 upstream.
    
    This can result in wrong reference count for trigger device, call
    iio_trigger_get to increment reference.
    Refer to http://www.spinics.net/lists/linux-iio/msg13669.html for discussion
    with Jonathan.
    
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Signed-off-by: Jonathan Cameron <jic23@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 41006a254184fa02401ff661161f04e53b136d49
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Fri Aug 22 21:48:00 2014 +0100

    iio: meter: ade7758: Fix indio_dev->trig assignment
    
    commit 0495081179212b758775df752e657ea71dcae020 upstream.
    
    This can result in wrong reference count for trigger device, call
    iio_trigger_get to increment reference.
    Refer to http://www.spinics.net/lists/linux-iio/msg13669.html for discussion
    with Jonathan.
    
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Acked-by: Lars-Peter Clausen <lars@metafoo.de>
    Signed-off-by: Jonathan Cameron <jic23@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit fb5ac57e3553688c830d7eb0dba24290ce9ed435
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Fri Aug 22 21:48:00 2014 +0100

    iio: inv_mpu6050: Fix indio_dev->trig assignment
    
    commit b07e3b3850b2e1f09c19f54d3ed7210d9f529e2c upstream.
    
    This can result in wrong reference count for trigger device, call
    iio_trigger_get to increment reference.
    Refer to http://www.spinics.net/lists/linux-iio/msg13669.html for discussion
    with Jonathan.
    
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Signed-off-by: Jonathan Cameron <jic23@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 1f5fa19d88bd9457894e9ae8e49d15244c46d783
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Fri Aug 22 21:48:00 2014 +0100

    iio: gyro: itg3200: Fix indio_dev->trig assignment
    
    commit 0b4dce2ee694a991ef38203ec5ff91a738518cb3 upstream.
    
    This can result in wrong reference count for trigger device, call
    iio_trigger_get to increment reference.
    Refer to http://www.spinics.net/lists/linux-iio/msg13669.html for discussion
    with Jonathan.
    
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Signed-off-by: Jonathan Cameron <jic23@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit a0fc0505484573206b3cc57d68cdb23a569ede6e
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Fri Aug 22 21:48:00 2014 +0100

    iio: hid_sensor_hub: Fix indio_dev->trig assignment
    
    commit 55a6f9ddfdea0d2d343cd1b39baf8aa752664b6e upstream.
    
    This can result in wrong reference count for trigger device, call
    iio_trigger_get to increment reference.
    Refer to http://www.spinics.net/lists/linux-iio/msg13669.html for discussion
    with Jonathan.
    
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Signed-off-by: Jonathan Cameron <jic23@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit fea5cc864b8c8f493baa5f26c581df5f98027f86
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Fri Aug 22 21:48:00 2014 +0100

    iio: accel: bma180: Fix indio_dev->trig assignment
    
    commit 0668a4e4d297328ce08b44d91d160537596115e2 upstream.
    
    This can result in wrong reference count for trigger device, call
    iio_trigger_get to increment reference.
    Refer to http://www.spinics.net/lists/linux-iio/msg13669.html for discussion
    with Jonathan.
    
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Signed-off-by: Jonathan Cameron <jic23@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit c4daafb17b3022c0f61e39ae5266af39d2f0f6d2
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Fri Aug 22 21:48:00 2014 +0100

    iio:trigger: modify return value for iio_trigger_get
    
    commit f153566570fb9e32c2f59182883f4f66048788fb upstream.
    
    Instead of a void function, return the trigger pointer.
    
    Whilst not in of itself a fix, this makes the following set of
    7 fixes cleaner than they would otherwise be.
    
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Signed-off-by: Jonathan Cameron <jic23@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit d51afb094e833d28085f2a6c35b179260d981bb2
Author: Steve French <smfrench@gmail.com>
Date:   Sun Sep 14 23:27:09 2014 -0500

    SMB3: Fix oops when creating symlinks on smb3
    
    commit da80659d4aa758dc6935b10ec64513f0b67bc969 upstream.
    
    We were not checking for symlink support properly for SMB2/SMB3
    mounts so could oops when mounted with mfsymlinks when try
    to create symlink when mfsymlinks on smb2/smb3 mounts
    
    Signed-off-by: Steve French <smfrench@gmail.com>
    CC: Sachin Prabhu <sprabhu@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 8e3006d02b46a722729a3bbd6a774eae99c6c8b8
Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
Date:   Thu Sep 4 10:52:53 2014 +0300

    ASoC: davinci-mcasp: Correct rx format unit configuration
    
    commit fe0a29e163a5d045c73faab682a8dac71c2f8012 upstream.
    
    In case of capture we should not use rotation. The reverse and mask is
    enough to get the data align correctly from the bus to MCU:
    Format	  data from bus    after reverse (XRBUF)
    S16_LE:  |LSB|MSB|xxx|xxx|  |xxx|xxx|MSB|LSB|
    S24_3LE: |LSB|DAT|MSB|xxx|  |xxx|MSB|DAT|LSB|
    S24_LE:  |LSB|DAT|MSB|xxx|  |xxx|MSB|DAT|LSB|
    S32_LE:  |LSB|DAT|DAT|MSB|  |MSB|DAT|DAT|LSB|
    
    With this patch all supported formats will work for playback and capture.
    
    Reported-by: Jyri Sarha <jsarha@ti.com> (broken S24_3LE capture)
    Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit e47c229565045d62370c2298d1e42a1e7cb49e7a
Author: Miklos Szeredi <mszeredi@suse.cz>
Date:   Wed Sep 24 17:56:17 2014 +0200

    shmem: fix nlink for rename overwrite directory
    
    commit b928095b0a7cff7fb9fcf4c706348ceb8ab2c295 upstream.
    
    If overwriting an empty directory with rename, then need to drop the extra
    nlink.
    
    Test prog:
    
    #include <stdio.h>
    #include <fcntl.h>
    #include <err.h>
    #include <sys/stat.h>
    
    int main(void)
    {
    	const char *test_dir1 = "test-dir1";
    	const char *test_dir2 = "test-dir2";
    	int res;
    	int fd;
    	struct stat statbuf;
    
    	res = mkdir(test_dir1, 0777);
    	if (res == -1)
    		err(1, "mkdir(\"%s\")", test_dir1);
    
    	res = mkdir(test_dir2, 0777);
    	if (res == -1)
    		err(1, "mkdir(\"%s\")", test_dir2);
    
    	fd = open(test_dir2, O_RDONLY);
    	if (fd == -1)
    		err(1, "open(\"%s\")", test_dir2);
    
    	res = rename(test_dir1, test_dir2);
    	if (res == -1)
    		err(1, "rename(\"%s\", \"%s\")", test_dir1, test_dir2);
    
    	res = fstat(fd, &statbuf);
    	if (res == -1)
    		err(1, "fstat(%i)", fd);
    
    	if (statbuf.st_nlink != 0) {
    		fprintf(stderr, "nlink is %lu, should be 0\n", statbuf.st_nlink);
    		return 1;
    	}
    
    	return 0;
    }
    
    Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
    Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 0c8fed7d9e198347cd9b5ece3dd0010dc507957d
Author: Kees Cook <keescook@chromium.org>
Date:   Thu Sep 11 09:19:31 2014 -0700

    x86/kaslr: Avoid the setup_data area when picking location
    
    commit 0cacbfbeb5077b63d5d3cf6df88b14ac12ad584b upstream.
    
    The KASLR location-choosing logic needs to avoid the setup_data
    list memory areas as well. Without this, it would be possible to
    have the ASLR position stomp on the memory, ultimately causing
    the boot to fail.
    
    Signed-off-by: Kees Cook <keescook@chromium.org>
    Tested-by: Baoquan He <bhe@redhat.com>
    Cc: Vivek Goyal <vgoyal@redhat.com>
    Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Cc: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
    Cc: Pavel Machek <pavel@ucw.cz>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Link: http://lkml.kernel.org/r/20140911161931.GA12001@www.outflux.net
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit c2e334db0bee922a06a40d08bbdce1359dcda1ed
Author: Dave Young <dyoung@redhat.com>
Date:   Tue Aug 26 17:06:41 2014 +0800

    x86 early_ioremap: Increase FIX_BTMAPS_SLOTS to 8
    
    commit 3eddc69ffeba092d288c386646bfa5ec0fce25fd upstream.
    
    3.16 kernel boot fail with earlyprintk=efi, it keeps scrolling at the
    bottom line of screen.
    
    Bisected, the first bad commit is below:
    commit 86dfc6f339886559d80ee0d4bd20fe5ee90450f0
    Author: Lv Zheng <lv.zheng@intel.com>
    Date:   Fri Apr 4 12:38:57 2014 +0800
    
        ACPICA: Tables: Fix table checksums verification before installation.
    
    I did some debugging by enabling both serial and efi earlyprintk, below is
    some debug dmesg, seems early_ioremap fails in scroll up function due to
    no free slot, see below dmesg output:
    
      WARNING: CPU: 0 PID: 0 at mm/early_ioremap.c:116 __early_ioremap+0x90/0x1c4()
      __early_ioremap(ed00c800, 00000c80) not found slot
      Modules linked in:
      CPU: 0 PID: 0 Comm: swapper Not tainted 3.17.0-rc1+ #204
      Hardware name: Hewlett-Packard HP Z420 Workstation/1589, BIOS J61 v03.15 05/09/2013
      Call Trace:
        dump_stack+0x4e/0x7a
        warn_slowpath_common+0x75/0x8e
        ? __early_ioremap+0x90/0x1c4
        warn_slowpath_fmt+0x47/0x49
        __early_ioremap+0x90/0x1c4
        ? sprintf+0x46/0x48
        early_ioremap+0x13/0x15
        early_efi_map+0x24/0x26
        early_efi_scroll_up+0x6d/0xc0
        early_efi_write+0x1b0/0x214
        call_console_drivers.constprop.21+0x73/0x7e
        console_unlock+0x151/0x3b2
        ? vprintk_emit+0x49f/0x532
        vprintk_emit+0x521/0x532
        ? console_unlock+0x383/0x3b2
        printk+0x4f/0x51
        acpi_os_vprintf+0x2b/0x2d
        acpi_os_printf+0x43/0x45
        acpi_info+0x5c/0x63
        ? __acpi_map_table+0x13/0x18
        ? acpi_os_map_iomem+0x21/0x147
        acpi_tb_print_table_header+0x177/0x186
        acpi_tb_install_table_with_override+0x4b/0x62
        acpi_tb_install_standard_table+0xd9/0x215
        ? early_ioremap+0x13/0x15
        ? __acpi_map_table+0x13/0x18
        acpi_tb_parse_root_table+0x16e/0x1b4
        acpi_initialize_tables+0x57/0x59
        acpi_table_init+0x50/0xce
        acpi_boot_table_init+0x1e/0x85
        setup_arch+0x9b7/0xcc4
        start_kernel+0x94/0x42d
        ? early_idt_handlers+0x120/0x120
        x86_64_start_reservations+0x2a/0x2c
        x86_64_start_kernel+0xf3/0x100
    
    Quote reply from Lv.zheng about the early ioremap slot usage in this case:
    
    """
    In early_efi_scroll_up(), 2 mapping entries will be used for the src/dst screen buffer.
    In drivers/acpi/acpica/tbutils.c, we've improved the early table loading code in acpi_tb_parse_root_table().
    We now need 2 mapping entries:
    1. One mapping entry is used for RSDT table mapping. Each RSDT entry contains an address for another ACPI table.
    2. For each entry in RSDP, we need another mapping entry to map the table to perform necessary check/override before installing it.
    
    When acpi_tb_parse_root_table() prints something through EFI earlyprintk console, we'll have 4 mapping entries used.
    The current 4 slots setting of early_ioremap() seems to be too small for such a use case.
    """
    
    Thus increase the slot to 8 in this patch to fix this issue.
    boot-time mappings become 512 page with this patch.
    
    Signed-off-by: Dave Young <dyoung@redhat.com>
    Signed-off-by: Matt Fleming <matt.fleming@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 7fad1f4c34b4321a23946178415b1705f67af460
Author: Stefan Bader <stefan.bader@canonical.com>
Date:   Tue Sep 2 11:16:01 2014 +0100

    x86/xen: don't copy bogus duplicate entries into kernel page tables
    
    commit 0b5a50635fc916cf46e3de0b819a61fc3f17e7ee upstream.
    
    When RANDOMIZE_BASE (KASLR) is enabled; or the sum of all loaded
    modules exceeds 512 MiB, then loading modules fails with a warning
    (and hence a vmalloc allocation failure) because the PTEs for the
    newly-allocated vmalloc address space are not zero.
    
      WARNING: CPU: 0 PID: 494 at linux/mm/vmalloc.c:128
               vmap_page_range_noflush+0x2a1/0x360()
    
    This is caused by xen_setup_kernel_pagetables() copying
    level2_kernel_pgt into level2_fixmap_pgt, overwriting many non-present
    entries.
    
    Without KASLR, the normal kernel image size only covers the first half
    of level2_kernel_pgt and module space starts after that.
    
    L4[511]->level3_kernel_pgt[510]->level2_kernel_pgt[  0..255]->kernel
                                                      [256..511]->module
                              [511]->level2_fixmap_pgt[  0..505]->module
    
    This allows 512 MiB of of module vmalloc space to be used before
    having to use the corrupted level2_fixmap_pgt entries.
    
    With KASLR enabled, the kernel image uses the full PUD range of 1G and
    module space starts in the level2_fixmap_pgt. So basically:
    
    L4[511]->level3_kernel_pgt[510]->level2_kernel_pgt[0..511]->kernel
                              [511]->level2_fixmap_pgt[0..505]->module
    
    And now no module vmalloc space can be used without using the corrupt
    level2_fixmap_pgt entries.
    
    Fix this by properly converting the level2_fixmap_pgt entries to MFNs,
    and setting level1_fixmap_pgt as read-only.
    
    A number of comments were also using the the wrong L3 offset for
    level2_kernel_pgt.  These have been corrected.
    
    Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 2aebee063b7a1dc2faacdac5cba50676c3cf4eca
Author: Ross Lagerwall <ross.lagerwall@citrix.com>
Date:   Mon Aug 18 10:41:36 2014 +0100

    xen/manage: Always freeze/thaw processes when suspend/resuming
    
    commit 61a734d305e16944b42730ef582a7171dc733321 upstream.
    
    Always freeze processes when suspending and thaw processes when resuming
    to prevent a race noticeable with HVM guests.
    
    This prevents a deadlock where the khubd kthread (which is designed to
    be freezable) acquires a usb device lock and then tries to allocate
    memory which requires the disk which hasn't been resumed yet.
    Meanwhile, the xenwatch thread deadlocks waiting for the usb device
    lock.
    
    Freezing processes fixes this because the khubd thread is only thawed
    after the xenwatch thread finishes resuming all the devices.
    
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 2bc5712526beb5842eb4d9e3c7668066004aa14d
Author: Christian Borntraeger <borntraeger@de.ibm.com>
Date:   Tue Aug 19 16:19:35 2014 +0200

    KVM: s390/mm: try a cow on read only pages for key ops
    
    commit ab3f285f227fec62868037e9b1b1fd18294a83b8 upstream.
    
    The PFMF instruction handler  blindly wrote the storage key even if
    the page was mapped R/O in the host. Lets try a COW before continuing
    and bail out in case of errors.
    
    Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
    Reviewed-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit b71635775a36d1636f3de84a4d741febe049ad40
Author: Zefan Li <lizefan@huawei.com>
Date:   Thu Sep 18 17:28:46 2014 +0800

    cgroup: fix unbalanced locking
    
    commit eb4aec84d6bdf98d00cedb41c18000f7a31e648a upstream.
    
    cgroup_pidlist_start() holds cgrp->pidlist_mutex and then calls
    pidlist_array_load(), and cgroup_pidlist_stop() releases the mutex.
    
    It is wrong that we release the mutex in the failure path in
    pidlist_array_load(), because cgroup_pidlist_stop() will be called
    no matter if cgroup_pidlist_start() returns errno or not.
    
    Fixes: 4bac00d16a8760eae7205e41d2c246477d42a210
    Signed-off-by: Zefan Li <lizefan@huawei.com>
    Signed-off-by: Tejun Heo <tj@kernel.org>
    Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 79c770cb58596b91c2e07a39090401fcc580cc14
Author: Mark Brown <broonie@linaro.org>
Date:   Wed Aug 27 13:09:12 2014 +0100

    regmap: Don't attempt block writes when syncing cache on single_rw devices
    
    commit 5c1ebe7f73f9166893c3459915db8a09d6d1d715 upstream.
    
    If the device can't support block writes then don't attempt to use raw
    syncing which will automatically generate block writes for adjacent
    registers, use the existing _single() block syncing implementation.
    
    Reported-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
    Tested-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
    Signed-off-by: Mark Brown <broonie@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 83c40254d2ab977aa87c3e424c8b82ceb422d8be
Author: Mark Brown <broonie@linaro.org>
Date:   Tue Aug 26 12:12:17 2014 +0100

    regmap: Fix handling of volatile registers for format_write() chips
    
    commit 5844a8b9d98ec11ce1d77610daacf3f0a0e14715 upstream.
    
    A previous over-zealous factorisation of code means that we only treat
    registers as volatile if they are readable. For most devices this is fine
    since normally most registers can be read and volatility implies
    readability but for format_write() devices where there is no readback from
    the hardware and we use volatility to mean simply uncacheability this means
    that we end up treating all registers as cacheble.
    
    A bigger refactoring of the code to clarify this is in order but as a fix
    make a minimal change and only check readability when checking volatility
    if there is no format_write() operation defined for the device.
    
    Signed-off-by: Mark Brown <broonie@linaro.org>
    Tested-by: Lars-Peter Clausen <lars@metafoo.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit c4280b28cd3e96b3c838edb61ef1590402864cb3
Author: Tang Chen <tangchen@cn.fujitsu.com>
Date:   Fri Aug 29 15:18:31 2014 -0700

    memblock, memhotplug: fix wrong type in memblock_find_in_range_node().
    
    commit 0cfb8f0c3e21e36d4a6e472e4c419d58ba848698 upstream.
    
    In memblock_find_in_range_node(), we defined ret as int.  But it should
    be phys_addr_t because it is used to store the return value from
    __memblock_find_range_bottom_up().
    
    The bug has not been triggered because when allocating low memory near
    the kernel end, the "int ret" won't turn out to be negative.  When we
    started to allocate memory on other nodes, and the "int ret" could be
    minus.  Then the kernel will panic.
    
    A simple way to reproduce this: comment out the following code in
    numa_init(),
    
            memblock_set_bottom_up(false);
    
    and the kernel won't boot.
    
    Reported-by: Xishi Qiu <qiuxishi@huawei.com>
    Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com>
    Tested-by: Xishi Qiu <qiuxishi@huawei.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit c4787ea318f2fa31b167e3d43c89570c1694ff18
Author: Mika Westerberg <mika.westerberg@linux.intel.com>
Date:   Fri Sep 12 11:33:10 2014 +0300

    ACPI / scan: Correct error return value of create_modalias()
    
    commit 98d28d0e59160d2d6cb3f6a9050723ac40f89669 upstream.
    
    There is a typo, it should be negative -errno instead.
    
    Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit b8b1c4733133c6fb536cdd0a5d54eb1d5165a0a7
Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Date:   Sun Sep 21 02:58:18 2014 +0200

    ACPI / hotplug: Generate online uevents for ACPI containers
    
    commit 8ab17fc92e49bc2b8fff9d220c19bf50ec9c1158 upstream.
    
    Commit 46394fd01 (ACPI / hotplug: Move container-specific code out of
    the core) removed the generation of "online" uevents for containers,
    because "add" uevents are now generated for them automatically when
    container system devices are registered.  However, there are user
    space tools that need to be notified when the container and all of
    its children have been enumerated, which doesn't happen any more.
    
    For this reason, add a mechanism allowing "online" uevents to be
    generated for ACPI containers after enumerating the container along
    with all of its children.
    
    Fixes: 46394fd01 (ACPI / hotplug: Move container-specific code out of the core)
    Reported-and-tested-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit f42d85b90f364ecdc7cf42796c225123a8b79d44
Author: Bob Moore <Robert.Moore@intel.com>
Date:   Tue Sep 23 10:35:47 2014 +0800

    ACPICA: Update to GPIO region handler interface.
    
    commit 75ec6e55f1384548311a13ce4fcb39c516053314 upstream.
    
    Changes to correct several GPIO issues:
    
    1) The update_rule in a GPIO field definition is now ignored;
    a read-modify-write operation is never performed for GPIO fields.
    (Internally, this means that the field assembly/disassembly
    code is completely bypassed for GPIO.)
    
    2) The Address parameter passed to a GPIO region handler is
    now the bit offset of the field from a previous Connection()
    operator. Thus, it becomes a "Pin Number Index" into the
    Connection() resource descriptor.
    
    3) The bit_width parameter passed to a GPIO region handler is
    now the exact bit width of the GPIO field. Thus, it can be
    interpreted as "number of pins".
    
    Overall, we can now say that the region handler interface
    to GPIO handlers is a raw "bit/pin" addressed interface, not
    a byte-addressed interface like the system_memory handler interface.
    
    Signed-off-by: Bob Moore <robert.moore@intel.com>
    Signed-off-by: Lv Zheng <lv.zheng@intel.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 5817aa118030818c6a78647fcd76b5863a0acf14
Author: Markos Chandras <markos.chandras@imgtec.com>
Date:   Tue Sep 16 15:55:12 2014 +0100

    MIPS: mcount: Adjust stack pointer for static trace in MIPS32
    
    commit 8a574cfa2652545eb95595d38ac2a0bb501af0ae upstream.
    
    Every mcount() call in the MIPS 32-bit kernel is done as follows:
    
    [...]
    move at, ra
    jal _mcount
    addiu sp, sp, -8
    [...]
    
    but upon returning from the mcount() function, the stack pointer
    is not adjusted properly. This is explained in details in 58b69401c797
    (MIPS: Function tracer: Fix broken function tracing).
    
    Commit ad8c396936e3 ("MIPS: Unbreak function tracer for 64-bit kernel.)
    fixed the stack manipulation for 64-bit but it didn't fix it completely
    for MIPS32.
    
    Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/7792/
    Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 6eabef04594800ce4f5c12422896808db1570d19
Author: Aurelien Jarno <aurelien@aurel32.net>
Date:   Sun Jul 20 19:58:23 2014 +0200

    MIPS: ZBOOT: add missing <linux/string.h> include
    
    commit 29593fd5a8149462ed6fad0d522234facdaee6c8 upstream.
    
    Commit dc4d7b37 (MIPS: ZBOOT: gather string functions into string.c)
    moved the string related functions into a separate file, which might
    cause the following build error, depending on the configuration:
    
    | CC      arch/mips/boot/compressed/decompress.o
    | In file included from linux/arch/mips/boot/compressed/../../../../lib/decompress_unxz.c:234:0,
    |                  from linux/arch/mips/boot/compressed/decompress.c:67:
    | linux/arch/mips/boot/compressed/../../../../lib/xz/xz_dec_stream.c: In function 'fill_temp':
    | linux/arch/mips/boot/compressed/../../../../lib/xz/xz_dec_stream.c:162:2: error: implicit declaration of function 'memcpy' [-Werror=implicit-function-declaration]
    | cc1: some warnings being treated as errors
    | linux/scripts/Makefile.build:308: recipe for target 'arch/mips/boot/compressed/decompress.o' failed
    | make[6]: *** [arch/mips/boot/compressed/decompress.o] Error 1
    | linux/arch/mips/Makefile:308: recipe for target 'vmlinuz' failed
    
    It does not fail with the standard configuration, as when
    CONFIG_DYNAMIC_DEBUG is not enabled <linux/string.h> gets included in
    include/linux/dynamic_debug.h. There might be other ways for it to
    get indirectly included.
    
    We can't add the include directly in xz_dec_stream.c as some
    architectures might want to use a different version for the boot/
    directory (see for example arch/x86/boot/string.h).
    
    Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/7420/
    Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 0e6e86628cab20f176164e1a7390a4a2441a9ab5
Author: Nathan Lynch <nathan_lynch@mentor.com>
Date:   Mon Sep 29 19:11:36 2014 +0100

    ARM: 8178/1: fix set_tls for !CONFIG_KUSER_HELPERS
    
    commit 9cc6d9e5daaa147a9a3e31557efcb331989e77be upstream.
    
    Joachim Eastwood reports that commit fbfb872f5f41 "ARM: 8148/1: flush
    TLS and thumbee register state during exec" causes a boot-time crash
    on a Cortex-M4 nommu system:
    
    Freeing unused kernel memory: 68K (281e5000 - 281f6000)
    Unhandled exception: IPSR = 00000005 LR = fffffff1
    CPU: 0 PID: 1 Comm: swapper Not tainted 3.17.0-rc6-00313-gd2205fa30aa7 #191
    task: 29834000 ti: 29832000 task.ti: 29832000
    PC is at flush_thread+0x2e/0x40
    LR is at flush_thread+0x21/0x40
    pc : [<2800954a>] lr : [<2800953d>] psr: 4100000b
    sp : 29833d60 ip : 00000000 fp : 00000001
    r10: 00003cf8 r9 : 29b1f000 r8 : 00000000
    r7 : 29b0bc00 r6 : 29834000 r5 : 29832000 r4 : 29832000
    r3 : ffff0ff0 r2 : 29832000 r1 : 00000000 r0 : 282121f0
    xPSR: 4100000b
    CPU: 0 PID: 1 Comm: swapper Not tainted 3.17.0-rc6-00313-gd2205fa30aa7 #191
    [<2800afa5>] (unwind_backtrace) from [<2800a327>] (show_stack+0xb/0xc)
    [<2800a327>] (show_stack) from [<2800a963>] (__invalid_entry+0x4b/0x4c)
    
    The problem is that set_tls is attempting to clear the TLS location in
    the kernel-user helper page, which isn't set up on V7M.
    
    Fix this by guarding the write to the kuser helper page with
    a CONFIG_KUSER_HELPERS ifdef.
    
    Fixes: fbfb872f5f41 ARM: 8148/1: flush TLS and thumbee register state during exec
    
    Reported-by: Joachim Eastwood <manabian@gmail.com>
    Tested-by: Joachim Eastwood <manabian@gmail.com>
    Signed-off-by: Nathan Lynch <nathan_lynch@mentor.com>
    Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit bc220f5821693a670e2eca118188ea57eea695d6
Author: Robin Murphy <robin.murphy@arm.com>
Date:   Thu Sep 25 11:56:19 2014 +0100

    ARM: 8165/1: alignment: don't break misaligned NEON load/store
    
    commit 5ca918e5e3f9df4634077c06585c42bc6a8d699a upstream.
    
    The alignment fixup incorrectly decodes faulting ARM VLDn/VSTn
    instructions (where the optional alignment hint is given but incorrect)
    as LDR/STR, leading to register corruption. Detect these and correctly
    treat them as unhandled, so that userspace gets the fault it expects.
    
    Reported-by: Simon Hosie <simon.hosie@arm.com>
    Signed-off-by: Robin Murphy <robin.murphy@arm.com>
    Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit d164cc67d028228ac8f216930aec3442c47321bc
Author: Nathan Lynch <nathan_lynch@mentor.com>
Date:   Thu Sep 11 02:49:08 2014 +0100

    ARM: 8148/1: flush TLS and thumbee register state during exec
    
    commit fbfb872f5f417cea48760c535e0ff027c88b507a upstream.
    
    The TPIDRURO and TPIDRURW registers need to be flushed during exec;
    otherwise TLS information is potentially leaked.  TPIDRURO in
    particular needs careful treatment.  Since flush_thread basically
    needs the same code used to set the TLS in arm_syscall, pull that into
    a common set_tls helper in tls.h and use it in both places.
    
    Similarly, TEEHBR needs to be cleared during exec as well.  Clearing
    its save slot in thread_info isn't right as there is no guarantee
    that a thread switch will occur before the new program runs.  Just
    setting the register directly is sufficient.
    
    Signed-off-by: Nathan Lynch <nathan_lynch@mentor.com>
    Acked-by: Will Deacon <will.deacon@arm.com>
    Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 7c2fbe441dc19dc9a701b1bc4c588ca97091792b
Author: Sudeep Holla <sudeep.holla@arm.com>
Date:   Mon Sep 1 17:14:29 2014 +0100

    ARM: 8133/1: use irq_set_affinity with force=false when migrating irqs
    
    commit a040803a9d6b8c1876d3487a5cb69602ebcbb82c upstream.
    
    Since commit 1dbfa187dad ("ARM: irq migration: force migration off CPU
    going down") the ARM interrupt migration code on cpu offline calls
    irqchip.irq_set_affinity() with the argument force=true. At the point
    of this change the argument had no effect because it was not used by
    any interrupt chip driver and there was no semantics defined.
    
    This changed with commit 01f8fa4f01d8 ("genirq: Allow forcing cpu
    affinity of interrupts") which made the force argument useful to route
    interrupts to not yet online cpus without checking the target cpu
    against the cpu online mask. The following commit ffde1de64012
    ("irqchip: gic: Support forced affinity setting") implemented this for
    the GIC interrupt controller.
    
    As a consequence the ARM cpu offline irq migration fails if CPU0 is
    offlined, because CPU0 is still set in the affinity mask and the
    validataion against cpu online mask is skipped to the force argument
    being true. The following first_cpu(mask) selection always selects
    CPU0 as the target.
    
    Solve the issue by calling irq_set_affinity() with force=false from
    the CPU offline irq migration code so the GIC driver validates the
    affinity mask against CPU online mask and therefore removes CPU0 from
    the possible target candidates.
    
    Tested on TC2 hotpluging CPU0 in and out. Without this patch the system
    locks up as the IRQs are not migrated away from CPU0.
    
    Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
    Acked-by: Thomas Gleixner <tglx@linutronix.de>
    Acked-by: Mark Rutland <mark.rutland@arm.com>
    Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 9858dc8663c7cecb94385c810c4e024af122af3d
Author: Nishanth Menon <nm@ti.com>
Date:   Thu Sep 4 08:33:37 2014 -0500

    ARM: dts: dra7-evm: Fix spi1 mux documentation
    
    commit 68e4d9e58dbae2fb178e8b74806f521adb16f0d3 upstream.
    
    While auditing the various pin ctrl configurations using the following
    command:
    grep PIN_ arch/arm/boot/dts/dra7-evm.dts|(while read line;
    do
    	v=`echo "$line" | sed -e "s/\s\s*/|/g" | cut -d '|' -f1 |
    		cut -d 'x' -f2|tr [a-z] [A-Z]`;
    	HEX=`echo "obase=16;ibase=16;4A003400+$v"| bc`;
    	echo "$HEX ===> $line";
    done)
    against DRA75x/74x NDA TRM revision S(SPRUHI2S August 2014),
    documentation errors were found for spi1 pinctrl. Fix the same.
    
    Fixes: 6e58b8f1daaf1af ("ARM: dts: DRA7: Add the dts files for dra7 SoC and dra7-evm board")
    Signed-off-by: Nishanth Menon <nm@ti.com>
    Signed-off-by: Tony Lindgren <tony@atomide.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit e50b78c6c72acbf92c599cc5c229113d63675d0a
Author: Nishanth Menon <nm@ti.com>
Date:   Mon Aug 25 16:15:34 2014 -0700

    ARM: dts: DRA7: fix interrupt-cells for GPIO
    
    commit e49d519c456f4fb6f4a0473bc04ba30bb805fce5 upstream.
    
    GPIO modules are also interrupt sources. However, they require both the
    GPIO number and IRQ type to function properly.
    
    By declaring that GPIO uses interrupt-cells=<1>, we essentially do not
    allow users of the nodes to use the interrupt property appropritely.
    
    With this change, the following now works:
    
    interrupt-parent = <&gpio6>;
    interrupts = <5 IRQ_TYPE_LEVEL_LOW>;
    
    Fixes: 6e58b8f1daaf ('ARM: dts: DRA7: Add the dts files for dra7 SoC and dra7-evm board')
    Signed-off-by: Nishanth Menon <nm@ti.com>
    Signed-off-by: Tony Lindgren <tony@atomide.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 7d30d6e8830445445ab666bf7ac87bb1205e9b7a
Author: Rajendra Nayak <rnayak@ti.com>
Date:   Wed Aug 27 19:38:23 2014 -0600

    ARM: DRA7: hwmod: Add dra74x and dra72x specific ocp interface lists
    
    commit f7f7a29bf0cf25af23f37e5b5bf1368b85705286 upstream.
    
    To deal with IPs which are specific to dra74x and dra72x, maintain seperate
    ocp interface lists, while keeping the common list for all common IPs.
    
    Move USB OTG SS4 to dra74x only list since its unavailable in
    dra72x and is giving an abort during boot. The dra72x only list
    is empty for now and a placeholder for future hwmod additions which
    are specific to dra72x.
    
    Fixes: d904b38df0db13 ("ARM: DRA7: hwmod: Add SYSCONFIG for usb_otg_ss")
    Reported-by: Keerthy <j-keerthy@ti.com>
    Signed-off-by: Rajendra Nayak <rnayak@ti.com>
    Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
    Tested-by: Nishanth Menon <nm@ti.com>
    [paul@pwsan.com: fixed comment style to conform with CodingStyle]
    Signed-off-by: Paul Walmsley <paul@pwsan.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 3214954c891b6f6ebc670b96aae4216d501a2241
Author: Mark Rutland <mark.rutland@arm.com>
Date:   Fri Aug 15 12:11:49 2014 +0100

    ARM: 8128/1: abort: don't clear the exclusive monitors
    
    commit 85868313177700d20644263a782351262d2aff84 upstream.
    
    The ARMv6 and ARMv7 early abort handlers clear the exclusive monitors
    upon entry to the kernel, but this is redundant:
    
      - We clear the monitors on every exception return since commit
        200b812d0084 ("Clear the exclusive monitor when returning from an
        exception"), so this is not necessary to ensure the monitors are
        cleared before returning from a fault handler.
    
      - Any dummy STREX will target a temporary scratch area in memory, and
        may succeed or fail without corrupting useful data. Its status value
        will not be used.
    
      - Any other STREX in the kernel must be preceded by an LDREX, which
        will initialise the monitors consistently and will not depend on the
        earlier state of the monitors.
    
    Therefore we have no reason to care about the initial state of the
    exclusive monitors when a data abort is taken, and clearing the monitors
    prior to exception return (as we already do) is sufficient.
    
    This patch removes the redundant clearing of the exclusive monitors from
    the early abort handlers.
    
    Signed-off-by: Mark Rutland <mark.rutland@arm.com>
    Acked-by: Will Deacon <will.deacon@arm.com>
    Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 54ad9868865d9c9211bb0a0a52f4f2c928cae69c
Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date:   Wed Aug 27 16:21:12 2014 +0300

    spi: dw-pci: fix bug when regs left uninitialized
    
    commit c9d5d6fe168fd45a4dfdd0116affe708789b4702 upstream.
    
    The commit 04f421e7 "spi: dw: use managed resources" changes drivers to use
    managed functions, but seems wasn't properly tested in PCI case. The regs field
    of struct dw_spi left uninitialized. Thus, kernel crashes when tries to access
    to the SPI controller registers. This patch fixes the issue.
    
    Fixes: 04f421e7 (spi: dw: use managed resources)
    Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
    Signed-off-by: Mark Brown <broonie@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 0f6238ed24423de60a59f24151966fde6a780760
Author: Jorge A. Ventura <jorge.araujo.ventura@gmail.com>
Date:   Sat Aug 9 16:06:58 2014 -0500

    spi/omap-mcspi: Fix the spi task hangs waiting dma_rx
    
    commit 3d0763c006f8da1b44a9f5f9a21187f5b8f674f4 upstream.
    
    The spi hangs waiting the completion of omap2_mcspi_rx_callback.
    
    Signed-off-by: Jorge A. Ventura <jorge.araujo.ventura@gmail.com>
    Signed-off-by: Mark Brown <broonie@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit a4967124a0eb628eb98f802f97e1560a5b033832
Author: Trond Myklebust <trond.myklebust@primarydata.com>
Date:   Thu Sep 18 11:51:32 2014 -0400

    NFSv4: Fix another bug in the close/open_downgrade code
    
    commit cd9288ffaea4359d5cfe2b8d264911506aed26a4 upstream.
    
    James Drew reports another bug whereby the NFS client is now sending
    an OPEN_DOWNGRADE in a situation where it should really have sent a
    CLOSE: the client is opening the file for O_RDWR, but then trying to
    do a downgrade to O_RDONLY, which is not allowed by the NFSv4 spec.
    
    Reported-by: James Drews <drews@engr.wisc.edu>
    Link: http://lkml.kernel.org/r/541AD7E5.8020409@engr.wisc.edu
    Fixes: aee7af356e15 (NFSv4: Fix problems with close in the presence...)
    Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit c347c76f3678a0b6e23b2a90aa538126475e19c8
Author: Steve Dickson <steved@redhat.com>
Date:   Thu Sep 18 09:13:17 2014 -0400

    NFSv4: nfs4_state_manager() vs. nfs_server_remove_lists()
    
    commit 080af20cc945d110f9912d01cf6b66f94a375b8d upstream.
    
    There is a race between nfs4_state_manager() and
    nfs_server_remove_lists() that happens during a nfsv3 mount.
    
    The v3 mount notices there is already a supper block so
    nfs_server_remove_lists() called which uses the nfs_client_lock
    spin lock to synchronize access to the client list.
    
    At the same time nfs4_state_manager() is running through
    the client list looking for work to do, using the same
    lock. When nfs4_state_manager() wins the race to the
    list, a v3 client pointer is found and not ignored
    properly which causes the panic.
    
    Moving some protocol checks before the state checking
    avoids the panic.
    
    Signed-off-by: Steve Dickson <steved@redhat.com>
    Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 433ec1a32c7380567c38226a6c490fd899339017
Author: Olav Haugan <ohaugan@codeaurora.org>
Date:   Mon Aug 4 19:01:02 2014 +0100

    iommu/arm-smmu: fix programming of SMMU_CBn_TCR for stage 1
    
    commit 1fc870c7efa364862c3bc792cfbdb38afea26742 upstream.
    
    Stage-1 context banks do not have the SMMU_CBn_TCR[SL0] field since it
    is only applicable to stage-2 context banks.
    
    This patch ensures that we don't set the reserved TCR bits for stage-1
    translations.
    
    Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
    Signed-off-by: Will Deacon <will.deacon@arm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 1d90e1104ed216d8105a2062854ab1c82058b738
Author: Lee, Chun-Yi <joeyli.kernel@gmail.com>
Date:   Thu Sep 4 15:13:39 2014 +0800

    ACPI / RTC: Fix CMOS RTC opregion handler accesses to wrong addresses
    
    commit 9389f46e9782ea5e56fbd7b2e59ba7c08f3ba86b upstream.
    
    The value64 parameter is an u64 point that used to transfer the value
    for write to CMOS, or used to return the value that's read from CMOS.
    
    The value64 is an u64 point, so don't need get address again. It causes
    acpi_cmos_rtc_space_handler always return 0 to reader and didn't write
    expected value to CMOS.
    
    Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit bd62e7855a732200d58b6473f8cf8830f20dfc90
Author: Felipe Balbi <balbi@ti.com>
Date:   Wed Sep 3 16:42:57 2014 -0500

    usb: dwc3: omap: fix ordering for runtime pm calls
    
    commit 81a60b7f5c143ab3cdcd9943c9b4b7c63c32fc31 upstream.
    
    we don't to gate clocks until our children are
    done with their remove path.
    
    Fixes: af310e9 (usb: dwc3: omap: use runtime API's to enable clocks)
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 375ef46305e47950460390e838ba589101066ae0
Author: Alan Stern <stern@rowland.harvard.edu>
Date:   Wed Sep 17 11:23:54 2014 -0400

    USB: EHCI: unlink QHs even after the controller has stopped
    
    commit 7312b5ddd47fee2356baa78c5516ef8e04eed452 upstream.
    
    Old code in ehci-hcd tries to expedite disabling endpoints after the
    controller has stopped, by destroying the endpoint's associated QH
    without first unlinking the QH.  This was necessary back when the
    driver wasn't so careful about keeping track of the controller's
    state.
    
    But now we are careful about it, and the driver knows that when the
    controller isn't running, no unlinking delay is needed.  Furthermore,
    skipping the unlink step will trigger a BUG() in qh_destroy() when the
    preceding QH is released, because the link pointer will be non-NULL.
    
    Removing the lines that skip the unlinking step and go directly to
    QH_STATE_IDLE fixes the problem.
    
    Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
    Reported-by: Joe Lawrence <joe.lawrence@stratus.com>
    Tested-by: Joe Lawrence <joe.lawrence@stratus.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 6db9037333270a3a862bd9127f99d419250e39a6
Author: Mark <markk@clara.co.uk>
Date:   Wed Sep 17 19:15:43 2014 +0100

    USB: storage: Add quirks for Entrega/Xircom USB to SCSI converters
    
    commit c80b4495c61636edc58fe1ce300f09f24db28e10 upstream.
    
    This patch adds quirks for Entrega Technologies (later Xircom PortGear) USB-
    SCSI converters. They use Shuttle Technology EUSB-01/EUSB-S1 chips. The
    US_FL_SCM_MULT_TARG quirk is needed to allow multiple devices on the SCSI
    chain to be accessed. Without it only the (single) device with SCSI ID 0
    can be used.
    
    The standalone converter sold by Entrega had model number U1-SC25. Xircom
    acquired Entrega and re-branded the product line PortGear. The PortGear USB
    to SCSI Converter (model PGSCSI) is internally identical to the Entrega
    product, but later models may use a different USB ID. The Entrega-branded
    units have USB ID 1645:0007, as does my Xircom PGSCSI, but the Windows and
    Macintosh drivers also support 085A:0028.
    
    Entrega also sold the "Mac USB Dock", which provides two USB ports, a Mac
    (8-pin mini-DIN) serial port and a SCSI port. It appears to the computer as
    a four-port hub, USB-serial, and USB-SCSI converters. The USB-SCSI part may
    have initially used the same ID as the standalone U1-SC25 (1645:0007), but
    later production used 085A:0026.
    
    My Xircom PortGear PGSCSI has bcdDevice=0x0100. Units with bcdDevice=0x0133
    probably also exist.
    
    This patch adds quirks for 1645:0007, 085A:0026 and 085A:0028. The Windows
    driver INF file also mentions 085A:0032 "PortStation SCSI Module", but I
    couldn't find any mention of that actually existing in the wild; perhaps it
    was cancelled before release?
    
    Signed-off-by: Mark Knibbs <markk@clara.co.uk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 4a9900a5588c5f2d8d1c48eda36c74f6e648fd66
Author: Mark <markk@clara.co.uk>
Date:   Tue Sep 16 16:51:41 2014 +0100

    USB: storage: Add quirk for Ariston Technologies iConnect USB to SCSI adapter
    
    commit b6a3ed677991558ce09046397a7c4d70530d15b3 upstream.
    
    Hi,
    
    The Ariston Technologies iConnect 025 and iConnect 050 (also known as e.g.
    iSCSI-50) are SCSI-USB converters which use Shuttle Technology/SCM
    Microsystems chips. Only the connectors differ; both have the same USB ID.
    The US_FL_SCM_MULT_TARG quirk is required to use SCSI devices with ID other
    than 0.
    
    I don't have one of these, but based on the other entries for Shuttle/
    SCM-based converters this patch is very likely correct. I used 0x0000 and
    0x9999 for bcdDeviceMin and bcdDeviceMax because I'm not sure which
    bcdDevice value the products use.
    
    Signed-off-by: Mark Knibbs <markk@clara.co.uk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 1e32ee2c4b533812b14bf188e8dd44f123ff35e3
Author: Mark <markk@clara.co.uk>
Date:   Tue Sep 16 16:22:50 2014 +0100

    USB: storage: Add quirk for Adaptec USBConnect 2000 USB-to-SCSI Adapter
    
    commit 67d365a57a51fb9dece6a5ceb504aa381cae1e5b upstream.
    
    The Adaptec USBConnect 2000 is another SCSI-USB converter which uses
    Shuttle Technology/SCM Microsystems chips. The US_FL_SCM_MULT_TARG quirk is
    required to use SCSI devices with ID other than 0.
    
    I don't have a USBConnect 2000, but based on the other entries for Shuttle/
    SCM-based converters this patch is very likely correct. I used 0x0000 and
    0x9999 for bcdDeviceMin and bcdDeviceMax because I'm not sure which
    bcdDevice value the product uses.
    
    Signed-off-by: Mark Knibbs <markk@clara.co.uk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit da16933ae6e5e0fbdb4c653b8d5011b029c86dcc
Author: Mark <markk@clara.co.uk>
Date:   Thu Sep 11 13:15:45 2014 +0100

    storage: Add single-LUN quirk for Jaz USB Adapter
    
    commit c66f1c62e85927357e7b3f4c701614dcb5c498a2 upstream.
    
    The Iomega Jaz USB Adapter is a SCSI-USB converter cable. The hardware
    seems to be identical to e.g. the Microtech XpressSCSI, using a Shuttle/
    SCM chip set. However its firmware restricts it to only work with Jaz
    drives.
    
    On connecting the cable a message like this appears four times in the log:
     reset full speed USB device number 4 using uhci_hcd
    
    That's non-fatal but the US_FL_SINGLE_LUN quirk fixes it.
    
    Signed-off-by: Mark Knibbs <markk@clara.co.uk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 3f6622c77fe9a0bc5ed668e5e9b03944e3cd80a4
Author: Joe Lawrence <joe.lawrence@stratus.com>
Date:   Wed Sep 10 15:07:50 2014 -0400

    usb: hub: take hub->hdev reference when processing from eventlist
    
    commit c605f3cdff53a743f6d875b76956b239deca1272 upstream.
    
    During surprise device hotplug removal tests, it was observed that
    hub_events may try to call usb_lock_device on a device that has already
    been freed. Protect the usb_device by taking out a reference (under the
    hub_event_lock) when hub_events pulls it off the list, returning the
    reference after hub_events is finished using it.
    
    Signed-off-by: Joe Lawrence <joe.lawrence@stratus.com>
    Suggested-by: David Bulkow <david.bulkow@stratus.com> for using kref
    Suggested-by: Alan Stern <stern@rowland.harvard.edu> for placement
    Acked-by: Alan Stern <stern@rowland.harvard.edu>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit fe4b28ee560fc60ccd1f66ec218ee2aa80ba4612
Author: Mathias Nyman <mathias.nyman@linux.intel.com>
Date:   Thu Sep 11 13:55:50 2014 +0300

    xhci: fix oops when xhci resumes from hibernate with hw lpm capable devices
    
    commit 96044694b8511bc2b04df0776b4ba295cfe005c0 upstream.
    
    Resuming from hibernate (S4) will restart and re-initialize xHC.
    The device contexts are freed and will be re-allocated later during device reset.
    
    Usb core will disable link pm in device resume before device reset, which will
    try to change the max exit latency, accessing the device contexts before they are re-allocated.
    
    There is no need to zero (disable) the max exit latency when disabling hw lpm
    for a freshly re-initialized xHC. So check that device context exists before
    doing anything. The max exit latency will be set again after device reset when usb core
    enables the link pm.
    
    Reported-by: Imre Deak <imre.deak@intel.com>
    Tested-by: Imre Deak <imre.deak@intel.com>
    Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit f9fa62e52f2b895b326474e5d85c20bd8ddc41ab
Author: Mathias Nyman <mathias.nyman@linux.intel.com>
Date:   Thu Sep 11 13:55:48 2014 +0300

    xhci: Fix null pointer dereference if xhci initialization fails
    
    commit c207e7c50f31113c24a9f536fcab1e8a256985d7 upstream.
    
    If xhci initialization fails before the roothub bandwidth
    domains (xhci->rh_bw[i]) are allocated it will oops when
    trying to access rh_bw members in xhci_mem_cleanup().
    
    Reported-by: Manuel Reimer <manuel.reimer@gmx.de>
    Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit e6f8888cac03be4325d84c4269be9d5719c28d3f
Author: Felipe Balbi <balbi@ti.com>
Date:   Wed Aug 27 16:38:04 2014 -0500

    usb: host: xhci: fix compliance mode workaround
    
    commit 96908589a8b2584b1185f834d365f5cc360e8226 upstream.
    
    Commit 71c731a (usb: host: xhci: Fix Compliance Mode
    on SN65LVP3502CP Hardware) implemented a workaround
    for a known issue with Texas Instruments' USB 3.0
    redriver IC but it left a condition where any xHCI
    host would be taken out of reset if port was placed
    in compliance mode and there was no device connected
    to the port.
    
    That condition would trigger a fake connection to a
    non-existent device so that usbcore would trigger a
    warm reset of the port, thus taking the link out of
    reset.
    
    This has the side-effect of preventing any xHCI host
    connected to a Linux machine from starting and running
    the USB 3.0 Electrical Compliance Suite because the
    port will mysteriously taken out of compliance mode
    and, thus, xHCI won't step through the necessary
    compliance patterns for link validation.
    
    This patch fixes the issue by just adding a missing
    check for XHCI_COMP_MODE_QUIRK inside
    xhci_hub_report_usb3_link_state() when PORT_CAS isn't
    set.
    
    This patch should be backported to all kernels containing
    commit 71c731a.
    
    Fixes: 71c731a (usb: host: xhci: Fix Compliance Mode on SN65LVP3502CP Hardware)
    Cc: Alexis R. Cortes <alexis.cortes@ti.com>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Acked-by: Mathias Nyman <mathias.nyman@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 6c5db350475653e9f957d044d8008eaac227e415
Author: Thomas Pugliese <thomas.pugliese@gmail.com>
Date:   Thu Aug 7 15:45:35 2014 -0500

    uwb: init beacon cache entry before registering uwb device
    
    commit 675f0ab2fe5a0f7325208e60b617a5f32b86d72c upstream.
    
    Make sure the uwb_dev->bce entry is set before calling uwb_dev_add in
    uwbd_dev_onair so that usermode will only see the device after it is
    properly initialized.  This fixes a kernel panic that can occur if
    usermode tries to access the IEs sysfs attribute of a UWB device before
    the driver has had a chance to set the beacon cache entry.
    
    Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit bf380f1d3c8d27aa550ed0e2a3847585d97faaac
Author: Johan Hovold <johan@kernel.org>
Date:   Thu Aug 28 12:46:54 2014 +0200

    USB: zte_ev: fix removed PIDs
    
    commit 3096691011d01cef56b243a5e65431405c07d574 upstream.
    
    Add back some PIDs that were mistakingly remove when reverting commit
    73228a0538a7 ("USB: option,zte_ev: move most ZTE CDMA devices to
    zte_ev"), which apparently did more than its commit message claimed in
    that it not only moved some PIDs from option to zte_ev but also added
    some new ones.
    
    Fixes: 63a901c06e3c ("Revert "USB: option,zte_ev: move most ZTE CDMA
    devices to zte_ev"")
    
    Reported-by: Lei Liu <lei35151@163.com>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 135a5be97ec02cfaa2a145b4a7c2d7a533530d21
Author: Johan Hovold <johan@kernel.org>
Date:   Mon Aug 18 18:33:11 2014 +0200

    USB: ftdi_sio: add support for NOVITUS Bono E thermal printer
    
    commit ee444609dbae8afee420c3243ce4c5f442efb622 upstream.
    
    Add device id for NOVITUS Bono E thermal printer.
    
    Reported-by: Emanuel Koczwara <poczta@emanuelkoczwara.pl>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 1de3c380e505b489210a66081764b283ae66939f
Author: Taylor Braun-Jones <taylor.braun-jones@ge.com>
Date:   Thu Aug 7 14:25:06 2014 -0400

    USB: ftdi_sio: Add support for GE Healthcare Nemo Tracker device
    
    commit 9c491c372d677b6420e0f8c6361fe422791662cc upstream.
    
    Signed-off-by: Taylor Braun-Jones <taylor.braun-jones@ge.com>
    Cc: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit ed487b7fb054a5adcbbf2d38d97b9fc0237489e1
Author: Ivan T. Ivanov <iivanov@mm-sol.com>
Date:   Thu Sep 11 08:19:00 2014 +0800

    usb: chipidea: msm: Initialize PHY on reset event
    
    commit 233c7daf4eecd1e992dc42591182cd4a892e687c upstream.
    
    Initialize USB PHY after every Link controller reset
    
    Cc: Tim Bird <tbird20d@gmail.com>
    Signed-off-by: Peter Chen <peter.chen@freescale.com>
    Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 9703d02767a7ecf5960f7fe6c65acc18b13abfc6
Author: Ivan T. Ivanov <iivanov@mm-sol.com>
Date:   Thu Sep 11 08:18:59 2014 +0800

    usb: chipidea: msm: Use USB PHY API to control PHY state
    
    commit ea290056d7c46f7781ff13801048ed957b96d1a5 upstream.
    
    PHY drivers keep track of the current state of the hardware,
    so don't change PHY settings under it.
    
    Cc: Tim Bird <tbird20d@gmail.com>
    Signed-off-by: Peter Chen <peter.chen@freescale.com>
    Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com>
    Acked-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 7e1a0ec065dddce0e799f68333ef0ff4a51a67f5
Author: Tony Lindgren <tony@atomide.com>
Date:   Wed Aug 20 12:07:00 2014 -0700

    usb: phy: twl4030-usb: Fix regressions to runtime PM on omaps
    
    commit 96be39ab34b77c6f6f5cd6ae03aac6c6449ee5c4 upstream.
    
    Commit 30a70b026b4cd ("usb: musb: fix obex in g_nokia.ko causing kernel
    panic") attempted to fix runtime PM handling for PHYs that are on the
    I2C bus. Commit 3063a12be2b0 ("usb: musb: fix PHY power on/off") then
    changed things around to enable of PHYs that rely on runtime PM.
    
    These changes however broke idling of the PHY and causes at least
    100 mW extra power consumption on omaps, which is a lot with
    the idle power consumption being below 10 mW range on many devices.
    
    As calling phy_power_on/off from runtime PM calls in the USB
    causes complicated issues with I2C connected PHYs, let's just let
    the PHY do it's own runtime PM as needed. This leaves out the
    dependency between PHYs and USB controller drivers for runtime
    PM.
    
    Let's fix the regression for twl4030-usb by adding minimal runtime
    PM support. This allows idling the PHY on disconnect.
    
    Note that we are changing to use standard runtime PM handling
    for twl4030_phy_init() as that function just checks the state
    and does not initialize the PHY. The PHY won't get initialized
    until in twl4030_phy_power_on().
    
    Fixes: 30a70b026b4cd ("usb: musb: fix obex in g_nokia.ko causing kernel panic")
    Fixes: 3063a12be2b0 ("usb: musb: fix PHY power on/off")
    Acked-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Tony Lindgren <tony@atomide.com>
    Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit e6adfbeb2b331cac6dc2dfc55c7d858a7ff62060
Author: Tony Lindgren <tony@atomide.com>
Date:   Sun Aug 24 17:44:22 2014 +0530

    usb: phy: twl4030-usb: Fix lost interrupts after ID pin goes down
    
    commit 85601b8d81e24ce9ae2d31e93f35468ab7616b18 upstream.
    
    Commit 249751f22380 ("usb: phy: twl4030-usb: poll for ID disconnect")
    added twl4030_id_workaround_work() to deal with lost interrupts
    after ID pin goes down. Looks like commit f1ddc24c9e33 ("usb: phy:
    twl4030-usb: remove *set_suspend* and *phy_init* ops") changed
    things around for the generic phy framework, and delayed work no
    longer got called except initially during boot.
    
    The PHY connect and disconnect interrupts for twl4030-usb are not
    working after disconnecting a USB-A cable from the board, and the
    deeper idle states for omap are blocked as the USB controller
    stays busy.
    
    The issue can be solved by calling delayed work from twl4030_usb_irq()
    when ID pin is down and the PHY is not asleep like we already do
    in twl4030_id_workaround_work().
    
    But as both twl4030_usb_irq() and twl4030_id_workaround_work()
    already do pretty much the same thing, let's call twl4030_usb_irq()
    from twl4030_id_workaround_work() instead of adding some more
    duplicate code. We also must call sysfs_notify() only when we have
    an interrupt and not from the delayed work as notified by
    Grazvydas Ignotas <notasas@gmail.com>.
    
    Fixes: f1ddc24c9e33 ("usb: phy: twl4030-usb: remove *set_suspend* and *phy_init* ops")
    Acked-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Tony Lindgren <tony@atomide.com>
    Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit f42b773a39d549f1ea922f6e4b65a8a135fcac17
Author: Thierry Reding <treding@nvidia.com>
Date:   Mon Jul 21 13:37:37 2014 +0200

    usb: phy: tegra: Avoid use of sizeof(void)
    
    commit 9ce9ec95fb9b82e09b55a52f1bb8a362bf8f74d8 upstream.
    
    The PHY configuration is stored in an opaque "config" field, but when
    allocating the structure, its proper size needs to be known. In the case
    of UTMI, the proper structure is tegra_utmip_config of which a local
    variable already exists, so we can use that to obtain the size from.
    
    Fixes the following warning from the sparse checker:
    
    	drivers/usb/phy/phy-tegra-usb.c:882:17: warning: expression using sizeof(void)
    
    Fixes: 81d5dfe6d8b3 (usb: phy: tegra: Read UTMIP parameters from device tree)
    Signed-off-by: Thierry Reding <treding@nvidia.com>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 686498096b37e4414750a0e3182151c3fcff715c
Author: Bjørn Mork <bjorn@mork.no>
Date:   Thu Aug 28 15:08:16 2014 +0200

    USB: sierra: add 1199:68AA device ID
    
    commit 5b3da69285c143b7ea76b3b9f73099ff1093ab73 upstream.
    
    This VID:PID is used for some Direct IP devices behaving
    identical to the already supported 0F3D:68AA devices.
    
    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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 0a246c7efe6600b63bb8723b40270fc6905d34d5
Author: Bjørn Mork <bjorn@mork.no>
Date:   Thu Aug 28 14:11:23 2014 +0200

    USB: sierra: avoid CDC class functions on "68A3" devices
    
    commit 049255f51644c1105775af228396d187402a5934 upstream.
    
    Sierra Wireless Direct IP devices using the 68A3 product ID
    can be configured for modes including a CDC ECM class function.
    The known example uses interface numbers 12 and 13 for the ECM
    control and data interfaces respectively, consistent with CDC
    MBIM function interface numbering on other Sierra devices.
    
    It seems cleaner to restrict this driver to the ff/ff/ff
    vendor specific interfaces rather than increasing the already
    long interface number blacklist.  This should be more future
    proof if Sierra adds more class functions using interface
    numbers not yet in the blacklist.
    
    Signed-off-by: Bjørn Mork <bjorn@mork.no>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 03cb8b46c1779090dcd906cb039cfebb17ef32be
Author: Karol Lewandowski <k.lewandowsk@samsung.com>
Date:   Fri Sep 5 21:04:44 2014 +0200

    usb: gadget: f_fs: drop duplicate usb_functionfs_descs_head declaration
    
    Applicable for 3.14-stable only, as this revertes a previous commit that was incorrect.
    
    This commit drops duplicate declaration of struct usb_functionfs_descs_head
    erronousely added in commit 28c5980b54 ("usb: gadget: f_fs: resurect
    usb_functionfs_descs_head structure").
    
    Fix from 28c5980b54 is applicable only for v3.15-rc1 and newer kernels.
    
    This fixes error in uapi:
    
      /src/linux$ make -C tools usb
    
      make: Entering directory '/src/linux/tools'
        DESCEND  usb
      make[1]: Entering directory '/src/linux/tools/usb'
      gcc -Wall -Wextra -g -I../include -o testusb testusb.c -lpthread
      gcc -Wall -Wextra -g -I../include -o ffs-test ffs-test.c -lpthread
      In file included from ffs-test.c:41:0:
      ../../include/uapi/linux/usb/functionfs.h:42:8: error: redefinition of ‘struct usb_functionfs_descs_head’
       struct usb_functionfs_descs_head {
              ^
      ../../include/uapi/linux/usb/functionfs.h:31:8: note: originally defined here
       struct usb_functionfs_descs_head {
              ^
    
    Cc: Michal Nazarewicz <mina86@mina86.com>
    Cc: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 918e20898ae4ae524b5a5dc0cfa56db7686906fa
Author: Johan Hovold <johan@kernel.org>
Date:   Thu Aug 7 16:00:15 2014 +0200

    USB: zte_ev: remove duplicate Qualcom PID
    
    commit 754eb21c0bbbbc4b8830a9a864b286323b84225f upstream.
    
    Remove dublicate Qualcom PID 0x3197 which is already handled by the
    moto-modem driver since commit 6986a978eec7 ("USB: add new moto_modem
    driver for some Morotola phones").
    
    Fixes: 799ee9243d89 ("USB: serial: add zte_ev.c driver")
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 5a3444a6b660657dfc8afb34dd96362d39cf8cd4
Author: Johan Hovold <johan@kernel.org>
Date:   Thu Aug 7 16:00:14 2014 +0200

    USB: zte_ev: remove duplicate Gobi PID
    
    commit 95be5739588c56a9327e477aa0ba3c81c5cf8631 upstream.
    
    Remove dublicate Gobi PID 0x9008 which is already handled by the
    qcserial driver since commit f05932c0caf4 ("USB: qcserial: Add extra
    device IDs").
    
    Fixes: 799ee9243d89 ("USB: serial: add zte_ev.c driver")
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 499404761e7d2bd68237a4e5338355174ea8a74a
Author: Johan Hovold <johan@kernel.org>
Date:   Thu Aug 7 16:00:13 2014 +0200

    Revert "USB: option,zte_ev: move most ZTE CDMA devices to zte_ev"
    
    commit 63a901c06e3c2c45bd601916fe04e870e9ccae1e upstream.
    
    This reverts commit 73228a0538a7 ("USB: option,zte_ev: move most ZTE
    CDMA devices to zte_ev").
    
    Move the IDs of the devices that were previously driven by the option
    driver back to that driver.
    
    As several users have reported, the zte_ev driver is causing random
    disconnects as well as reconnect failures.
    
    A closer analysis of the zte_ev setup code reveals that it consists of
    standard CDC requests (SET/GET_LINE_CODING and SET_CONTROL_LINE_STATE)
    but unfortunately fails to get some of those right. In particular, as
    reported by Liu Lei, it fails to lower DTR/RTS on close. It also appears
    that the control requests lack the interface argument.
    
    Note that the zte_ev driver is based on code (once) distributed by ZTE
    that still appears to originally have been reverse-engineered and bolted
    onto the generic driver.
    
    Since line control is already handled properly by the option driver, and
    the SET/GET_LINE_CODING requests appears to be redundant (amounts to a
    SET 9600 8N1), this is a first step in ultimately removing the redundant
    zte_ev driver.
    
    Note that AC2726 had already been moved back to option, and that some
    IDs were in the device table of both drivers prior to the commit being
    reverted.
    
    Reported-by: Lei Liu <liu.lei78@zte.com.cn>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 434d82116b2755f4b0449724583271b6d9b15ac5
Author: Brennan Ashton <bashton@brennanashton.com>
Date:   Wed Aug 6 08:46:44 2014 -0700

    USB: option: add VIA Telecom CDS7 chipset device id
    
    commit d77302739d900bbca5e901a3b7ac48c907ee6c93 upstream.
    
    This VIA Telecom baseband processor is used is used by by u-blox in both the
    FW2770 and FW2760 products and may be used in others as well.
    
    This patch has been tested on both of these modem versions.
    
    Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 1305752116af06b387ccfc858d28672d84996706
Author: Johan Hovold <johan@kernel.org>
Date:   Tue Jul 29 14:14:55 2014 +0200

    USB: option: reduce interrupt-urb logging verbosity
    
    commit f0e4cba2534cd88476dff920727c81350130f3c5 upstream.
    
    Do not log normal interrupt-urb shutdowns as errors.
    
    The option driver has always been logging any nonzero interrupt-urb
    status as an error, including when the urb is killed during normal
    operation.
    
    Commit 9096f1fbba91 ("USB: usb_wwan: fix potential NULL-deref at
    resume") moved the interrupt urb submission from port probe and release
    to open and close, thus potentially increasing the number of these
    false-positive error messages dramatically.
    
    Reported-by: Ed Butler <ressy66@ausics.net>
    Tested-by: Ed Butler <ressy66@ausics.net>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 78107561549eafdcbf85415902b9db0d1d418718
Author: Johan Hovold <johan@kernel.org>
Date:   Wed Aug 27 11:55:19 2014 +0200

    USB: serial: fix potential heap buffer overflow
    
    commit 5654699fb38512bdbfc0f892ce54fce75bdc2bab upstream.
    
    Make sure to verify the number of ports requested by subdriver to avoid
    writing beyond the end of fixed-size array in interface data.
    
    The current usb-serial implementation is limited to eight ports per
    interface but failed to verify that the number of ports requested by a
    subdriver (which could have been determined from device descriptors) did
    not exceed this limit.
    
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 61fd69fcfa96cbe4d2923036870b0fac826d0db8
Author: Stephen Hemminger <stephen@networkplumber.org>
Date:   Mon Aug 25 21:07:47 2014 -0700

    USB: sisusb: add device id for Magic Control USB video
    
    commit 5b6b80aeb21091ed3030b9b6aae597d81326f1aa upstream.
    
    I have a j5 create (JUA210) USB 2 video device and adding it device id
    to SIS USB video gets it to work.
    
    Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 26ca39ccc37f680527896e8355536ee87b8f17d4
Author: Johan Hovold <johan@kernel.org>
Date:   Wed Aug 27 11:55:18 2014 +0200

    USB: serial: fix potential stack buffer overflow
    
    commit d979e9f9ecab04c1ecca741370e30a8a498893f5 upstream.
    
    Make sure to verify the maximum number of endpoints per type to avoid
    writing beyond the end of a stack-allocated array.
    
    The current usb-serial implementation is limited to eight ports per
    interface but failed to verify that the number of endpoints of a certain
    type reported by a device did not exceed this limit.
    
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 0fba5ddffbd56e4ca95bc14e6cd6ba14e6f14233
Author: Greg KH <gregkh@linuxfoundation.org>
Date:   Fri Aug 15 15:22:21 2014 +0800

    USB: serial: pl2303: add device id for ztek device
    
    commit 91fcb1ce420e0a5f8d92d556d7008a78bc6ce1eb upstream.
    
    This adds a new device id to the pl2303 driver for the ZTEK device.
    
    Reported-by: Mike Chu <Mike-Chu@prolific.com.tw>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Johan Hovold <johan@kernel.org>

commit a98cf00477ea274737dc330d23221db6c14484e6
Author: Max Filippov <jcmvbkbc@gmail.com>
Date:   Thu Jul 31 22:40:57 2014 +0400

    xtensa: fix a6 and a7 handling in fast_syscall_xtensa
    
    commit d1b6ba82a50cecf94be540a3a153aa89d97511a0 upstream.
    
    Remove restoring a6 on some return paths and instead modify and restore
    it in a single place, using symbolic name.
    Correctly restore a7 from PT_AREG7 in case of illegal a6 value.
    
    Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 64930da5dc330e47bc879228a0bb66479876a13b
Author: Max Filippov <jcmvbkbc@gmail.com>
Date:   Mon Jul 21 22:01:51 2014 +0400

    xtensa: fix TLBTEMP_BASE_2 region handling in fast_second_level_miss
    
    commit 7128039fe2dd3d59da9e4ffa036f3aaa3ba87b9f upstream.
    
    Current definition of TLBTEMP_BASE_2 is always 32K above the
    TLBTEMP_BASE_1, whereas fast_second_level_miss handler for the TLBTEMP
    region analyzes virtual address bit (PAGE_SHIFT + DCACHE_ALIAS_ORDER)
    to determine TLBTEMP region where the fault happened. The size of the
    TLBTEMP region is also checked incorrectly: not 64K, but twice data
    cache way size (whicht may as well be less than the instruction cache
    way size).
    
    Fix TLBTEMP_BASE_2 to be TLBTEMP_BASE_1 + data cache way size.
    Provide TLBTEMP_SIZE that is a greater of doubled data cache way size or
    the instruction cache way size, and use it to determine if the second
    level TLB miss occured in the TLBTEMP region.
    
    Practical occurence of page faults in the TLBTEMP area is extremely
    rare, this code can be tested by deletion of all w[di]tlb instructions
    in the tlbtemp_mapping region.
    
    Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 3d28d45feabfe49445ff47601d512efaa393e422
Author: Max Filippov <jcmvbkbc@gmail.com>
Date:   Sun Jul 27 07:23:41 2014 +0400

    xtensa: fix access to THREAD_RA/THREAD_SP/THREAD_DS
    
    commit 52247123749cc3cbc30168b33ad8c69515c96d23 upstream.
    
    With SMP and a lot of debug options enabled task_struct::thread gets out
    of reach of s32i/l32i instructions with base pointing at task_struct,
    breaking build with the following messages:
    
      arch/xtensa/kernel/entry.S: Assembler messages:
      arch/xtensa/kernel/entry.S:1002: Error: operand 3 of 'l32i.n' has invalid value '1048'
      arch/xtensa/kernel/entry.S:1831: Error: operand 3 of 's32i.n' has invalid value '1040'
      arch/xtensa/kernel/entry.S:1832: Error: operand 3 of 's32i.n' has invalid value '1044'
    
    Change base to point to task_struct::thread in such cases.
    Don't use a10 in _switch_to to save/restore prev pointer as a2 is not
    clobbered.
    
    Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit ba93d7c0214647c1ffbcfb5786e817a867c1f28c
Author: Alan Douglas <adouglas@cadence.com>
Date:   Wed Jul 23 14:06:40 2014 +0400

    xtensa: fix address checks in dma_{alloc,free}_coherent
    
    commit 1ca49463c44c970b1ab1d71b0f268bfdf8427a7e upstream.
    
    Virtual address is translated to the XCHAL_KSEG_CACHED region in the
    dma_free_coherent, but is checked to be in the 0...XCHAL_KSEG_SIZE
    range.
    
    Change check for end of the range from 'addr >= X' to 'addr > X - 1' to
    handle the case of X == 0.
    
    Replace 'if (C) BUG();' construct with 'BUG_ON(C);'.
    
    Signed-off-by: Alan Douglas <adouglas@cadence.com>
    Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit d9aa5003f98fad024ffd8f93e2cadcfd9905e7de
Author: Max Filippov <jcmvbkbc@gmail.com>
Date:   Sun Jul 20 03:38:53 2014 +0400

    xtensa: replace IOCTL code definitions with constants
    
    commit f61bf8e7d19e0a3456a7a9ed97c399e4353698dc upstream.
    
    This fixes userspace code that builds on other architectures but fails
    on xtensa due to references to structures that other architectures don't
    refer to. E.g. this fixes the following issue with python-2.7.8:
    
      python-2.7.8/Modules/termios.c:861:25: error: invalid application
         of 'sizeof' to incomplete type 'struct serial_multiport_struct'
         {"TIOCSERGETMULTI", TIOCSERGETMULTI},
      python-2.7.8/Modules/termios.c:870:25: error: invalid application
         of 'sizeof' to incomplete type 'struct serial_multiport_struct'
         {"TIOCSERSETMULTI", TIOCSERSETMULTI},
      python-2.7.8/Modules/termios.c:900:24: error: invalid application
         of 'sizeof' to incomplete type 'struct tty_struct'
         {"TIOCTTYGSTRUCT", TIOCTTYGSTRUCT},
    
    Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 86372b296eff4316a6662e0135c229b8de1ab854
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Tue Sep 23 10:20:13 2014 -0400

    drm/radeon/cik: use a separate counter for CP init timeout
    
    commit 370ce45b5986118fa496dddbcd7039e1aa1a418f upstream.
    
    Otherwise we may fail to init the second compute ring.
    
    Noticed-by: Christian König <christian.koenig@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 973eb2d61d3eb57a3adee44bafb1125a44b035ce
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Thu Sep 18 10:23:04 2014 -0400

    drm/radeon: don't reset dma on r6xx-evergreen init
    
    commit c1789a2e66a4209fe5035eca11fdd729b2ffdd82 upstream.
    
    Otherwise we may lose the DMA golden settings which can
    lead to hangs, etc.
    
    Reviewed-by: Christian König <christian.koenig@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 92b17de46c089b63c420aac8baafa28b58cdf968
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Thu Sep 18 10:18:43 2014 -0400

    drm/radeon: don't reset sdma on CIK init
    
    commit 799028d5d85384cce140323be633c8d5f079193f upstream.
    
    Otherwise we may lose the DMA golden settings which can
    lead to hangs, etc.
    
    Reviewed-by: Christian König <christian.koenig@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit f145ecfb3ad63c6ddd265347d4684217c0618ad2
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Wed Sep 17 17:41:04 2014 -0400

    drm/radeon: don't reset dma on NI/SI init
    
    commit 31a25e2caf9367365fcb0e57fd8fa5a42e9b73e4 upstream.
    
    Otherwise we may lose the DMA golden settings which can
    lead to hangs, etc.
    
    bug:
    https://www.libreoffice.org/bugzilla/show_bug.cgi?id=83500
    
    Reviewed-by: Christian König <christian.koenig@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 3f163fc70965087eec205146424f1b1ad1e553ef
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Mon Sep 8 13:55:51 2014 -0400

    drm/radeon: add connector quirk for fujitsu board
    
    commit 1952f24d0fa6292d65f886887af87ba8ac79b3ba upstream.
    
    Vbios connector table lists non-existent VGA port.
    
    Bug:
    https://bugs.freedesktop.org/show_bug.cgi?id=83184
    
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit e30db1e3212b2d360e6c807437e2662c372be824
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Mon Sep 8 02:33:32 2014 -0400

    drm/radeon/dpm: set the thermal type properly for special configs
    
    commit ff4377924f7e587c61bcbc704eafecf6c7bd2e00 upstream.
    
    On systems with special thermal configurations make sure we make
    note of the thermal setup.  This is required for proper firmware
    configuration on these systems.
    
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit d23d04fb78d80205583f7968fb5d491db29b3f25
Author: Christian König <christian.koenig@amd.com>
Date:   Sun Sep 7 12:06:52 2014 +0200

    drm/radeon: fix semaphore value init
    
    commit f229407da79315c18a2f25f485e1a1b9fdda1e92 upstream.
    
    Semaphore values have 64 bits, not 32. This fixes a very subtle bug
    that disables synchronization when the upper 32bits wasn't zero.
    
    Signed-off-by: Christian König <christian.koenig@amd.com>
    Reviewed-By: Grigori Goronzy <greg@chown.ath.cx>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 20b3d5386751e331aa0ab0b4e474b1062ecb75df
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Mon Aug 18 11:57:28 2014 -0400

    drm/radeon: fix pm handling in radeon_gpu_reset
    
    commit c940b4476f4fb649f6493b6a0ae837474ded8915 upstream.
    
    pm_suspend is handled in the radeon_suspend callbacks.
    pm_resume has special handling depending on whether
    dpm or legacy pm is enabled.  Change radeon_gpu_reset
    to mirror the behavior in the suspend and resume
    pathes.
    
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Reviewed-by: Christian König <christian.koenig@amd.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 0a60cb9ca541e75012e0d227e1028e51759f8080
Author: Oleg Chernovskiy <algonkvel@gmail.com>
Date:   Mon Aug 11 21:53:46 2014 +0400

    drm/radeon: Add missing lines to ci_set_thermal_temperature_range
    
    commit 6bce8d9772c1c606921a9c99e566eb14202f6669 upstream.
    
    Properly set the thermal min and max temp on CI.
    Otherwise, we end up setting the thermal ranges
    to 0 on resume and end up in the lowest power state.
    
    Signed-off-by: Oleg Chernovskiy <algonkvel@gmail.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 6f99d1d231ffebdc7afe1290ffbe7083c50abb1a
Author: Pali Rohár <pali.rohar@gmail.com>
Date:   Mon Aug 11 19:01:58 2014 +0200

    drm/radeon: Add ability to get and change dpm state when radeon PX card is turned off
    
    commit b07a657e3a05b81c8a30d60e3f3746ca5a48ee62 upstream.
    
    This fixing commit 4f2f203976964e267dc477de6648bdb3acd2b74b
    
    bug:
    https://bugzilla.kernel.org/show_bug.cgi?id=76321
    
    Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 119412bf17c24886ab0321bb3134839bdf84b135
Author: Thomas Hellstrom <thellstrom@vmware.com>
Date:   Thu Aug 28 11:53:23 2014 +0200

    drm/vmwgfx: Fix a potential infinite spin waiting for fifo idle
    
    commit f01ea0c3d9db536c64d47922716d8b3b8f21d850 upstream.
    
    The code waiting for fifo idle was incorrect and could possibly spin
    forever under certain circumstances.
    
    Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
    Reported-by: Mark Sheldon <markshel@vmware.com>
    Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
    Reivewed-by: Mark Sheldon <markshel@vmware.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 113c41a5ade197d34a70e09c9d9d09a201dd4ba9
Author: Russell King <rmk+kernel@arm.linux.org.uk>
Date:   Mon Sep 1 18:07:33 2014 +0100

    imx-drm: ipuv3-plane: fix ipu_plane_dpms()
    
    commit 3a44a2058747d71385eb69691c7f977cb58cc293 upstream.
    
    When unbinding imx-drm, the following oops was observed:
    
    Unable to handle kernel NULL pointer dereference at virtual address 00000004
    pgd = e995c000
    [00000004] *pgd=4fea5831
    Internal error: Oops: 817 [#1] SMP ARM
    Modules linked in: bnep rfcomm bluetooth nfsd exportfs hid_cypress brcmfmac brcmutil snd_soc_fsl_ssi snd_soc_fsl_spdif imx_pcm_fiq imx_pcm_dma snd_soc_sgtl5000 imx_sdma imx2_wdt imx_ldb(C) imx_thermal snd_soc_imx_sgtl5000 snd_soc_imx_spdif snd_soc_imx_audmux
    CPU: 1 PID: 779 Comm: bash Tainted: G         C    3.16.0-rc2+ #1230
    task: ea9eb180 ti: ea378000 task.ti: ea378000
    PC is at ipu_dp_put+0x10/0x18
    LR is at ipu_plane_dpms+0x60/0x8c
    pc : [<c0350d20>]    lr : [<c04bd9e8>]    psr: 200f0013
    sp : ea379d80  ip : ea379d90  fp : ea379d8c
    r10: 00100100  r9 : 00000000  r8 : 00200200
    r7 : e9ba0264  r6 : e9ba01f8  r5 : 00000000  r4 : ea34b800
    r3 : 00000000  r2 : 00000000  r1 : 0000009b  r0 : 00000000
    Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
    Control: 10c53c7d  Table: 3995c04a  DAC: 00000015
    Process bash (pid: 779, stack limit = 0xea378240)
    Stack: (0xea379d80 to 0xea37a000)
    ...
    Backtrace:
    [<c0350d10>] (ipu_dp_put) from [<c04bd9e8>] (ipu_plane_dpms+0x60/0x8c)
    [<c04bd988>] (ipu_plane_dpms) from [<c04bda40>] (ipu_disable_plane+0x2c/0x60)
    [<c04bda14>] (ipu_disable_plane) from [<c04bda9c>] (ipu_plane_destroy+0x28/0x60)
    [<c04bda74>] (ipu_plane_destroy) from [<c033ff84>] (drm_mode_config_cleanup+0x1b8/0x250)
    [<c033fdcc>] (drm_mode_config_cleanup) from [<c04bc234>] (imx_drm_driver_unload+0x44/0x4c)
    [<c04bc1f0>] (imx_drm_driver_unload) from [<c03394a4>] (drm_dev_unregister+0x2c/0xa0)
    [<c0339478>] (drm_dev_unregister) from [<c0339f8c>] (drm_put_dev+0x30/0x6c)
    [<c0339f5c>] (drm_put_dev) from [<c04bc1cc>] (imx_drm_unbind+0x14/0x18)
    [<c04bc1b8>] (imx_drm_unbind) from [<c03530b4>] (component_master_del+0xbc/0xd8)
    ...
    Code: e1a0c00d e92dd800 e24cb004 e3a03000 (e5c03004)
    
    This is caused by a missing check in ipu_plane_dpms for a NULL pointer.
    
    Fixes: b8d181e408af ("staging: drm/imx: add drm plane support")
    Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 6b6ef1edd5706652319d9ac9de1de3d49f9b945d
Author: Y.C. Chen <yc_chen@aspeedtech.com>
Date:   Wed Sep 10 12:07:54 2014 +0800

    drm/ast: AST2000 cannot be detected correctly
    
    commit 83502a5d34386f7c6973bc70e1c423f55f5a2e3a upstream.
    
    Type error and cause AST2000 cannot be detected correctly
    
    Signed-off-by: Y.C. Chen <yc_chen@aspeedtech.com>
    Reviewed-by: Egbert Eich <eich@suse.de>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit b99993be7556ee35befebb96914bec70a44f8599
Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
Date:   Mon Sep 8 17:43:01 2014 +0300

    drm/i915: Wait for vblank before enabling the TV encoder
    
    commit 7a98948f3b536ca9a077e84966ddc0e9f53726df upstream.
    
    The vblank waits in intel_tv_detect_type() are timing out for some
    reason. This is a regression caused removing seemingly useless vblank
    waits from the modeset seqeuence in:
    
     commit 56ef52cad5e37fca89638e4bad598a994ecc3d9f
     Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
     Date:   Thu May 8 19:23:15 2014 +0300
    
        drm/i915: Kill vblank waits after pipe enable on gmch platforms
    
    So it turns out they weren't all entirely useless. Apparently the pipe
    has to go through one full frame before we enable the TV port. Add a
    vblank wait to intel_enable_tv() to make sure that happens.
    
    Another approach was attempted by placing the vblank wait just after
    enabling the port. The theory behind that attempt was that we need to
    let the port stay enabled for one full frame before disabling it again
    during load detection. But that didn't work, and we definitely must
    have the vblank wait before enabling the port.
    
    Cc: Alan Bartlett <ajb@elrepo.org>
    Tested-by: Alan Bartlett <ajb@elrepo.org>
    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=79311
    Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Reviewed-by: Daniel Vetter <daniel@ffwll.ch>
    Signed-off-by: Jani Nikula <jani.nikula@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 3d4f2ca8fd6f3adab83ea1c09a411a4e58f2ddfd
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Thu Sep 4 09:36:18 2014 +0200

    drm/i915: Fix EIO/wedged handling in gem fault handler
    
    commit 2232f0315c6688f5ff6b2067ea88d97542034873 upstream.
    
    In
    
    commit 1f83fee08d625f8d0130f9fe5ef7b17c2e022f3c
    Author: Daniel Vetter <daniel.vetter@ffwll.ch>
    Date:   Thu Nov 15 17:17:22 2012 +0100
    
        drm/i915: clear up wedged transitions
    
    I've accidentally inverted the EIO/wedged handling in the fault
    handler: We want to return the EIO as a SIGBUS only if it's not
    because of the gpu having died, to prevent userspace from unduly
    dying.
    
    In my defence the comment right above is completely misleading, so fix
    both.
    
    v2: Drop the WARN_ON, it's not actually a bug to e.g. receive an -EIO
    when swap-in fails.
    
    v3: Don't remove too much ... oops.
    
    Reported-by: Chris Wilson <chris@chris-wilson.co.uk>
    Cc: Chris Wilson <chris@chris-wilson.co.uk>
    Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
    Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
    Signed-off-by: Jani Nikula <jani.nikula@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit e6a17312fd008591c6f0d35ae3c10e2cb454ab30
Author: Mathias Krause <minipli@googlemail.com>
Date:   Wed Aug 27 18:41:19 2014 +0200

    drm/i915: Remove bogus __init annotation from DMI callbacks
    
    commit bbe1c2740d3a25aa1dbe5d842d2ff09cddcdde0a upstream.
    
    The __init annotations for the DMI callback functions are wrong as this
    code can be called even after the module has been initialized, e.g. like
    this:
    
      # echo 1 > /sys/bus/pci/devices/0000:00:02.0/remove
      # modprobe i915
      # echo 1 > /sys/bus/pci/rescan
    
    The first command will remove the PCI device from the kernel's device
    list so the second command won't see it right away. But as it registers
    a PCI driver it'll see it on the third command. If the system happens to
    match one of the DMI table entries we'll try to call a function in long
    released memory and generate an Oops, at best.
    
    Fix this by removing the bogus annotation.
    
    Modpost should have caught that one but it ignores section reference
    mismatches from the .rodata section. :/
    
    Fixes: 25e341cfc33d ("drm/i915: quirk away broken OpRegion VBT")
    Fixes: 8ca4013d702d ("CHROMIUM: i915: Add DMI override to skip CRT...")
    Fixes: 425d244c8670 ("drm/i915: ignore LVDS on intel graphics systems...")
    Signed-off-by: Mathias Krause <minipli@googlemail.com>
    Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
    Cc: Duncan Laurie <dlaurie@chromium.org>
    Cc: Jarod Wilson <jarod@redhat.com>
    Cc: Rusty Russell <rusty@rustcorp.com.au>	# Can modpost be fixed?
    Signed-off-by: Jani Nikula <jani.nikula@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit a671154130fde16d127d432878a672953d255253
Author: Filipe Brandenburger <filbranden@google.com>
Date:   Fri Aug 29 15:18:51 2014 -0700

    xattr: fix check for simultaneous glibc header inclusion
    
    commit bfcfd44cce2774f19daeb59fb4e43fc9aa80e7b8 upstream.
    
    The guard was introduced in commit ea1a8217b06b ("xattr: guard against
    simultaneous glibc header inclusion") but it is using #ifdef to check
    for a define that is either set to 1 or 0.  Fix it to use #if instead.
    
    * Without this patch:
    
      $ { echo "#include <sys/xattr.h>"; echo "#include <linux/xattr.h>"; } | gcc -E -Iinclude/uapi - >/dev/null
      include/uapi/linux/xattr.h:19:0: warning: "XATTR_CREATE" redefined [enabled by default]
       #define XATTR_CREATE 0x1 /* set value, fail if attr already exists */
       ^
      /usr/include/x86_64-linux-gnu/sys/xattr.h:32:0: note: this is the location of the previous definition
       #define XATTR_CREATE XATTR_CREATE
       ^
    
    * With this patch:
    
      $ { echo "#include <sys/xattr.h>"; echo "#include <linux/xattr.h>"; } | gcc -E -Iinclude/uapi - >/dev/null
      (no warnings)
    
    Signed-off-by: Filipe Brandenburger <filbranden@google.com>
    Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
    Cc: Allan McRae <allan@archlinux.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit c84e10787d1dc2b5ccdaf7d62f5a00cae90a0adb
Author: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Date:   Fri Aug 22 16:16:05 2014 -0400

    HID: logitech-dj: prevent false errors to be shown
    
    commit 5abfe85c1d4694d5d4bbd13ecc166262b937adf0 upstream.
    
    Commit "HID: logitech: perform bounds checking on device_id early
    enough" unfortunately leaks some errors to dmesg which are not real
    ones:
    - if the report is not a DJ one, then there is not point in checking
      the device_id
    - the receiver (index 0) can also receive some notifications which
      can be safely ignored given the current implementation
    
    Move out the test regarding the report_id and also discards
    printing errors when the receiver got notified.
    
    Fixes: ad3e14d7c5268c2e24477c6ef54bbdf88add5d36
    
    Reported-and-tested-by: Markus Trippelsdorf <markus@trippelsdorf.de>
    Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
    Signed-off-by: Jiri Kosina <jkosina@suse.cz>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 6e4106ec619b16593d66ad6384f6f983d423ee0b
Author: Jiri Kosina <jkosina@suse.cz>
Date:   Wed Aug 27 09:12:24 2014 +0200

    HID: magicmouse: sanity check report size in raw_event() callback
    
    commit c54def7bd64d7c0b6993336abcffb8444795bf38 upstream.
    
    The report passed to us from transport driver could potentially be
    arbitrarily large, therefore we better sanity-check it so that
    magicmouse_emit_touch() gets only valid values of raw_id.
    
    Reported-by: Steven Vittitoe <scvitti@google.com>
    Signed-off-by: Jiri Kosina <jkosina@suse.cz>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 2c40d59997ed0b885ac31862e21cb5b84a3e7dca
Author: Jiri Kosina <jkosina@suse.cz>
Date:   Wed Aug 27 09:13:15 2014 +0200

    HID: picolcd: sanity check report size in raw_event() callback
    
    commit 844817e47eef14141cf59b8d5ac08dd11c0a9189 upstream.
    
    The report passed to us from transport driver could potentially be
    arbitrarily large, therefore we better sanity-check it so that raw_data
    that we hold in picolcd_pending structure are always kept within proper
    bounds.
    
    Reported-by: Steven Vittitoe <scvitti@google.com>
    Signed-off-by: Jiri Kosina <jkosina@suse.cz>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 63ea55d4d127fa2d544d26a807a9721cf8f650ab
Author: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Date:   Tue Aug 26 20:56:36 2014 +0900

    cfq-iosched: Fix wrong children_weight calculation
    
    commit e15693ef18e13e3e6bffe891fe140f18b8ff6d07 upstream.
    
    cfq_group_service_tree_add() is applying new_weight at the beginning of
    the function via cfq_update_group_weight().
    This actually allows weight to change between adding it to and subtracting
    it from children_weight, and triggers WARN_ON_ONCE() in
    cfq_group_service_tree_del(), or even causes oops by divide error during
    vfr calculation in cfq_group_service_tree_add().
    
    The detailed scenario is as follows:
    1. Create blkio cgroups X and Y as a child of X.
       Set X's weight to 500 and perform some I/O to apply new_weight.
       This X's I/O completes before starting Y's I/O.
    2. Y starts I/O and cfq_group_service_tree_add() is called with Y.
    3. cfq_group_service_tree_add() walks up the tree during children_weight
       calculation and adds parent X's weight (500) to children_weight of root.
       children_weight becomes 500.
    4. Set X's weight to 1000.
    5. X starts I/O and cfq_group_service_tree_add() is called with X.
    6. cfq_group_service_tree_add() applies its new_weight (1000).
    7. I/O of Y completes and cfq_group_service_tree_del() is called with Y.
    8. I/O of X completes and cfq_group_service_tree_del() is called with X.
    9. cfq_group_service_tree_del() subtracts X's weight (1000) from
       children_weight of root. children_weight becomes -500.
       This triggers WARN_ON_ONCE().
    10. Set X's weight to 500.
    11. X starts I/O and cfq_group_service_tree_add() is called with X.
    12. cfq_group_service_tree_add() applies its new_weight (500) and adds it
        to children_weight of root. children_weight becomes 0. Calcularion of
        vfr triggers oops by divide error.
    
    weight should be updated right before adding it to children_weight.
    
    Reported-by: Ruki Sekiya <sekiya.ruki@lab.ntt.co.jp>
    Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
    Acked-by: Tejun Heo <tj@kernel.org>
    Signed-off-by: Jens Axboe <axboe@fb.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit b68162c1ba848b1f9d209c99733c1dd4d4ed77eb
Author: Clemens Ladisch <clemens@ladisch.de>
Date:   Sun Sep 21 22:50:57 2014 +0200

    ALSA: pcm: fix fifo_size frame calculation
    
    commit a9960e6a293e6fc3ed414643bb4e4106272e4d0a upstream.
    
    The calculated frame size was wrong because snd_pcm_format_physical_width()
    actually returns the number of bits, not bytes.
    
    Use snd_pcm_format_size() instead, which not only returns bytes, but also
    simplifies the calculation.
    
    Fixes: 8bea869c5e56 ("ALSA: PCM midlevel: improve fifo_size handling")
    Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit d8a93f26a4521548c4b59d7e719a65e61e47c617
Author: Takashi Iwai <tiwai@suse.de>
Date:   Thu Sep 11 12:59:21 2014 +0200

    ALSA: hda - Fix invalid pin powermap without jack detection
    
    commit 7a9744cb455e6faa287e148394b4b422a6f3c5c4 upstream.
    
    When a driver is set up without the jack detection explicitly (either
    by passing a model option or via a specific fixup), the pin powermap
    of IDT/STAC codecs is set up wrongly, resulting in the silence
    output.  It's because of a logic failure in stac_init_power_map().
    It tries to avoid creating a callback for the pins that have other
    auto-hp and auto-mic callbacks, but the check is done in a wrong way
    at a wrong time.  The stac_init_power_map() should be called after
    creating other jack detection ctls, and the jack callback should be
    created only for jack-detectable widgets.
    
    This patch fixes the check in stac_init_power_map() and its callee
    at the right place, after snd_hda_gen_build_controls().
    
    Reported-by: Adam Richter <adam_richter2004@yahoo.com>
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 6d113a44062cb09e8338c14cac5af8a37e8448fa
Author: Takashi Iwai <tiwai@suse.de>
Date:   Tue Sep 2 07:21:56 2014 +0200

    ALSA: hda - Fix COEF setups for ALC1150 codec
    
    commit acf08081adb5e8fe0519eb97bb49797ef52614d6 upstream.
    
    ALC1150 codec seems to need the COEF- and PLL-setups just like its
    compatible ALC882 codec.  Some machines (e.g. SunMicro X10SAT) show
    the problem like too low output volumes unless the COEF setup is
    applied.
    
    Reported-and-tested-by: Dana Goyette <danagoyette@gmail.com>
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 3854619143761f135b4ac7db963875ec727dc175
Author: Takashi Iwai <tiwai@suse.de>
Date:   Mon Sep 1 14:26:49 2014 +0200

    ALSA: hda - Fix digital mic on Acer Aspire 3830TG
    
    commit ff50479ad61069f3ee14863225aebe36d598e93e upstream.
    
    Acer Aspire 3830TG with CX20588 codec has a digital built-in mic that
    has the same problem like many others, the inverted signal in stereo.
    Apply the same fixup to this machine, too.
    
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 80669110f1e6d653448179e12d40cd8a713ee4a0
Author: Clemens Ladisch <clemens@ladisch.de>
Date:   Thu Aug 21 20:55:21 2014 +0200

    ALSA: core: fix buffer overflow in snd_info_get_line()
    
    commit ddc64b278a4dda052390b3de1b551e59acdff105 upstream.
    
    snd_info_get_line() documents that its last parameter must be one
    less than the buffer size, but this API design guarantees that
    (literally) every caller gets it wrong.
    
    Just change this parameter to have its obvious meaning.
    
    Reported-by: Tommi Rantala <tt.rantala@gmail.com>
    Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit f1cb0494aa7cdec998bb63ead445de5f959ce625
Author: Will Deacon <will.deacon@arm.com>
Date:   Fri Aug 22 14:13:24 2014 +0100

    arm64: ptrace: fix compat hardware watchpoint reporting
    
    commit 27d7ff273c2aad37b28f6ff0cab2cfa35b51e648 upstream.
    
    I'm not sure what I was on when I wrote this, but when iterating over
    the hardware watchpoint array (hbp_watch_array), our index is off by
    ARM_MAX_BRP, so we walk off the end of our thread_struct...
    
    ... except, a dodgy condition in the loop means that it never executes
    at all (bp cannot be NULL).
    
    This patch fixes the code so that we remove the bp check and use the
    correct index for accessing the watchpoint structures.
    
    Signed-off-by: Will Deacon <will.deacon@arm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 1cd8334a4f6df66fcd8b380f5d8aefd13fb269bb
Author: Josef Bacik <jbacik@fb.com>
Date:   Mon Aug 25 13:59:41 2014 -0400

    trace: Fix epoll hang when we race with new entries
    
    commit 4ce97dbf50245227add17c83d87dc838e7ca79d0 upstream.
    
    Epoll on trace_pipe can sometimes hang in a weird case.  If the ring buffer is
    empty when we set waiters_pending but an event shows up exactly at that moment
    we can miss being woken up by the ring buffers irq work.  Since
    ring_buffer_empty() is inherently racey we will sometimes think that the buffer
    is not empty.  So we don't get woken up and we don't think there are any events
    even though there were some ready when we added the watch, which makes us hang.
    This patch fixes this by making sure that we are actually on the wait list
    before we set waiters_pending, and add a memory barrier to make sure
    ring_buffer_empty() is going to be correct.
    
    Link: http://lkml.kernel.org/p/1408989581-23727-1-git-send-email-jbacik@fb.com
    
    Cc: Martin Lau <kafai@fb.com>
    Signed-off-by: Josef Bacik <jbacik@fb.com>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit e7559b0221c2f20ef669b9fa3af35802fb82b232
Author: Fan Du <fan.du@intel.com>
Date:   Tue Sep 16 17:21:04 2014 +0800

    i2c: ismt: use correct length when copy buffer
    
    commit 979bbf7b7ae75cfc06e09d09eda38009a3bdc4a4 upstream.
    
    In block write mode, when encapsulating dma_buffer, first element is
    'command', the rest is data buffer, so only copy actual data buffer
    starting from block[1] with the size indicating by block[0].
    
    Signed-off-by: Fan Du <fan.du@intel.com>
    Acked-by: Neil Horman <nhorman@tuxdriver.com>
    Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit f486b8ed93220f0ddaae8780cdaed6316d7dccc0
Author: Simon Lindgren <simon@aqwary.com>
Date:   Tue Aug 26 21:13:24 2014 +0200

    i2c: at91: Fix a race condition during signal handling in at91_do_twi_xfer.
    
    commit 6721f28a26efd6368497abbdef5dcfc59608d899 upstream.
    
    There is a race condition in at91_do_twi_xfer when signals arrive.
    If a signal is recieved while waiting for a transfer to complete
    wait_for_completion_interruptible_timeout() will return -ERESTARTSYS.
    This is not handled correctly resulting in interrupts still being
    enabled and a transfer being in flight when we return.
    
    Symptoms include a range of oopses and bus lockups. Oopses can happen
    when the transfer completes because the interrupt handler will corrupt
    the stack. If a new transfer is started before the interrupt fires
    the controller will start a new transfer in the middle of the old one,
    resulting in confused slaves and a locked bus.
    
    To avoid this, use wait_for_completion_io_timeout instead so that we
    don't have to deal with gracefully shutting down the transfer and
    disabling the interrupts.
    
    Signed-off-by: Simon Lindgren <simon@aqwary.com>
    Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com>
    Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 383e2104c699ea08738da2770c9383bdfaee58ac
Author: Marek Roszko <mark.roszko@gmail.com>
Date:   Wed Aug 20 21:39:41 2014 -0400

    i2c: at91: add bound checking on SMBus block length bytes
    
    commit 75b81f339c6af43f6f4a1b3eabe0603321dade65 upstream.
    
    The driver was not bound checking the received length byte to ensure it was within the
    the buffer size that is allocated for SMBus blocks. This resulted in buffer overflows
    whenever an invalid length byte was received.
    It also failed to ensure the length byte was not zero. If it received zero, it would end up
    in an infinite loop as the at91_twi_read_next_byte function returned immediately without
    allowing RHR to be read to clear the RXRDY interrupt.
    
    Tested agaisnt a SMBus compliant battery.
    
    Signed-off-by: Marek Roszko <mark.roszko@gmail.com>
    Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com>
    Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 0724c59589da36ee80b8983305106fdcc6a0e6a2
Author: Chen-Yu Tsai <wens@csie.org>
Date:   Mon Sep 1 22:28:13 2014 +0800

    i2c: mv64xxx: continue probe when clock-frequency is missing
    
    commit 0ce4bc1dbdd911ae1763e2d4ff36bd1b214a59f7 upstream.
    
    The "clock-frequency" DT property is listed as optional, However,
    the current code stores the return value of of_property_read_u32 in
    the return code of mv64xxx_of_config, but then forgets to clear it
    after setting the default value of "clock-frequency". It is then
    passed out to the main probe function, resulting in a probe failure
    when "clock-frequency" is missing.
    
    This patch checks and then throws away the return value of
    of_property_read_u32, instead of storing it and having to clear it
    afterwards.
    
    This issue was discovered after the property was removed from all
    sunxi DTs.
    
    Fixes: 4c730a06c19bb ("i2c: mv64xxx: Set bus frequency to 100kHz if clock-frequency is not provided")
    Signed-off-by: Chen-Yu Tsai <wens@csie.org>
    Acked-by: Andrew Lunn <andrew@lunn.ch>
    Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
    Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 0a7c89f6c76c264fb8ff9492421cf279f2bc085c
Author: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
Date:   Thu Jul 31 12:23:23 2014 +0530

    ARM/ARM64: KVM: Nuke Hyp-mode tlbs before enabling MMU
    
    commit f6edbbf36da3a27b298b66c7955fc84e1dcca305 upstream.
    
    X-Gene u-boot runs in EL2 mode with MMU enabled hence we might
    have stale EL2 tlb enteris when we enable EL2 MMU on each host CPU.
    
    This can happen on any ARM/ARM64 board running bootloader in
    Hyp-mode (or EL2-mode) with MMU enabled.
    
    This patch ensures that we flush all Hyp-mode (or EL2-mode) TLBs
    on each host CPU before enabling Hyp-mode (or EL2-mode) MMU.
    
    Tested-by: Mark Rutland <mark.rutland@arm.com>
    Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
    Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
    Signed-off-by: Anup Patel <anup.patel@linaro.org>
    Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 6487706b8ab6a4b737d2b0019b4bcacdbf3db73b
Author: Christoffer Dall <christoffer.dall@linaro.org>
Date:   Tue Aug 26 14:33:02 2014 +0200

    arm/arm64: KVM: Complete WFI/WFE instructions
    
    commit 05e0127f9e362b36aa35f17b1a3d52bca9322a3a upstream.
    
    The architecture specifies that when the processor wakes up from a WFE
    or WFI instruction, the instruction is considered complete, however we
    currrently return to EL1 (or EL0) at the WFI/WFE instruction itself.
    
    While most guests may not be affected by this because their local
    exception handler performs an exception returning setting the event bit
    or with an interrupt pending, some guests like UEFI will get wedged due
    this little mishap.
    
    Simply skip the instruction when we have completed the emulation.
    
    Acked-by: Marc Zyngier <marc.zyngier@arm.com>
    Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
    Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 4d9feb80bcbe13405171033ed7d7fdcee9065831
Author: Sudeep Holla <sudeep.holla@arm.com>
Date:   Tue Sep 2 11:35:24 2014 +0100

    arm64: use irq_set_affinity with force=false when migrating irqs
    
    commit 3d8afe3099ebc602848aa7f09235cce3a9a023ce upstream.
    
    The arm64 interrupt migration code on cpu offline calls
    irqchip.irq_set_affinity() with the argument force=true. Originally
    this argument had no effect because it was not used by any interrupt
    chip driver and there was no semantics defined.
    
    This changed with commit 01f8fa4f01d8 ("genirq: Allow forcing cpu
    affinity of interrupts") which made the force argument useful to route
    interrupts to not yet online cpus without checking the target cpu
    against the cpu online mask. The following commit ffde1de64012
    ("irqchip: gic: Support forced affinity setting") implemented this for
    the GIC interrupt controller.
    
    As a consequence the cpu offline irq migration fails if CPU0 is
    offlined, because CPU0 is still set in the affinity mask and the
    validation against cpu online mask is skipped to the force argument
    being true. The following first_cpu(mask) selection always selects
    CPU0 as the target.
    
    Commit 601c942176d8("arm64: use cpu_online_mask when using forced
    irq_set_affinity") intended to fix the above mentioned issue but
    introduced another issue where affinity can be migrated to a wrong
    CPU due to unconditional copy of cpu_online_mask.
    
    As with for arm, solve the issue by calling irq_set_affinity() with
    force=false from the CPU offline irq migration code so the GIC driver
    validates the affinity mask against CPU online mask and therefore
    removes CPU0 from the possible target candidates. Also revert the
    changes done in the commit 601c942176d8 as it's no longer needed.
    
    Tested on Juno platform.
    
    Fixes: 601c942176d8("arm64: use cpu_online_mask when using forced
    	irq_set_affinity")
    Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
    Acked-by: Mark Rutland <mark.rutland@arm.com>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Will Deacon <will.deacon@arm.com>
    Signed-off-by: Will Deacon <will.deacon@arm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit dcab7dc976758948c325e4d6d887d01ff4770b82
Author: Will Deacon <will.deacon@arm.com>
Date:   Thu Sep 11 14:38:16 2014 +0100

    arm64: flush TLS registers during exec
    
    commit eb35bdd7bca29a13c8ecd44e6fd747a84ce675db upstream.
    
    Nathan reports that we leak TLS information from the parent context
    during an exec, as we don't clear the TLS registers when flushing the
    thread state.
    
    This patch updates the flushing code so that we:
    
      (1) Unconditionally zero the tpidr_el0 register (since this is fully
          context switched for native tasks and zeroed for compat tasks)
    
      (2) Zero the tp_value state in thread_info before clearing the
          tpidrr0_el0 register for compat tasks (since this is only writable
          by the set_tls compat syscall and therefore not fully switched).
    
    A missing compiler barrier is also added to the compat set_tls syscall.
    
    Acked-by: Nathan Lynch <Nathan_Lynch@mentor.com>
    Reported-by: Nathan Lynch <Nathan_Lynch@mentor.com>
    Signed-off-by: Will Deacon <will.deacon@arm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 42dd6eb155777748a1c8637614f9a03c9ebc69b6
Author: Jeff Moyer <jmoyer@redhat.com>
Date:   Tue Sep 2 13:17:00 2014 -0400

    aio: add missing smp_rmb() in read_events_ring
    
    commit 2ff396be602f10b5eab8e73b24f20348fa2de159 upstream.
    
    We ran into a case on ppc64 running mariadb where io_getevents would
    return zeroed out I/O events.  After adding instrumentation, it became
    clear that there was some missing synchronization between reading the
    tail pointer and the events themselves.  This small patch fixes the
    problem in testing.
    
    Thanks to Zach for helping to look into this, and suggesting the fix.
    
    Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
    Signed-off-by: Benjamin LaHaise <bcrl@kvack.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 1a678fac10d094e0b826fb44da1860d73ae0c8d8
Author: Benjamin LaHaise <bcrl@kvack.org>
Date:   Sun Aug 24 13:14:05 2014 -0400

    aio: fix reqs_available handling
    
    commit d856f32a86b2b015ab180ab7a55e455ed8d3ccc5 upstream.
    
    As reported by Dan Aloni, commit f8567a3845ac ("aio: fix aio request
    leak when events are reaped by userspace") introduces a regression when
    user code attempts to perform io_submit() with more events than are
    available in the ring buffer.  Reverting that commit would reintroduce a
    regression when user space event reaping is used.
    
    Fixing this bug is a bit more involved than the previous attempts to fix
    this regression.  Since we do not have a single point at which we can
    count events as being reaped by user space and io_getevents(), we have
    to track event completion by looking at the number of events left in the
    event ring.  So long as there are as many events in the ring buffer as
    there have been completion events generate, we cannot call
    put_reqs_available().  The code to check for this is now placed in
    refill_reqs_available().
    
    A test program from Dan and modified by me for verifying this bug is available
    at http://www.kvack.org/~bcrl/20140824-aio_bug.c .
    
    Reported-by: Dan Aloni <dan@kernelim.com>
    Signed-off-by: Benjamin LaHaise <bcrl@kvack.org>
    Acked-by: Dan Aloni <dan@kernelim.com>
    Cc: Kent Overstreet <kmo@daterainc.com>
    Cc: Mateusz Guzik <mguzik@redhat.com>
    Cc: Petr Matousek <pmatouse@redhat.com>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit bc5bc6c714776753338fdead82da7dc18fac50b6
Author: Anton Blanchard <anton@samba.org>
Date:   Fri Aug 22 11:36:52 2014 +1000

    ibmveth: Fix endian issues with rx_no_buffer statistic
    
    commit cbd5228199d8be45d895d9d0cc2b8ce53835fc21 upstream.
    
    Hidden away in the last 8 bytes of the buffer_list page is a solitary
    statistic. It needs to be byte swapped or else ethtool -S will
    produce numbers that terrify the user.
    
    Since we do this in multiple places, create a helper function with a
    comment explaining what is going on.
    
    Signed-off-by: Anton Blanchard <anton@samba.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 4d75fdbdc0f0c4043158554d85a90d70584ba3d4
Author: Murali Karicheri <m-karicheri2@ti.com>
Date:   Fri Sep 5 13:21:00 2014 -0400

    ahci: add pcid for Marvel 0x9182 controller
    
    commit c5edfff9db6f4d2c35c802acb4abe0df178becee upstream.
    
    Keystone K2E EVM uses Marvel 0x9182 controller. This requires support
    for the ID in the ahci driver.
    
    Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
    Signed-off-by: Tejun Heo <tj@kernel.org>
    Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit a6141656abb1b2b107e892d303b46015a9179c67
Author: James Ralston <james.d.ralston@intel.com>
Date:   Wed Aug 27 14:29:07 2014 -0700

    ahci: Add Device IDs for Intel 9 Series PCH
    
    commit 1b071a0947dbce5c184c12262e02540fbc493457 upstream.
    
    This patch adds the AHCI mode SATA Device IDs for the Intel 9 Series PCH.
    
    Signed-off-by: James Ralston <james.d.ralston@intel.com>
    Signed-off-by: Tejun Heo <tj@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 52bbb80d45a25ff0a64061b117cbc22056aaee26
Author: Arjun Sreedharan <arjun024@gmail.com>
Date:   Sun Aug 17 20:00:09 2014 +0530

    pata_scc: propagate return value of scc_wait_after_reset
    
    commit 4dc7c76cd500fa78c64adfda4b070b870a2b993c upstream.
    
    scc_bus_softreset not necessarily should return zero.
    Propagate the error code.
    
    Signed-off-by: Arjun Sreedharan <arjun024@gmail.com>
    Signed-off-by: Tejun Heo <tj@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit f094737d6ad87244c85c17c3c0b8350bf52686f1
Author: Tejun Heo <tj@kernel.org>
Date:   Mon Aug 18 17:40:09 2014 -0400

    libata: widen Crucial M550 blacklist matching
    
    commit 2a13772a144d2956a7fedd18685921d0a9b8b783 upstream.
    
    Crucial M550 may cause data corruption on queued trims and is
    blacklisted.  The pattern used for it fails to match 1TB one as the
    capacity section will be four chars instead of three.  Widen the
    pattern.
    
    Signed-off-by: Tejun Heo <tj@kernel.org>
    Reported-by: Charles Reiss <woggling@gmail.com>
    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=81071
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit b3ef06ed79985b3815871948779495fa56bd01b6
Author: Florian Fainelli <f.fainelli@gmail.com>
Date:   Wed Aug 6 13:02:27 2014 -0700

    of/irq: Fix lookup to use 'interrupts-extended' property first
    
    commit a9ecdc0fdc54aa499604dbd43132988effcac9b4 upstream.
    
    In case the Device Tree blob passed by the boot agent supplies both an
    'interrupts-extended' and an 'interrupts' property in order to allow for
    older kernels to be usable, prefer the new-style 'interrupts-extended'
    property which conveys a lot more information.
    
    This allows us to have bootloaders willingly maintaining backwards
    compatibility with older kernels without entirely deprecating the
    'interrupts' property.
    
    Update the bindings documentation to describe a situation where both the
    'interrupts-extended' and the 'interrupts' property are present, and
    which one takes precedence over the other.
    
    Acked-by: Rob Herring <robh@kernel.org>
    Signed-off-by: Brian Norris <computersforpeace@gmail.com>
    Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: Grant Likely <grant.likely@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 1168e46269a281b27554fb9d75259e81c8e18120
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Mon Jul 21 10:41:13 2014 -0400

    drm/radeon/TN: only enable bapm on MSI systems
    
    commit 730a336c33a3398d65896e8ee3ef9f5679fe30a9 upstream.
    
    There still seem to be stability problems with other systems.
    
    Bug:
    https://bugs.freedesktop.org/show_bug.cgi?id=72921
    
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 1f2c5d16eeef415810c2ec6b3bb6e1372897fd84
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Tue Jun 17 16:01:08 2014 -0400

    drm/radeon: enable bapm by default on desktop TN/RL boards
    
    commit 0c78a44964db3d483b0c09a8236e0fe123aa9cfc upstream.
    
    bapm enabled the GPU and CPU to share TDP headroom.  It was
    disabled by default since some laptops hung when it was enabled
    in conjunction with dpm.  It seems to be stable on desktop
    boards and fixes hangs on boot with dpm enabled on certain
    boards, so enable it by default on desktop boards.
    
    bug:
    https://bugs.freedesktop.org/show_bug.cgi?id=72921
    
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit b4216116fd15a2609a39c8b40d46fb372c493439
Author: Jiri Kosina <jkosina@suse.cz>
Date:   Thu Aug 7 16:29:53 2014 +0200

    drm/i915: read HEAD register back in init_ring_common() to enforce ordering
    
    commit ece4a17d237a79f63fbfaf3f724a12b6d500555c upstream.
    
    Withtout this, ring initialization fails reliabily during resume with
    
    	[drm:init_ring_common] *ERROR* render ring initialization failed ctl 0001f001 head ffffff8804 tail 00000000 start 000e4000
    
    This is not a complete fix, but it is verified to make the ring
    initialization failures during resume much less likely.
    
    We were not able to root-cause this bug (likely HW-specific to Gen4 chips)
    yet. This is therefore used as a ducttape before problem is fully
    understood and proper fix created, so that people don't suffer from
    completely unusable systems in the meantime.
    
    The discussion and debugging is happening at
    
    	https://bugs.freedesktop.org/show_bug.cgi?id=76554
    
    Signed-off-by: Jiri Kosina <jkosina@suse.cz>
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit e9c15f9c379c9bc33a412e71f5d99d6bd0b4e758
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Fri Aug 1 20:05:30 2014 +0200

    drm/radeon: tweak ACCEL_WORKING2 query for hawaii
    
    commit 3c64bd26f7e9bd589ebe0d1ebec69ef2f784c12d upstream.
    
    Return 2 so we can be sure the kernel has the necessary
    changes for acceleration to work.
    
    Note: This patch depends on these two commits:
     - drm/radeon: fix cut and paste issue for hawaii.
     - drm/radeon: use packet2 for nop on hawaii with old firmware
    
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 1d44d9a085e3b321abf5b526010765b609cd95c5
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Thu Jul 31 17:57:42 2014 -0400

    drm/radeon/atom: add new voltage fetch function for hawaii
    
    commit e9f274b2a1bd4ecc569b823b1e7942e9bf92593e upstream.
    
    Some hawaii boards use a different method for fetching the
    voltage information from the vbios.
    
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit b156ef7ebd6a37ed6760118bfa5a1304b1157cf1
Author: Christian König <christian.koenig@amd.com>
Date:   Wed Jul 30 17:18:12 2014 +0200

    drm/radeon: set VM base addr using the PFP v2
    
    commit f1d2a26b506e9dc7bbe94fae40da0a0d8dcfacd0 upstream.
    
    Seems to make VM flushes more stable on SI and CIK.
    
    v2: only use the PFP on the GFX ring on CIK
    
    Signed-off-by: Christian König <christian.koenig@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 9e5bc65f173a1d907c66ea926a2214786d225a75
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Sun Jul 27 23:21:50 2014 -0400

    drm/radeon: load the lm63 driver for an lm64 thermal chip.
    
    commit 5dc355325b648dc9b4cf3bea4d968de46fd59215 upstream.
    
    Looks like the lm63 driver supports the lm64 as well.
    
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit d9b10b8851c077222c0287f1716f54d0ef00608b
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Mon Jul 14 12:01:40 2014 -0400

    drm/radeon: re-enable dpm by default on BTC
    
    commit c08abf11900e19b14dd3a0cc3d105bd74519cd18 upstream.
    
    This patch depends on:
    e07929810f0a19ddd756558290c7d72827cbfcd9
    (drm/radeon/dpm: fix typo in vddci setup for eg/btc)
    
    bugs:
    https://bugs.freedesktop.org/show_bug.cgi?id=73053
    https://bugzilla.kernel.org/show_bug.cgi?id=68571
    
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 9a10e4070d10d3a14e745725865c3d241898e27b
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Mon Jul 7 17:13:37 2014 -0400

    drm/radeon: re-enable dpm by default on cayman
    
    commit 8f500af4efe347d1a8ac674d115220e8caa84559 upstream.
    
    This patch depends on:
    b0880e87c1fd038b84498944f52e52c3e86ebe59
    (drm/radeon/dpm: fix vddci setup typo on cayman)
    
    bug:
    https://bugs.freedesktop.org/show_bug.cgi?id=69723
    
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 41f4fde0472304c7225f90a41efaf7ae228cd1f1
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Thu Jul 31 18:07:17 2014 -0400

    drm/radeon/dpm: handle voltage info fetching on hawaii
    
    commit 6b57f20cb5b708415fbab63847f8f8429b051af8 upstream.
    
    Some hawaii cards use a different method to fetch the
    voltage info from the vbios.
    
    bug:
    https://bugs.freedesktop.org/show_bug.cgi?id=74250
    
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 085998ea2386f1d78f38a8d6a4f4dcf928cefb83
Author: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Date:   Sun Aug 3 20:02:31 2014 +0900

    drm/ttm: Pass GFP flags in order to avoid deadlock.
    
    commit a91576d7916f6cce76d30303e60e1ac47cf4a76d upstream.
    
    Commit 7dc19d5a "drivers: convert shrinkers to new count/scan API" added
    deadlock warnings that ttm_page_pool_free() and ttm_dma_page_pool_free()
    are currently doing GFP_KERNEL allocation.
    
    But these functions did not get updated to receive gfp_t argument.
    This patch explicitly passes sc->gfp_mask or GFP_KERNEL to these functions,
    and removes the deadlock warning.
    
    Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit f62703c84c5e3eacffca62f6ac35ac1cc10ce5b3
Author: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Date:   Sun Aug 3 20:02:03 2014 +0900

    drm/ttm: Fix possible stack overflow by recursive shrinker calls.
    
    commit 71336e011d1d2312bcbcaa8fcec7365024f3a95d upstream.
    
    While ttm_dma_pool_shrink_scan() tries to take mutex before doing GFP_KERNEL
    allocation, ttm_pool_shrink_scan() does not do it. This can result in stack
    overflow if kmalloc() in ttm_page_pool_free() triggered recursion due to
    memory pressure.
    
      shrink_slab()
      => ttm_pool_shrink_scan()
         => ttm_page_pool_free()
            => kmalloc(GFP_KERNEL)
               => shrink_slab()
                  => ttm_pool_shrink_scan()
                     => ttm_page_pool_free()
                        => kmalloc(GFP_KERNEL)
    
    Change ttm_pool_shrink_scan() to do like ttm_dma_pool_shrink_scan() does.
    
    Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit f8829dd6eb1c5a763545fece8f27e972b9c83a0b
Author: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Date:   Sun Aug 3 20:01:10 2014 +0900

    drm/ttm: Use mutex_trylock() to avoid deadlock inside shrinker functions.
    
    commit 22e71691fd54c637800d10816bbeba9cf132d218 upstream.
    
    I can observe that RHEL7 environment stalls with 100% CPU usage when a
    certain type of memory pressure is given. While the shrinker functions
    are called by shrink_slab() before the OOM killer is triggered, the stall
    lasts for many minutes.
    
    One of reasons of this stall is that
    ttm_dma_pool_shrink_count()/ttm_dma_pool_shrink_scan() are called and
    are blocked at mutex_lock(&_manager->lock). GFP_KERNEL allocation with
    _manager->lock held causes someone (including kswapd) to deadlock when
    these functions are called due to memory pressure. This patch changes
    "mutex_lock();" to "if (!mutex_trylock()) return ...;" in order to
    avoid deadlock.
    
    Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 5469f7749e0abc6c39f8727176577a28d6551f58
Author: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Date:   Sun Aug 3 20:00:40 2014 +0900

    drm/ttm: Choose a pool to shrink correctly in ttm_dma_pool_shrink_scan().
    
    commit 46c2df68f03a236b30808bba361f10900c88d95e upstream.
    
    We can use "unsigned int" instead of "atomic_t" by updating start_pool
    variable under _manager->lock. This patch will make it possible to avoid
    skipping when choosing a pool to shrink in round-robin style, after next
    patch changes mutex_lock(_manager->lock) to !mutex_trylock(_manager->lork).
    
    Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 2d8e4c3e7777da1a709ce00959af4a58117c0edb
Author: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Date:   Sun Aug 3 19:59:35 2014 +0900

    drm/ttm: Fix possible division by 0 in ttm_dma_pool_shrink_scan().
    
    commit 11e504cc705e8ccb06ac93a276e11b5e8fee4d40 upstream.
    
    list_empty(&_manager->pools) being false before taking _manager->lock
    does not guarantee that _manager->npools != 0 after taking _manager->lock
    because _manager->npools is updated under _manager->lock.
    
    Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit a646ad34cce11edcc4261eefab5aa4746d67abd4
Author: Guido Martínez <guido@vanguardiasur.com.ar>
Date:   Tue Jun 17 11:17:09 2014 -0300

    drm/tilcdc: fix double kfree
    
    commit c9a3ad25eddfdb898114a9d73cdb4c3472d9dfca upstream.
    
    display_timings_release calls kfree on the display_timings object passed
    to it. Calling kfree after it is wrong. SLUB debug showed the following
    warning:
    
        =============================================================================
        BUG kmalloc-64 (Tainted: G        W    ): Object already free
        -----------------------------------------------------------------------------
    
        Disabling lock debugging due to kernel taint
        INFO: Allocated in of_get_display_timings+0x2c/0x214 age=601 cpu=0
        pid=884
         __slab_alloc.constprop.79+0x2e0/0x33c
         kmem_cache_alloc+0xac/0xdc
         of_get_display_timings+0x2c/0x214
         panel_probe+0x7c/0x314 [tilcdc]
         platform_drv_probe+0x18/0x48
         [..snip..]
        INFO: Freed in panel_destroy+0x18/0x3c [tilcdc] age=0 cpu=0 pid=907
         __slab_free+0x34/0x330
         panel_destroy+0x18/0x3c [tilcdc]
         tilcdc_unload+0xd0/0x118 [tilcdc]
         drm_dev_unregister+0x24/0x98
         [..snip..]
    
    Signed-off-by: Guido Martínez <guido@vanguardiasur.com.ar>
    Tested-by: Darren Etheridge <detheridge@ti.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 636a7bc02c928da291d21eade568cdc4903be41f
Author: Guido Martínez <guido@vanguardiasur.com.ar>
Date:   Tue Jun 17 11:17:08 2014 -0300

    drm/tilcdc: fix release order on exit
    
    commit eb565a2bbadc6a5030a6dbe58db1aa52453e7edf upstream.
    
    Unregister resources in the correct order on tilcdc_drm_fini, which is
    the reverse order they were registered during tilcdc_drm_init.
    
    This also means unregistering the driver before releasing its resources.
    
    Signed-off-by: Guido Martínez <guido@vanguardiasur.com.ar>
    Tested-by: Darren Etheridge <detheridge@ti.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 7a342b44de8b85c60395a3f967bab39a6f51b9a6
Author: Guido Martínez <guido@vanguardiasur.com.ar>
Date:   Tue Jun 17 11:17:07 2014 -0300

    drm/tilcdc: panel: fix leak when unloading the module
    
    commit 3a49012224ca9016658a831a327ff6a7fe5bb4f9 upstream.
    
    The driver did not unregister the allocated framebuffer, which caused
    memory leaks (and memory manager WARNs) when unloading. Also, the
    framebuffer device under /dev still existed after unloading.
    
    Add a call to drm_fbdev_cma_fini when unloading the module to prevent
    both issues.
    
    Signed-off-by: Guido Martínez <guido@vanguardiasur.com.ar>
    Tested-by: Darren Etheridge <detheridge@ti.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 7bf11803c4eac1118b83683edee0e6f31911e713
Author: Guido Martínez <guido@vanguardiasur.com.ar>
Date:   Tue Jun 17 11:17:06 2014 -0300

    drm/tilcdc: tfp410: fix dangling sysfs connector node
    
    commit 16dcbdef404f4e87dab985494381939fe0a2d456 upstream.
    
    Add a drm_sysfs_connector_remove call when we destroy the panel to make
    sure the connector node in sysfs gets deleted.
    
    This is required for proper unload and re-load of this driver, otherwise
    we will get a warning about a duplicate filename in sysfs.
    
    Signed-off-by: Guido Martínez <guido@vanguardiasur.com.ar>
    Tested-by: Darren Etheridge <detheridge@ti.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 0f0fb98b863860a7ade5ec34b91e57867e37b307
Author: Guido Martínez <guido@vanguardiasur.com.ar>
Date:   Tue Jun 17 11:17:05 2014 -0300

    drm/tilcdc: slave: fix dangling sysfs connector node
    
    commit daa15b4cd1eee58eb1322062a3320b1dbe5dc96e upstream.
    
    Add a drm_sysfs_connector_remove call when we destroy the panel to make
    sure the connector node in sysfs gets deleted.
    
    This is required for proper unload and re-load of this driver as a
    module. Without this, we would get a warning at re-load time like so:
    
       tda998x 0-0070: found TDA19988
       ------------[ cut here ]------------
       WARNING: CPU: 0 PID: 825 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x54/0x74()
       sysfs: cannot create duplicate filename '/class/drm/card0-HDMI-A-1'
       Modules linked in: [..]
       CPU: 0 PID: 825 Comm: modprobe Not tainted 3.15.0-rc4-00027-g9dcdef4 #82
       [<c0013bb8>] (unwind_backtrace) from [<c0011824>] (show_stack+0x10/0x14)
       [<c0011824>] (show_stack) from [<c0034e8c>] (warn_slowpath_common+0x68/0x88)
       [<c0034e8c>] (warn_slowpath_common) from [<c0034edc>] (warn_slowpath_fmt+0x30/0x40)
       [<c0034edc>] (warn_slowpath_fmt) from [<c01243f4>] (sysfs_warn_dup+0x54/0x74)
       [<c01243f4>] (sysfs_warn_dup) from [<c0124708>] (sysfs_do_create_link_sd.isra.2+0xb0/0xb8)
       [<c0124708>] (sysfs_do_create_link_sd.isra.2) from [<c02ae37c>] (device_add+0x338/0x520)
       [<c02ae37c>] (device_add) from [<c02ae6e8>] (device_create_groups_vargs+0xa0/0xc4)
       [<c02ae6e8>] (device_create_groups_vargs) from [<c02ae758>] (device_create+0x24/0x2c)
       [<c02ae758>] (device_create) from [<c029b4ec>] (drm_sysfs_connector_add+0x64/0x204)
       [<c029b4ec>] (drm_sysfs_connector_add) from [<bf0b1b40>] (slave_modeset_init+0x120/0x1bc [tilcdc])
       [<bf0b1b40>] (slave_modeset_init [tilcdc]) from [<bf0b2be8>] (tilcdc_load+0x214/0x4c0 [tilcdc])
       [<bf0b2be8>] (tilcdc_load [tilcdc]) from [<c029955c>] (drm_dev_register+0xa4/0x104)
          [..snip..]
       ---[ end trace 4df8d614936ebdee ]---
       [drm:drm_sysfs_connector_add] *ERROR* failed to register connector device: -17
    
    Signed-off-by: Guido Martínez <guido@vanguardiasur.com.ar>
    Tested-by: Darren Etheridge <detheridge@ti.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit b6f4e53012e4fdeef758bdd450db234fc67a202e
Author: Guido Martínez <guido@vanguardiasur.com.ar>
Date:   Tue Jun 17 11:17:04 2014 -0300

    drm/tilcdc: panel: fix dangling sysfs connector node
    
    commit e396900e649b0af31161634d87fe37076f46c12b upstream.
    
    Add a drm_sysfs_connector_remove call when we destroy the panel to make
    sure the connector node in sysfs gets deleted.
    
    This is required for proper unload and re-load of this driver as a
    module. Without this, we would get a warning at re-load time like so:
    
       ------------[ cut here ]------------
       WARNING: CPU: 0 PID: 824 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x54/0x74()
       sysfs: cannot create duplicate filename '/class/drm/card0-LVDS-1'
       Modules linked in: [...]
       CPU: 0 PID: 824 Comm: modprobe Not tainted 3.15.0-rc4-00027-g6484f96-dirty #81
       [<c0013bb8>] (unwind_backtrace) from [<c0011824>] (show_stack+0x10/0x14)
       [<c0011824>] (show_stack) from [<c0034e8c>] (warn_slowpath_common+0x68/0x88)
       [<c0034e8c>] (warn_slowpath_common) from [<c0034edc>] (warn_slowpath_fmt+0x30/0x40)
       [<c0034edc>] (warn_slowpath_fmt) from [<c01243f4>] (sysfs_warn_dup+0x54/0x74)
       [<c01243f4>] (sysfs_warn_dup) from [<c0124708>] (sysfs_do_create_link_sd.isra.2+0xb0/0xb8)
       [<c0124708>] (sysfs_do_create_link_sd.isra.2) from [<c02ae37c>] (device_add+0x338/0x520)
       [<c02ae37c>] (device_add) from [<c02ae6e8>] (device_create_groups_vargs+0xa0/0xc4)
       [<c02ae6e8>] (device_create_groups_vargs) from [<c02ae758>] (device_create+0x24/0x2c)
       [<c02ae758>] (device_create) from [<c029b4ec>] (drm_sysfs_connector_add+0x64/0x204)
       [<c029b4ec>] (drm_sysfs_connector_add) from [<bf0b1fec>] (panel_modeset_init+0xb8/0x134 [tilcdc])
       [<bf0b1fec>] (panel_modeset_init [tilcdc]) from [<bf0b2bf0>] (tilcdc_load+0x214/0x4c0 [tilcdc])
       [<bf0b2bf0>] (tilcdc_load [tilcdc]) from [<c029955c>] (drm_dev_register+0xa4/0x104)
          [ .. snip .. ]
       ---[ end trace b2d09cd9578b0497 ]---
       [drm:drm_sysfs_connector_add] *ERROR* failed to register connector device: -17
    
    Signed-off-by: Guido Martínez <guido@vanguardiasur.com.ar>
    Tested-by: Darren Etheridge <detheridge@ti.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 032eaee98b667f46b9715c38398e709166a4685d
Author: Ronald Wahl <ronald.wahl@raritan.com>
Date:   Thu Aug 7 14:15:50 2014 +0200

    carl9170: fix sending URBs with wrong type when using full-speed
    
    commit 671796dd96b6cd85b75fba9d3007bcf7e5f7c309 upstream.
    
    The driver assumes that endpoint 4 is always an interrupt endpoint.
    Unfortunately the type differs between high-speed and full-speed
    configurations while in the former case it is indeed an interrupt
    endpoint this is not true for the latter case - here it is a bulk
    endpoint. When sending URBs with the wrong type the kernel will
    generate a warning message including backtrace. In this specific
    case there will be a huge amount of warnings which can bring the system
    to freeze.
    
    To fix this we are now sending URBs to endpoint 4 using the type
    found in the endpoint descriptor.
    
    A side note: The carl9170 firmware currently specifies endpoint 4 as
    interrupt endpoint even in the full-speed configuration but this has
    no relevance because before this firmware is loaded the endpoint type
    is as described above and after the firmware is running the stick is not
    reenumerated and so the old descriptor is used.
    
    Signed-off-by: Ronald Wahl <ronald.wahl@raritan.com>
    Signed-off-by: John W. Linville <linville@tuxdriver.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>