commit f34e7558918d5f635013f621f4a7bf251e994a5c
Author: Ben Hutchings <ben@decadent.org.uk>
Date:   Wed Oct 17 03:50:15 2012 +0100

    Linux 3.2.32

commit 309c9c15f367d6466b24c1affb69c72145fc006d
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Thu Apr 12 01:27:57 2012 +0200

    drm/i915: clear fencing tracking state when retiring requests
    
    commit 15a13bbdffb0d6288a5dd04aee9736267da1335f upstream.
    
    This fixes a resume regression introduced in
    
    commit 7dd4906586274f3945f2aeaaa5a33b451c3b4bba
    Author: Chris Wilson <chris@chris-wilson.co.uk>
    Date:   Wed Mar 21 10:48:18 2012 +0000
    
        drm/i915: Mark untiled BLT commands as fenced on gen2/3
    
    which fixed fencing tracking for untiled blt commands.
    
    A side effect of that patch was that now also untiled objects have a
    non-zero obj->last_fenced_seqno to track when a fence can be set up
    after a pipelined tiling change. Unfortunately this was only cleared
    by the fence setup and teardown code, resulting in tons of untiled but
    inactive objects with non-zero last_fenced_seqno.
    
    Now after resume we completely reset the seqno tracking, both on the
    driver side (by setting dev_priv->next_seqno = 1) and on the hw side
    (by allocating a new hws page, which contains the seqnos). Hilarity
    and indefinite waits ensued from the stale seqnos in
    obj->last_fenced_seqno from before the suspend.
    
    The fix is to properly clear the fencing tracking state like we
    already do for the normal gpu rendering while moving objects off the
    active list.
    
    Reported-and-tested-by: "Rafael J. Wysocki" <rjw@sisk.pl>
    Cc: Jiri Slaby <jslaby@suse.cz>
    Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
    Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit e25aa0dd616effbeedc4acee4a9b8fe2150c2afd
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Mar 21 10:48:18 2012 +0000

    drm/i915: Mark untiled BLT commands as fenced on gen2/3
    
    commit 7dd4906586274f3945f2aeaaa5a33b451c3b4bba upstream.
    
    The BLT commands on gen2/3 utilize the fence registers and so we cannot
    modify any fences for the object whilst those commands are in flight.
    Currently we marked tiled commands as occupying a fence, but forgot to
    restrict the untiled commands from preventing a fence being assigned
    before they were completed.
    
    One side-effect is that we ten have to double check that a fence was
    allocated for a fenced buffer during move-to-active.
    
    Reported-by: Jiri Slaby <jirislaby@gmail.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43427
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47990
    Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    Testcase: i-g-t/tests/gem_tiled_after_untiled_blt
    Tested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    [bwh: Backported to 3.2: The nesting of if-statements in the old
     i915_gem_execbuffer_reserve() differs from pin_and_fence_object(),
     so don't move the assignment of obj->pending_fenced_gpu_access but
     adjust the boolean expression as recommended by Daniel Vetter.]
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit c1852234f294ed3dd1a298f8bad66745ed51e62b
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Wed Dec 14 13:57:15 2011 +0100

    drm/i915: fix swizzle detection for gen3
    
    commit c9c4b6f6c28354f1df9bd288dc33ba7ae0e66aaa upstream.
    
    It looks like the desktop variants of i915 and i945 also have the DCC
    register to control dram channel interleave and cpu side bit6
    swizzling.
    
    Unfortunately internal Cspec/ConfigDB documentation for these ancient chips
    have already been dropped and there seem to be no archives. Also
    somebody thought the swizzling behaviour is surely a worthy secret to
    keep and redacted any mention of these fields from the published Intel
    datasheets.
    
    I suspect the hw engineers were really proud of the page coloring
    they've achieved in their first dual channel dram controller with
    bit17 - after all Bspec explains in great length the optimal layout of
    page frame numbers modulo 4 for the color and depth buffers, too.
    Later on when they've started to work on VT-d they shamefully
    discoverd their stupidity and tried to cover the tracks ...
    
    Tested-by: Daniel Vetter <daniel.vetter@ffwll.ch> (i915g)
    Tested-by: Pavel Ondračka <pavel.ondracka@email.cz> (i945g)
    Tested-by: Chris Wilson <chris@chris-wilson.co.uk>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42625
    Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit f3fe0babe0bef2d01701fcddcecc2ef3b3cd08af
Author: Elric Fu <elricfu1@gmail.com>
Date:   Wed Jun 27 16:55:43 2012 +0800

    xHCI: handle command after aborting the command ring
    
    commit b63f4053cc8aa22a98e3f9a97845afe6c15d0a0d upstream.
    
    According to xHCI spec section 4.6.1.1 and section 4.6.1.2,
    after aborting a command on the command ring, xHC will
    generate a command completion event with its completion
    code set to Command Ring Stopped at least. If a command is
    currently executing at the time of aborting a command, xHC
    also generate a command completion event with its completion
    code set to Command Abort. When the command ring is stopped,
    software may remove, add, or rearrage Command Descriptors.
    
    To cancel a command, software will initialize a command
    descriptor for the cancel command, and add it into a
    cancel_cmd_list of xhci. When the command ring is stopped,
    software will find the command trbs described by command
    descriptors in cancel_cmd_list and modify it to No Op
    command. If software can't find the matched trbs, we can
    think it had been finished.
    
    This patch should be backported to kernels as old as 3.0, that contain
    the commit 7ed603ecf8b68ab81f4c83097d3063d43ec73bb8 "xhci: Add an
    assertion to check for virt_dev=0 bug." That commit papers over a NULL
    pointer dereference, and this patch fixes the underlying issue that
    caused the NULL pointer dereference.
    
    Signed-off-by: Elric Fu <elricfu1@gmail.com>
    Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
    Tested-by: Miroslav Sabljic <miroslav.sabljic@avl.com>
    [bwh: Backported to 3.2: inc_deq() needs an additional 'consumer' argument;
     Jonathan Nieder worked out that this should be false]
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 79c43665e46e20bf3b1029e0cb28e294b84ba6c0
Author: Jesse Brandeburg <jesse.brandeburg@intel.com>
Date:   Wed Jan 4 20:23:33 2012 +0000

    e1000: fix lockdep splat in shutdown handler
    
    commit 3a3847e007aae732d64d8fd1374126393e9879a3 upstream.
    
    As reported by Steven Rostedt, e1000 has a lockdep splat added
    during the recent merge window.  The issue is that
    cancel_delayed_work is called while holding our private mutex.
    
    There is no reason that I can see to hold the mutex during pci
    shutdown, it was more just paranoia that I put the mutex_lock
    around the call to e1000_down.
    
    In a quick survey lots of drivers handle locking differently when
    being called by the pci layer.  The assumption here is that we
    don't need the mutexes' protection in this function because
    the driver could not be unloaded while in the shutdown handler
    which is only called at reboot or poweroff.
    
    Reported-by: Steven Rostedt <rostedt@goodmis.org>
    Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
    Tested-by: Steven Rostedt <rostedt@goodmis.org>
    Tested-by: Aaron Brown <aaron.f.brown@intel.com>
    Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit c06493eb505b0fe5fb96f22dcb6777f8fcd2d3c6
Author: Jan Engelhardt <jengelh@inai.de>
Date:   Fri Sep 21 22:26:52 2012 +0000

    netfilter: xt_limit: have r->cost != 0 case work
    
    commit 82e6bfe2fbc4d48852114c4f979137cd5bf1d1a8 upstream.
    
    Commit v2.6.19-rc1~1272^2~41 tells us that r->cost != 0 can happen when
    a running state is saved to userspace and then reinstated from there.
    
    Make sure that private xt_limit area is initialized with correct values.
    Otherwise, random matchings due to use of uninitialized memory.
    
    Signed-off-by: Jan Engelhardt <jengelh@inai.de>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 8a39c34fada77c490ddb0a8b206cdc8ccf4135e0
Author: Florian Westphal <fw@strlen.de>
Date:   Mon May 7 10:51:43 2012 +0000

    netfilter: limit, hashlimit: avoid duplicated inline
    
    commit 7a909ac70f6b0823d9f23a43f19598d4b57ac901 upstream.
    
    credit_cap can be set to credit, which avoids inlining user2credits
    twice. Also, remove inline keyword and let compiler decide.
    
    old:
        684     192       0     876     36c net/netfilter/xt_limit.o
       4927     344      32    5303    14b7 net/netfilter/xt_hashlimit.o
    now:
        668     192       0     860     35c net/netfilter/xt_limit.o
       4793     344      32    5169    1431 net/netfilter/xt_hashlimit.o
    
    Signed-off-by: Florian Westphal <fw@strlen.de>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit bfa539657d2f54ed7f584e0577a37d4e06c2d959
Author: Lin Ming <mlin@ss.pku.edu.cn>
Date:   Sat Jul 7 18:26:10 2012 +0800

    ipvs: fix oops on NAT reply in br_nf context
    
    commit 9e33ce453f8ac8452649802bee1f410319408f4b upstream.
    
    IPVS should not reset skb->nf_bridge in FORWARD hook
    by calling nf_reset for NAT replies. It triggers oops in
    br_nf_forward_finish.
    
    [  579.781508] BUG: unable to handle kernel NULL pointer dereference at 0000000000000004
    [  579.781669] IP: [<ffffffff817b1ca5>] br_nf_forward_finish+0x58/0x112
    [  579.781792] PGD 218f9067 PUD 0
    [  579.781865] Oops: 0000 [#1] SMP
    [  579.781945] CPU 0
    [  579.781983] Modules linked in:
    [  579.782047]
    [  579.782080]
    [  579.782114] Pid: 4644, comm: qemu Tainted: G        W    3.5.0-rc5-00006-g95e69f9 #282 Hewlett-Packard  /30E8
    [  579.782300] RIP: 0010:[<ffffffff817b1ca5>]  [<ffffffff817b1ca5>] br_nf_forward_finish+0x58/0x112
    [  579.782455] RSP: 0018:ffff88007b003a98  EFLAGS: 00010287
    [  579.782541] RAX: 0000000000000008 RBX: ffff8800762ead00 RCX: 000000000001670a
    [  579.782653] RDX: 0000000000000000 RSI: 000000000000000a RDI: ffff8800762ead00
    [  579.782845] RBP: ffff88007b003ac8 R08: 0000000000016630 R09: ffff88007b003a90
    [  579.782957] R10: ffff88007b0038e8 R11: ffff88002da37540 R12: ffff88002da01a02
    [  579.783066] R13: ffff88002da01a80 R14: ffff88002d83c000 R15: ffff88002d82a000
    [  579.783177] FS:  0000000000000000(0000) GS:ffff88007b000000(0063) knlGS:00000000f62d1b70
    [  579.783306] CS:  0010 DS: 002b ES: 002b CR0: 000000008005003b
    [  579.783395] CR2: 0000000000000004 CR3: 00000000218fe000 CR4: 00000000000027f0
    [  579.783505] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    [  579.783684] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
    [  579.783795] Process qemu (pid: 4644, threadinfo ffff880021b20000, task ffff880021aba760)
    [  579.783919] Stack:
    [  579.783959]  ffff88007693cedc ffff8800762ead00 ffff88002da01a02 ffff8800762ead00
    [  579.784110]  ffff88002da01a02 ffff88002da01a80 ffff88007b003b18 ffffffff817b26c7
    [  579.784260]  ffff880080000000 ffffffff81ef59f0 ffff8800762ead00 ffffffff81ef58b0
    [  579.784477] Call Trace:
    [  579.784523]  <IRQ>
    [  579.784562]
    [  579.784603]  [<ffffffff817b26c7>] br_nf_forward_ip+0x275/0x2c8
    [  579.784707]  [<ffffffff81704b58>] nf_iterate+0x47/0x7d
    [  579.784797]  [<ffffffff817ac32e>] ? br_dev_queue_push_xmit+0xae/0xae
    [  579.784906]  [<ffffffff81704bfb>] nf_hook_slow+0x6d/0x102
    [  579.784995]  [<ffffffff817ac32e>] ? br_dev_queue_push_xmit+0xae/0xae
    [  579.785175]  [<ffffffff8187fa95>] ? _raw_write_unlock_bh+0x19/0x1b
    [  579.785179]  [<ffffffff817ac417>] __br_forward+0x97/0xa2
    [  579.785179]  [<ffffffff817ad366>] br_handle_frame_finish+0x1a6/0x257
    [  579.785179]  [<ffffffff817b2386>] br_nf_pre_routing_finish+0x26d/0x2cb
    [  579.785179]  [<ffffffff817b2cf0>] br_nf_pre_routing+0x55d/0x5c1
    [  579.785179]  [<ffffffff81704b58>] nf_iterate+0x47/0x7d
    [  579.785179]  [<ffffffff817ad1c0>] ? br_handle_local_finish+0x44/0x44
    [  579.785179]  [<ffffffff81704bfb>] nf_hook_slow+0x6d/0x102
    [  579.785179]  [<ffffffff817ad1c0>] ? br_handle_local_finish+0x44/0x44
    [  579.785179]  [<ffffffff81551525>] ? sky2_poll+0xb35/0xb54
    [  579.785179]  [<ffffffff817ad62a>] br_handle_frame+0x213/0x229
    [  579.785179]  [<ffffffff817ad417>] ? br_handle_frame_finish+0x257/0x257
    [  579.785179]  [<ffffffff816e3b47>] __netif_receive_skb+0x2b4/0x3f1
    [  579.785179]  [<ffffffff816e69fc>] process_backlog+0x99/0x1e2
    [  579.785179]  [<ffffffff816e6800>] net_rx_action+0xdf/0x242
    [  579.785179]  [<ffffffff8107e8a8>] __do_softirq+0xc1/0x1e0
    [  579.785179]  [<ffffffff8135a5ba>] ? trace_hardirqs_off_thunk+0x3a/0x6c
    [  579.785179]  [<ffffffff8188812c>] call_softirq+0x1c/0x30
    
    The steps to reproduce as follow,
    
    1. On Host1, setup brige br0(192.168.1.106)
    2. Boot a kvm guest(192.168.1.105) on Host1 and start httpd
    3. Start IPVS service on Host1
       ipvsadm -A -t 192.168.1.106:80 -s rr
       ipvsadm -a -t 192.168.1.106:80 -r 192.168.1.105:80 -m
    4. Run apache benchmark on Host2(192.168.1.101)
       ab -n 1000 http://192.168.1.106/
    
    ip_vs_reply4
      ip_vs_out
        handle_response
          ip_vs_notrack
            nf_reset()
            {
              skb->nf_bridge = NULL;
            }
    
    Actually, IPVS wants in this case just to replace nfct
    with untracked version. So replace the nf_reset(skb) call
    in ip_vs_notrack() with a nf_conntrack_put(skb->nfct) call.
    
    Signed-off-by: Lin Ming <mlin@ss.pku.edu.cn>
    Signed-off-by: Julian Anastasov <ja@ssi.bg>
    Signed-off-by: Simon Horman <horms@verge.net.au>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 9245074996e2eb1f9f592e8d0108949b16542a86
Author: Pablo Neira Ayuso <pablo@netfilter.org>
Date:   Thu Aug 16 02:25:24 2012 +0200

    netfilter: nf_ct_expect: fix possible access to uninitialized timer
    
    commit 2614f86490122bf51eb7c12ec73927f1900f4e7d upstream.
    
    In __nf_ct_expect_check, the function refresh_timer returns 1
    if a matching expectation is found and its timer is successfully
    refreshed. This results in nf_ct_expect_related returning 0.
    Note that at this point:
    
    - the passed expectation is not inserted in the expectation table
      and its timer was not initialized, since we have refreshed one
      matching/existing expectation.
    
    - nf_ct_expect_alloc uses kmem_cache_alloc, so the expectation
      timer is in some undefined state just after the allocation,
      until it is appropriately initialized.
    
    This can be a problem for the SIP helper during the expectation
    addition:
    
     ...
     if (nf_ct_expect_related(rtp_exp) == 0) {
             if (nf_ct_expect_related(rtcp_exp) != 0)
                     nf_ct_unexpect_related(rtp_exp);
     ...
    
    Note that nf_ct_expect_related(rtp_exp) may return 0 for the timer refresh
    case that is detailed above. Then, if nf_ct_unexpect_related(rtcp_exp)
    returns != 0, nf_ct_unexpect_related(rtp_exp) is called, which does:
    
     spin_lock_bh(&nf_conntrack_lock);
     if (del_timer(&exp->timeout)) {
             nf_ct_unlink_expect(exp);
             nf_ct_expect_put(exp);
     }
     spin_unlock_bh(&nf_conntrack_lock);
    
    Note that del_timer always returns false if the timer has been
    initialized.  However, the timer was not initialized since setup_timer
    was not called, therefore, the expectation timer remains in some
    undefined state. If I'm not missing anything, this may lead to the
    removal an unexistent expectation.
    
    To fix this, the optimization that allows refreshing an expectation
    is removed. Now nf_conntrack_expect_related looks more consistent
    to me since it always add the expectation in case that it returns
    success.
    
    Thanks to Patrick McHardy for participating in the discussion of
    this patch.
    
    I think this may be the source of the problem described by:
    http://marc.info/?l=netfilter-devel&m=134073514719421&w=2
    
    Reported-by: Rafal Fitt <rafalf@aplusc.com.pl>
    Acked-by: Patrick McHardy <kaber@trash.net>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 351f007137c71c376bc7accf97dcaa49bea24a6d
Author: Patrick McHardy <kaber@trash.net>
Date:   Thu Aug 9 10:08:47 2012 +0000

    netfilter: nf_nat_sip: fix via header translation with multiple parameters
    
    commit f22eb25cf5b1157b29ef88c793b71972efc47143 upstream.
    
    Via-headers are parsed beginning at the first character after the Via-address.
    When the address is translated first and its length decreases, the offset to
    start parsing at is incorrect and header parameters might be missed.
    
    Update the offset after translating the Via-address to fix this.
    
    Signed-off-by: Patrick McHardy <kaber@trash.net>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 5fd28aca055742a5cf6e02cbac9a29af48386658
Author: Pablo Neira Ayuso <pablo@netfilter.org>
Date:   Wed Aug 29 15:24:09 2012 +0000

    netfilter: nf_nat_sip: fix incorrect handling of EBUSY for RTCP expectation
    
    commit 3f509c689a07a4aa989b426893d8491a7ffcc410 upstream.
    
    We're hitting bug while trying to reinsert an already existing
    expectation:
    
    kernel BUG at kernel/timer.c:895!
    invalid opcode: 0000 [#1] SMP
    [...]
    Call Trace:
     <IRQ>
     [<ffffffffa0069563>] nf_ct_expect_related_report+0x4a0/0x57a [nf_conntrack]
     [<ffffffff812d423a>] ? in4_pton+0x72/0x131
     [<ffffffffa00ca69e>] ip_nat_sdp_media+0xeb/0x185 [nf_nat_sip]
     [<ffffffffa00b5b9b>] set_expected_rtp_rtcp+0x32d/0x39b [nf_conntrack_sip]
     [<ffffffffa00b5f15>] process_sdp+0x30c/0x3ec [nf_conntrack_sip]
     [<ffffffff8103f1eb>] ? irq_exit+0x9a/0x9c
     [<ffffffffa00ca738>] ? ip_nat_sdp_media+0x185/0x185 [nf_nat_sip]
    
    We have to remove the RTP expectation if the RTCP expectation hits EBUSY
    since we keep trying with other ports until we succeed.
    
    Reported-by: Rafal Fitt <rafalf@aplusc.com.pl>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit ffb364427629d467e0087c36ba9edcfd94032327
Author: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Date:   Tue Apr 3 22:02:01 2012 +0200

    netfilter: nf_ct_ipv4: packets with wrong ihl are invalid
    
    commit 07153c6ec074257ade76a461429b567cff2b3a1e upstream.
    
    It was reported that the Linux kernel sometimes logs:
    
    klogd: [2629147.402413] kernel BUG at net / netfilter /
    nf_conntrack_proto_tcp.c: 447!
    klogd: [1072212.887368] kernel BUG at net / netfilter /
    nf_conntrack_proto_tcp.c: 392
    
    ipv4_get_l4proto() in nf_conntrack_l3proto_ipv4.c and tcp_error() in
    nf_conntrack_proto_tcp.c should catch malformed packets, so the errors
    at the indicated lines - TCP options parsing - should not happen.
    However, tcp_error() relies on the "dataoff" offset to the TCP header,
    calculated by ipv4_get_l4proto().  But ipv4_get_l4proto() does not check
    bogus ihl values in IPv4 packets, which then can slip through tcp_error()
    and get caught at the TCP options parsing routines.
    
    The patch fixes ipv4_get_l4proto() by invalidating packets with bogus
    ihl value.
    
    The patch closes netfilter bugzilla id 771.
    
    Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit e489fbf44709bc4e2e82bd0a1389b47228847a41
Author: Mike Galbraith <mgalbraith@suse.de>
Date:   Sat Aug 4 05:44:14 2012 +0200

    sched: Fix migration thread runtime bogosity
    
    commit 8f6189684eb4e85e6c593cd710693f09c944450a upstream.
    
    Make stop scheduler class do the same accounting as other classes,
    
    Migration threads can be caught in the act while doing exec balancing,
    leading to the below due to use of unmaintained ->se.exec_start.  The
    load that triggered this particular instance was an apparently out of
    control heavily threaded application that does system monitoring in
    what equated to an exec bomb, with one of the VERY frequently migrated
    tasks being ps.
    
    %CPU   PID USER     CMD
    99.3    45 root     [migration/10]
    97.7    53 root     [migration/12]
    97.0    57 root     [migration/13]
    90.1    49 root     [migration/11]
    89.6    65 root     [migration/15]
    88.7    17 root     [migration/3]
    80.4    37 root     [migration/8]
    78.1    41 root     [migration/9]
    44.2    13 root     [migration/2]
    
    Signed-off-by: Mike Galbraith <mgalbraith@suse.de>
    Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Link: http://lkml.kernel.org/r/1344051854.6739.19.camel@marge.simpson.net
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    [Steven Rostedt: backport for 3.2.]
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit def274ac605a69628f7d0d2d666484d209b0b6ee
Author: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Date:   Tue May 1 11:43:42 2012 -0500

    hpsa: dial down lockup detection during firmware flash
    
    commit e85c59746957fd6e3595d02cf614370056b5816e upstream.
    
    Dial back the aggressiveness of the controller lockup detection thread.
    Currently it will declare the controller to be locked up if it goes
    for 10 seconds with no interrupts and no change in the heartbeat
    register.  Dial back this to 30 seconds with no heartbeat change, and
    also snoop the ioctl path and if a firmware flash command is detected,
    dial it back further to 4 minutes until the firmware flash command
    completes.  The reason for this is that during the firmware flash
    operation, the controller apparently doesn't update the heartbeat
    register as frequently as it is supposed to, and we can get a false
    positive.
    
    Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
    Signed-off-by: James Bottomley <JBottomley@Parallels.com>
    [bwh: Backported to 3.2: adjust context]
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 68deb46c5269e37f1b1ca257a4b9f3e30e2fa786
Author: Francois Romieu <romieu@fr.zoreil.com>
Date:   Tue Apr 17 11:12:01 2012 +0200

    r8169: 8168c and later require bit 0x20 to be set in Config2 for PME signaling.
    
    commit d387b427c973974dd619a33549c070ac5d0e089f upstream.
    
    The new 84xx stopped flying below the radars.
    
    Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
    Cc: Hayes Wang <hayeswang@realtek.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 65d75135acc35455003acb92d8381a055eec15cb
Author: Francois Romieu <romieu@fr.zoreil.com>
Date:   Tue Apr 17 11:10:11 2012 +0200

    r8169: Config1 is read-only on 8168c and later.
    
    commit 851e60221926a53344b4227879858bef841b0477 upstream.
    
    Suggested by Hayes.
    
    Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
    Cc: Hayes Wang <hayeswang@realtek.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit b99a7496c734f388f65aab959e0c8d32cc8938c6
Author: Mel Gorman <mgorman@suse.de>
Date:   Tue Oct 9 17:58:41 2012 +0100

    mempolicy: fix a memory corruption by refcount imbalance in alloc_pages_vma()
    
    commit 00442ad04a5eac08a98255697c510e708f6082e2 upstream.
    
    Commit cc9a6c877661 ("cpuset: mm: reduce large amounts of memory barrier
    related damage v3") introduced a potential memory corruption.
    shmem_alloc_page() uses a pseudo vma and it has one significant unique
    combination, vma->vm_ops=NULL and vma->policy->flags & MPOL_F_SHARED.
    
    get_vma_policy() does NOT increase a policy ref when vma->vm_ops=NULL
    and mpol_cond_put() DOES decrease a policy ref when a policy has
    MPOL_F_SHARED.  Therefore, when a cpuset update race occurs,
    alloc_pages_vma() falls in 'goto retry_cpuset' path, decrements the
    reference count and frees the policy prematurely.
    
    Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
    Signed-off-by: Mel Gorman <mgorman@suse.de>
    Reviewed-by: Christoph Lameter <cl@linux.com>
    Cc: Josh Boyer <jwboyer@gmail.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Mel Gorman <mgorman@suse.de>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 54e670386ee302cd17d17ac398d1e718307633f2
Author: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Date:   Mon Oct 8 16:29:19 2012 -0700

    mempolicy: fix refcount leak in mpol_set_shared_policy()
    
    commit 63f74ca21f1fad36d075e063f06dcc6d39fe86b2 upstream.
    
    When shared_policy_replace() fails to allocate new->policy is not freed
    correctly by mpol_set_shared_policy().  The problem is that shared
    mempolicy code directly call kmem_cache_free() in multiple places where
    it is easy to make a mistake.
    
    This patch creates an sp_free wrapper function and uses it. The bug was
    introduced pre-git age (IOW, before 2.6.12-rc2).
    
    [mgorman@suse.de: Editted changelog]
    Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
    Signed-off-by: Mel Gorman <mgorman@suse.de>
    Reviewed-by: Christoph Lameter <cl@linux.com>
    Cc: Josh Boyer <jwboyer@gmail.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Mel Gorman <mgorman@suse.de>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 507c18443d05543b9903d2341f8473dd6191f8ef
Author: Mel Gorman <mgorman@suse.de>
Date:   Tue Oct 9 17:58:39 2012 +0100

    mempolicy: fix a race in shared_policy_replace()
    
    commit b22d127a39ddd10d93deee3d96e643657ad53a49 upstream.
    
    shared_policy_replace() use of sp_alloc() is unsafe.  1) sp_node cannot
    be dereferenced if sp->lock is not held and 2) another thread can modify
    sp_node between spin_unlock for allocating a new sp node and next
    spin_lock.  The bug was introduced before 2.6.12-rc2.
    
    Kosaki's original patch for this problem was to allocate an sp node and
    policy within shared_policy_replace and initialise it when the lock is
    reacquired.  I was not keen on this approach because it partially
    duplicates sp_alloc().  As the paths were sp->lock is taken are not that
    performance critical this patch converts sp->lock to sp->mutex so it can
    sleep when calling sp_alloc().
    
    [kosaki.motohiro@jp.fujitsu.com: Original patch]
    Signed-off-by: Mel Gorman <mgorman@suse.de>
    Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
    Reviewed-by: Christoph Lameter <cl@linux.com>
    Cc: Josh Boyer <jwboyer@gmail.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Mel Gorman <mgorman@suse.de>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 23160cf41e2a7c64b0446e5a7fee8fde70e2ee77
Author: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Date:   Mon Oct 8 16:29:16 2012 -0700

    mempolicy: remove mempolicy sharing
    
    commit 869833f2c5c6e4dd09a5378cfc665ffb4615e5d2 upstream.
    
    Dave Jones' system call fuzz testing tool "trinity" triggered the
    following bug error with slab debugging enabled
    
        =============================================================================
        BUG numa_policy (Not tainted): Poison overwritten
        -----------------------------------------------------------------------------
    
        INFO: 0xffff880146498250-0xffff880146498250. First byte 0x6a instead of 0x6b
        INFO: Allocated in mpol_new+0xa3/0x140 age=46310 cpu=6 pid=32154
         __slab_alloc+0x3d3/0x445
         kmem_cache_alloc+0x29d/0x2b0
         mpol_new+0xa3/0x140
         sys_mbind+0x142/0x620
         system_call_fastpath+0x16/0x1b
    
        INFO: Freed in __mpol_put+0x27/0x30 age=46268 cpu=6 pid=32154
         __slab_free+0x2e/0x1de
         kmem_cache_free+0x25a/0x260
         __mpol_put+0x27/0x30
         remove_vma+0x68/0x90
         exit_mmap+0x118/0x140
         mmput+0x73/0x110
         exit_mm+0x108/0x130
         do_exit+0x162/0xb90
         do_group_exit+0x4f/0xc0
         sys_exit_group+0x17/0x20
         system_call_fastpath+0x16/0x1b
    
        INFO: Slab 0xffffea0005192600 objects=27 used=27 fp=0x          (null) flags=0x20000000004080
        INFO: Object 0xffff880146498250 @offset=592 fp=0xffff88014649b9d0
    
    The problem is that the structure is being prematurely freed due to a
    reference count imbalance. In the following case mbind(addr, len) should
    replace the memory policies of both vma1 and vma2 and thus they will
    become to share the same mempolicy and the new mempolicy will have the
    MPOL_F_SHARED flag.
    
      +-------------------+-------------------+
      |     vma1          |     vma2(shmem)   |
      +-------------------+-------------------+
      |                                       |
     addr                                 addr+len
    
    alloc_pages_vma() uses get_vma_policy() and mpol_cond_put() pair for
    maintaining the mempolicy reference count.  The current rule is that
    get_vma_policy() only increments refcount for shmem VMA and
    mpol_conf_put() only decrements refcount if the policy has
    MPOL_F_SHARED.
    
    In above case, vma1 is not shmem vma and vma->policy has MPOL_F_SHARED!
    The reference count will be decreased even though was not increased
    whenever alloc_page_vma() is called.  This has been broken since commit
    [52cd3b07: mempolicy: rework mempolicy Reference Counting] in 2008.
    
    There is another serious bug with the sharing of memory policies.
    Currently, mempolicy rebind logic (it is called from cpuset rebinding)
    ignores a refcount of mempolicy and override it forcibly.  Thus, any
    mempolicy sharing may cause mempolicy corruption.  The bug was
    introduced by commit [68860ec1: cpusets: automatic numa mempolicy
    rebinding].
    
    Ideally, the shared policy handling would be rewritten to either
    properly handle COW of the policy structures or at least reference count
    MPOL_F_SHARED based exclusively on information within the policy.
    However, this patch takes the easier approach of disabling any policy
    sharing between VMAs.  Each new range allocated with sp_alloc will
    allocate a new policy, set the reference count to 1 and drop the
    reference count of the old policy.  This increases the memory footprint
    but is not expected to be a major problem as mbind() is unlikely to be
    used for fine-grained ranges.  It is also inefficient because it means
    we allocate a new policy even in cases where mbind_range() could use the
    new_policy passed to it.  However, it is more straight-forward and the
    change should be invisible to the user.
    
    [mgorman@suse.de: Edited changelog]
    Reported-by: Dave Jones <davej@redhat.com>,
    Cc: Christoph Lameter <cl@linux.com>,
    Reviewed-by: Christoph Lameter <cl@linux.com>
    Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
    Signed-off-by: Mel Gorman <mgorman@suse.de>
    Cc: Josh Boyer <jwboyer@gmail.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Mel Gorman <mgorman@suse.de>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 13fcf5d1c5fe491aeb0b0f34a46d88134432edb1
Author: Seiji Aguchi <seiji.aguchi@hds.com>
Date:   Tue Jul 24 13:27:23 2012 +0000

    efi: initialize efi.runtime_version to make query_variable_info/update_capsule workable
    
    commit d6cf86d8f23253225fe2a763d627ecf7dfee9dae upstream.
    
    A value of efi.runtime_version is checked before calling
    update_capsule()/query_variable_info() as follows.
    But it isn't initialized anywhere.
    
    <snip>
    static efi_status_t virt_efi_query_variable_info(u32 attr,
                                                     u64 *storage_space,
                                                     u64 *remaining_space,
                                                     u64 *max_variable_size)
    {
            if (efi.runtime_version < EFI_2_00_SYSTEM_TABLE_REVISION)
                    return EFI_UNSUPPORTED;
    <snip>
    
    This patch initializes a value of efi.runtime_version at boot time.
    
    Signed-off-by: Seiji Aguchi <seiji.aguchi@hds.com>
    Acked-by: Matthew Garrett <mjg@redhat.com>
    Signed-off-by: Matt Fleming <matt.fleming@intel.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit bdaa64973474612383fc8f144646174ddcfd9db6
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Wed Aug 15 17:18:42 2012 -0400

    drm/radeon: properly handle mc_stop/mc_resume on evergreen+ (v2)
    
    commit 62444b7462a2b98bc78d68736c03a7c4e66ba7e2 upstream.
    
    - Stop the displays from accessing the FB
    - Block CPU access
    - Turn off MC client access
    
    This should fix issues some users have seen, especially
    with UEFI, when changing the MC FB location that result
    in hangs or display corruption.
    
    v2: fix crtc enabled check noticed by Luca Tettamanti
    
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    [bwh: Backported to 3.2:
     - Drop DCE6 cases
     - Call evergreen_mc_wait_for_idle() directly
     - Add dce4_wait_for_vblank() (commits 3ae19b750bdc09ce233e1504348320141593ffda
       and 4a15903db02026728d0cf2755c6fabae16b8db6a) and call it directly
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 4dcbf47bac95e0b7cb4e6fa5347318117a19b580
Author: Tyler Hicks <tyhicks@canonical.com>
Date:   Wed Sep 12 18:38:00 2012 -0700

    eCryptfs: Call lower ->flush() from ecryptfs_flush()
    
    commit 64e6651dcc10e9d2cc6230208a8e6c2cfd19ae18 upstream.
    
    Since eCryptfs only calls fput() on the lower file in
    ecryptfs_release(), eCryptfs should call the lower filesystem's
    ->flush() from ecryptfs_flush().
    
    If the lower filesystem implements ->flush(), then eCryptfs should try
    to flush out any dirty pages prior to calling the lower ->flush(). If
    the lower filesystem does not implement ->flush(), then eCryptfs has no
    need to do anything in ecryptfs_flush() since dirty pages are now
    written out to the lower filesystem in ecryptfs_release().
    
    Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 2f45faef3bca26259cb419692f70788e5b77f563
Author: Tyler Hicks <tyhicks@canonical.com>
Date:   Wed Sep 12 18:02:46 2012 -0700

    eCryptfs: Write out all dirty pages just before releasing the lower file
    
    commit 7149f2558d5b5b988726662fe58b1c388337805b upstream.
    
    Fixes a regression caused by:
    
    821f749 eCryptfs: Revert to a writethrough cache model
    
    That patch reverted some code (specifically, 32001d6f) that was
    necessary to properly handle open() -> mmap() -> close() -> dirty pages
    -> munmap(), because the lower file could be closed before the dirty
    pages are written out.
    
    Rather than reapplying 32001d6f, this approach is a better way of
    ensuring that the lower file is still open in order to handle writing
    out the dirty pages. It is called from ecryptfs_release(), while we have
    a lock on the lower file pointer, just before the lower file gets the
    final fput() and we overwrite the pointer.
    
    https://launchpad.net/bugs/1047261
    
    Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
    Reported-by: Artemy Tregubenko <me@arty.name>
    Tested-by: Artemy Tregubenko <me@arty.name>
    Tested-by: Colin Ian King <colin.king@canonical.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit a50c5c503ad54c9e9995ecadb745c0180a651f69
Author: Tyler Hicks <tyhicks@canonical.com>
Date:   Tue Jul 3 16:50:57 2012 -0700

    eCryptfs: Revert to a writethrough cache model
    
    commit 821f7494a77627fb1ab539591c57b22cdca702d6 upstream.
    
    A change was made about a year ago to get eCryptfs to better utilize its
    page cache during writes. The idea was to do the page encryption
    operations during page writeback, rather than doing them when initially
    writing into the page cache, to reduce the number of page encryption
    operations during sequential writes. This meant that the encrypted page
    would only be written to the lower filesystem during page writeback,
    which was a change from how eCryptfs had previously wrote to the lower
    filesystem in ecryptfs_write_end().
    
    The change caused a few eCryptfs-internal bugs that were shook out.
    Unfortunately, more grave side effects have been identified that will
    force changes outside of eCryptfs. Because the lower filesystem isn't
    consulted until page writeback, eCryptfs has no way to pass lower write
    errors (ENOSPC, mainly) back to userspace. Additionaly, it was reported
    that quotas could be bypassed because of the way eCryptfs may sometimes
    open the lower filesystem using a privileged kthread.
    
    It would be nice to resolve the latest issues, but it is best if the
    eCryptfs commits be reverted to the old behavior in the meantime.
    
    This reverts:
    32001d6f "eCryptfs: Flush file in vma close"
    5be79de2 "eCryptfs: Flush dirty pages in setattr"
    57db4e8d "ecryptfs: modify write path to encrypt page in writepage"
    
    Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
    Tested-by: Colin King <colin.king@canonical.com>
    Cc: Colin King <colin.king@canonical.com>
    Cc: Thieu Le <thieule@google.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 5fb231c6b869110087e70b42b1dd6b5279045eb3
Author: Tyler Hicks <tyhicks@canonical.com>
Date:   Wed Jun 20 23:50:59 2012 -0700

    eCryptfs: Initialize empty lower files when opening them
    
    commit e3ccaa9761200952cc269b1f4b7d7bb77a5e071b upstream.
    
    Historically, eCryptfs has only initialized lower files in the
    ecryptfs_create() path. Lower file initialization is the act of writing
    the cryptographic metadata from the inode's crypt_stat to the header of
    the file. The ecryptfs_open() path already expects that metadata to be
    in the header of the file.
    
    A number of users have reported empty lower files in beneath their
    eCryptfs mounts. Most of the causes for those empty files being left
    around have been addressed, but the presence of empty files causes
    problems due to the lack of proper cryptographic metadata.
    
    To transparently solve this problem, this patch initializes empty lower
    files in the ecryptfs_open() error path. If the metadata is unreadable
    due to the lower inode size being 0, plaintext passthrough support is
    not in use, and the metadata is stored in the header of the file (as
    opposed to the user.ecryptfs extended attribute), the lower file will be
    initialized.
    
    The number of nested conditionals in ecryptfs_open() was getting out of
    hand, so a helper function was created. To avoid the same nested
    conditional problem, the conditional logic was reversed inside of the
    helper function.
    
    https://launchpad.net/bugs/911507
    
    Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
    Cc: John Johansen <john.johansen@canonical.com>
    Cc: Colin Ian King <colin.king@canonical.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 04661578e516400ca013a5bba87a2868bfb31610
Author: Tyler Hicks <tyhicks@canonical.com>
Date:   Tue May 22 15:09:50 2012 -0500

    eCryptfs: Unlink lower inode when ecryptfs_create() fails
    
    commit 8bc2d3cf612994a960c2e8eaea37f6676f67082a upstream.
    
    ecryptfs_create() creates a lower inode, allocates an eCryptfs inode,
    initializes the eCryptfs inode and cryptographic metadata attached to
    the inode, and then writes the metadata to the header of the file.
    
    If an error was to occur after the lower inode was created, an empty
    lower file would be left in the lower filesystem. This is a problem
    because ecryptfs_open() refuses to open any lower files which do not
    have the appropriate metadata in the file header.
    
    This patch properly unlinks the lower inode when an error occurs in the
    later stages of ecryptfs_create(), reducing the chance that an empty
    lower file will be left in the lower filesystem.
    
    https://launchpad.net/bugs/872905
    
    Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
    Cc: John Johansen <john.johansen@canonical.com>
    Cc: Colin Ian King <colin.king@canonical.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 9864b931b1185d463c05ef7dff840f4e0d20c605
Author: Nikola Pajkovsky <npajkovs@redhat.com>
Date:   Wed Aug 15 00:38:08 2012 +0200

    udf: fix retun value on error path in udf_load_logicalvol
    
    commit 68766a2edcd5cd744262a70a2f67a320ac944760 upstream.
    
    In case we detect a problem and bail out, we fail to set "ret" to a
    nonzero value, and udf_load_logicalvol will mistakenly report success.
    
    Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
    Signed-off-by: Jan Kara <jack@suse.cz>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit b7a9b74916d8e7ef5ac4970a71cdf411ae1286c8
Author: Ian Kent <raven@themaw.net>
Date:   Thu Oct 11 08:00:33 2012 +0800

    autofs4 - fix reset pending flag on mount fail
    
    commit 49999ab27eab6289a8e4f450e148bdab521361b2 upstream.
    
    In autofs4_d_automount(), if a mount fail occurs the AUTOFS_INF_PENDING
    mount pending flag is not cleared.
    
    One effect of this is when using the "browse" option, directory entry
    attributes show up with all "?"s due to the incorrect callback and
    subsequent failure return (when in fact no callback should be made).
    
    Signed-off-by: Ian Kent <ikent@redhat.com>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit e69e19924bdbfb7a44ac64c206d5cbcae57910ed
Author: Stefan Richter <stefanr@s5r6.in-berlin.de>
Date:   Sat Oct 6 14:12:56 2012 +0200

    firewire: cdev: fix user memory corruption (i386 userland on amd64 kernel)
    
    commit 790198f74c9d1b46b6a89504361b1a844670d050 upstream.
    
    Fix two bugs of the /dev/fw* character device concerning the
    FW_CDEV_IOC_GET_INFO ioctl with nonzero fw_cdev_get_info.bus_reset.
    (Practically all /dev/fw* clients issue this ioctl right after opening
    the device.)
    
    Both bugs are caused by sizeof(struct fw_cdev_event_bus_reset) being 36
    without natural alignment and 40 with natural alignment.
    
     1) Memory corruption, affecting i386 userland on amd64 kernel:
        Userland reserves a 36 bytes large buffer, kernel writes 40 bytes.
        This has been first found and reported against libraw1394 if
        compiled with gcc 4.7 which happens to order libraw1394's stack such
        that the bug became visible as data corruption.
    
     2) Information leak, affecting all kernel architectures except i386:
        4 bytes of random kernel stack data were leaked to userspace.
    
    Hence limit the respective copy_to_user() to the 32-bit aligned size of
    struct fw_cdev_event_bus_reset.
    
    Reported-by: Simon Kirby <sim@hostway.ca>
    Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit c1bc78797baaf98cb565d0c4afcb8ef26bb28655
Author: Michal Hocko <mhocko@suse.cz>
Date:   Mon Oct 8 16:33:31 2012 -0700

    hugetlb: do not use vma_hugecache_offset() for vma_prio_tree_foreach
    
    commit 36e4f20af833d1ce196e6a4ade05dc26c44652d1 upstream.
    
    Commit 0c176d52b0b2 ("mm: hugetlb: fix pgoff computation when unmapping
    page from vma") fixed pgoff calculation but it has replaced it by
    vma_hugecache_offset() which is not approapriate for offsets used for
    vma_prio_tree_foreach() because that one expects index in page units
    rather than in huge_page_shift.
    
    Johannes said:
    
    : The resulting index may not be too big, but it can be too small: assume
    : hpage size of 2M and the address to unmap to be 0x200000.  This is regular
    : page index 512 and hpage index 1.  If you have a VMA that maps the file
    : only starting at the second huge page, that VMAs vm_pgoff will be 512 but
    : you ask for offset 1 and miss it even though it does map the page of
    : interest.  hugetlb_cow() will try to unmap, miss the vma, and retry the
    : cow until the allocation succeeds or the skipped vma(s) go away.
    
    Signed-off-by: Michal Hocko <mhocko@suse.cz>
    Acked-by: Hillf Danton <dhillf@gmail.com>
    Cc: Mel Gorman <mel@csn.ul.ie>
    Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
    Cc: Andrea Arcangeli <aarcange@redhat.com>
    Cc: David Rientjes <rientjes@google.com>
    Acked-by: Johannes Weiner <hannes@cmpxchg.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 003be05aed2f27a0ab5f5aadc90a68183f0c6e19
Author: Hillf Danton <dhillf@gmail.com>
Date:   Tue Jan 10 15:08:19 2012 -0800

    mm: hugetlb: fix pgoff computation when unmapping page from vma
    
    commit 0c176d52b0b2619f231b2bbf329b90c028134f58 upstream.
    
    The computation for pgoff is incorrect, at least with
    
    	(vma->vm_pgoff >> PAGE_SHIFT)
    
    involved.  It is fixed with the available method if HPAGE_SIZE is
    concerned in page cache lookup.
    
    [akpm@linux-foundation.org: use vma_hugecache_offset() directly, per Michal]
    Signed-off-by: Hillf Danton <dhillf@gmail.com>
    Cc: Mel Gorman <mel@csn.ul.ie>
    Cc: Michal Hocko <mhocko@suse.cz>
    Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
    Cc: Andrea Arcangeli <aarcange@redhat.com>
    Cc: David Rientjes <rientjes@google.com>
    Reviewed-by: Michal Hocko <mhocko@suse.cz>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    [bwh: Backported to 3.2: adjust context]
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit ddd937a27bb51cda5a5400df8e18e9a29d7fa8ec
Author: Andrea Arcangeli <aarcange@redhat.com>
Date:   Mon Oct 8 16:33:27 2012 -0700

    mm: thp: fix pmd_present for split_huge_page and PROT_NONE with THP
    
    commit 027ef6c87853b0a9df53175063028edb4950d476 upstream.
    
    In many places !pmd_present has been converted to pmd_none.  For pmds
    that's equivalent and pmd_none is quicker so using pmd_none is better.
    
    However (unless we delete pmd_present) we should provide an accurate
    pmd_present too.  This will avoid the risk of code thinking the pmd is non
    present because it's under __split_huge_page_map, see the pmd_mknotpresent
    there and the comment above it.
    
    If the page has been mprotected as PROT_NONE, it would also lead to a
    pmd_present false negative in the same way as the race with
    split_huge_page.
    
    Because the PSE bit stays on at all times (both during split_huge_page and
    when the _PAGE_PROTNONE bit get set), we could only check for the PSE bit,
    but checking the PROTNONE bit too is still good to remember pmd_present
    must always keep PROT_NONE into account.
    
    This explains a not reproducible BUG_ON that was seldom reported on the
    lists.
    
    The same issue is in pmd_large, it would go wrong with both PROT_NONE and
    if it races with split_huge_page.
    
    Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
    Acked-by: Rik van Riel <riel@redhat.com>
    Cc: Johannes Weiner <jweiner@redhat.com>
    Cc: Hugh Dickins <hughd@google.com>
    Cc: Mel Gorman <mgorman@suse.de>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit fa7866bad2e715a2a39fae474fe4fd2704ff8370
Author: Hugh Dickins <hughd@google.com>
Date:   Mon Oct 8 16:33:14 2012 -0700

    mm: fix invalidate_complete_page2() lock ordering
    
    commit ec4d9f626d5908b6052c2973f37992f1db52e967 upstream.
    
    In fuzzing with trinity, lockdep protested "possible irq lock inversion
    dependency detected" when isolate_lru_page() reenabled interrupts while
    still holding the supposedly irq-safe tree_lock:
    
    invalidate_inode_pages2
      invalidate_complete_page2
        spin_lock_irq(&mapping->tree_lock)
        clear_page_mlock
          isolate_lru_page
            spin_unlock_irq(&zone->lru_lock)
    
    isolate_lru_page() is correct to enable interrupts unconditionally:
    invalidate_complete_page2() is incorrect to call clear_page_mlock() while
    holding tree_lock, which is supposed to nest inside lru_lock.
    
    Both truncate_complete_page() and invalidate_complete_page() call
    clear_page_mlock() before taking tree_lock to remove page from radix_tree.
     I guess invalidate_complete_page2() preferred to test PageDirty (again)
    under tree_lock before committing to the munlock; but since the page has
    already been unmapped, its state is already somewhat inconsistent, and no
    worse if clear_page_mlock() moved up.
    
    Reported-by: Sasha Levin <levinsasha928@gmail.com>
    Deciphered-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Hugh Dickins <hughd@google.com>
    Acked-by: Mel Gorman <mel@csn.ul.ie>
    Cc: Rik van Riel <riel@redhat.com>
    Cc: Johannes Weiner <hannes@cmpxchg.org>
    Cc: Michel Lespinasse <walken@google.com>
    Cc: Ying Han <yinghan@google.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit eb04142b260198116be79acafc28aca04606ff51
Author: Colin Cross <ccross@android.com>
Date:   Mon Oct 8 14:01:12 2012 -0700

    ARM: OMAP: counter: add locking to read_persistent_clock
    
    commit 9d7d6e363b06934221b81a859d509844c97380df upstream.
    
    read_persistent_clock uses a global variable, use a spinlock to
    ensure non-atomic updates to the variable don't overlap and cause
    time to move backwards.
    
    Signed-off-by: Colin Cross <ccross@android.com>
    Signed-off-by: R Sricharan <r.sricharan@ti.com>
    Signed-off-by: Tony Lindgren <tony@atomide.com>
    [bwh: Backported to 3.2: adjust context]
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 664f857bc07bf8e327b0f1271d3490c7af4a5195
Author: Jaehoon Chung <jh80.chung@samsung.com>
Date:   Wed Sep 19 14:43:33 2012 +0800

    mmc: sdhci-s3c: fix the wrong number of max bus clocks
    
    commit 5feb54a1ab91a237e247c013b8c4fb100ea347b1 upstream.
    
    We can use up to four bus-clocks; but on module remove, we didn't
    disable the fourth bus clock.
    
    Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
    Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
    Signed-off-by: Chris Ball <cjb@laptop.org>
    [bwh: Backported to 3.2: adjust context]
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 1fd7e28a2d9dec2c758bf43b92b1613dd22161d6
Author: Omair Mohammed Abdullah <omair.m.abdullah@linux.intel.com>
Date:   Sat Sep 29 12:24:05 2012 +0530

    ALSA: aloop - add locking to timer access
    
    commit d4f1e48bd11e3df6a26811f7a1f06c4225d92f7d upstream.
    
    When the loopback timer handler is running, calling del_timer() (for STOP
    trigger) will not wait for the handler to complete before deactivating the
    timer. The timer gets rescheduled in the handler as usual. Then a subsequent
    START trigger will try to start the timer using add_timer() with a timer pending
    leading to a kernel panic.
    
    Serialize the calls to add_timer() and del_timer() using a spin lock to avoid
    this.
    
    Signed-off-by: Omair Mohammed Abdullah <omair.m.abdullah@linux.intel.com>
    Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 7737238648b535686434fdb1717b10d4c4f7c6d8
Author: Felix Kaechele <felix@fetzig.org>
Date:   Wed Sep 26 01:20:44 2012 +0200

    ALSA: hda - Add inverted internal mic quirk for Lenovo IdeaPad U310
    
    commit e4db0952e542090c605fd41d31d761f1b4624f4a upstream.
    
    The Lenovo IdeaPad U310 has an internal mic where the right channel
    is phase inverted.
    
    Signed-off-by: Felix Kaechele <felix@fetzig.org>
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit d2f11b9e87180966534b8dc0644aa8e6c97ac35e
Author: David Henningsson <david.henningsson@canonical.com>
Date:   Thu Jun 21 16:03:01 2012 +0200

    ALSA: HDA: Add inverted internal mic quirk for Lenovo S205
    
    commit b3c5dce81584391af8b6dedb0647e65c17aab3a2 upstream.
    
    The Lenovo Ideapad S205 has an internal mic where the right channel
    is phase inverted.
    
    BugLink: https://bugs.launchpad.net/bugs/884652
    Signed-off-by: David Henningsson <david.henningsson@canonical.com>
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit f07416a892d7670aea981ef74b7e0a2cfcb99d29
Author: David Henningsson <david.henningsson@canonical.com>
Date:   Mon Apr 2 15:40:27 2012 +0200

    ALSA: hda - Fix internal mic for Lenovo Ideapad U300s
    
    commit 18dcd3044e4c4b3ab6341c98e8d0e81e0d58d5e3 upstream.
    
    The internal mic input is phase inverted on one channel.
    To avoid people in userspace summing the channels together
    and get zero result, use a separate mixer control for the
    inverted channel.
    
    BugLink: https://bugs.launchpad.net/bugs/903853
    Signed-off-by: David Henningsson <david.henningsson@canonical.com>
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    [bwh: Backported to 3.2:
     - Adjust context
     - Change both invocations of apply_pin_fixup()]
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 927ba3c8a63892480157f13ba912c04ef9d4b012
Author: Alexandre Bounine <alexandre.bounine@idt.com>
Date:   Thu Oct 4 17:15:48 2012 -0700

    rapidio/rionet: fix multicast packet transmit logic
    
    commit 7c4a6106d6451fc03c491e61df37c044505d843a upstream.
    
    Fix multicast packet transmit logic to account for repetitive transmission
    of single skb:
    - correct check for available buffers (this bug may produce NULL pointer
      crash dump in case of heavy traffic);
    - update skb user count (incorrect user counter causes a warning dump from
      net_tx_action routine during multicast transfers in systems with three or
      more rionet participants).
    
    Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com>
    Cc: Matt Porter <mporter@kernel.crashing.org>
    Cc: David S. Miller <davem@davemloft.net>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 0ae961fe09b82f5b073420233bca2475a814d75b
Author: Davidlohr Bueso <dave@gnu.org>
Date:   Thu Oct 4 17:13:18 2012 -0700

    lib/gcd.c: prevent possible div by 0
    
    commit e96875677fb2b7cb739c5d7769824dff7260d31d upstream.
    
    Account for all properties when a and/or b are 0:
    gcd(0, 0) = 0
    gcd(a, 0) = a
    gcd(0, b) = b
    
    Fixes no known problems in current kernels.
    
    Signed-off-by: Davidlohr Bueso <dave@gnu.org>
    Cc: Eric Dumazet <eric.dumazet@gmail.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 38ad8e94283a9b130d17407bfaa023b69bfd0224
Author: Shawn Guo <shawn.guo@linaro.org>
Date:   Thu Oct 4 17:12:23 2012 -0700

    kernel/sys.c: call disable_nonboot_cpus() in kernel_restart()
    
    commit f96972f2dc6365421cf2366ebd61ee4cf060c8d5 upstream.
    
    As kernel_power_off() calls disable_nonboot_cpus(), we may also want to
    have kernel_restart() call disable_nonboot_cpus().  Doing so can help
    machines that require boot cpu be the last alive cpu during reboot to
    survive with kernel restart.
    
    This fixes one reboot issue seen on imx6q (Cortex-A9 Quad).  The machine
    requires that the restart routine be run on the primary cpu rather than
    secondary ones.  Otherwise, the secondary core running the restart
    routine will fail to come to online after reboot.
    
    Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 7b786bcb5899a366ab272776dfd4b47a0bd1fe6b
Author: Martin Michlmayr <tbm@cyrius.com>
Date:   Thu Oct 4 17:11:25 2012 -0700

    drivers/scsi/atp870u.c: fix bad use of udelay
    
    commit 0f6d93aa9d96cc9022b51bd10d462b03296be146 upstream.
    
    The ACARD driver calls udelay() with a value > 2000, which leads to to
    the following compilation error on ARM:
    
      ERROR: "__bad_udelay" [drivers/scsi/atp870u.ko] undefined!
      make[1]: *** [__modpost] Error 1
    
    This is because udelay is defined on ARM, roughly speaking, as
    
    	#define udelay(n) ((n) > 2000 ? __bad_udelay() : \
    		__const_udelay((n) * ((2199023U*HZ)>>11)))
    
    The argument to __const_udelay is the number of jiffies to wait divided
    by 4, but this does not work unless the multiplication does not
    overflow, and that is what the build error is designed to prevent.  The
    intended behavior can be achieved by using mdelay to call udelay
    multiple times in a loop.
    
    [jrnieder@gmail.com: adding context]
    Signed-off-by: Martin Michlmayr <tbm@cyrius.com>
    Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
    Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 78333ac70289fc366841818359135402163e1927
Author: Sascha Hauer <s.hauer@pengutronix.de>
Date:   Thu Oct 4 17:11:17 2012 -0700

    kbuild: make: fix if_changed when command contains backslashes
    
    commit c353acba28fb3fa1fd05fd6b85a9fc7938330f9c upstream.
    
    The call if_changed mechanism does not work when the command contains
    backslashes.  This basically is an issue with lzo and bzip2 compressed
    kernels.  The compressed binaries do not contain the uncompressed image
    size, so these use size_append to append the size.  This results in
    backslashes in the executed command.  With this if_changed always
    detects a change in the command and rebuilds the compressed image even
    if nothing has changed.
    
    Fix this by escaping backslashes in make-cmd
    
    Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
    Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
    Cc: Sam Ravnborg <sam@ravnborg.org>
    Cc: Bernhard Walle <bernhard@bwalle.de>
    Cc: Michal Marek <mmarek@suse.cz>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 5070d81a7bfaafc9849456513f58ca21e5a48948
Author: Fabio Estevam <fabio.estevam@freescale.com>
Date:   Thu Oct 4 17:11:16 2012 -0700

    drivers/dma/dmaengine.c: lower the priority of 'failed to get' dma channel message
    
    commit 0eb5a35801df3c438ce3fc91310a415ea4452c00 upstream.
    
    Do the same as commit a03a202e95fd ("dmaengine: failure to get a
    specific DMA channel is not critical") to get rid of the following
    messages during kernel boot:
    
      dmaengine_get: failed to get dma1chan0: (-22)
      dmaengine_get: failed to get dma1chan1: (-22)
      dmaengine_get: failed to get dma1chan2: (-22)
      dmaengine_get: failed to get dma1chan3: (-22)
      ..
    
    Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
    Cc: Vinod Koul <vinod.koul@intel.com>
    Cc: Dan Williams <dan.j.williams@intel.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    [bwh: Backported to 3.2: also apply changes to this logging statement
     from commit 634332502366 ('dmaengine: Cleanup logging messages')]
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 904e3e1af742e8893f257991aff8eafcfb48e73f
Author: Geert Uytterhoeven <geert@linux-m68k.org>
Date:   Thu Oct 4 17:11:13 2012 -0700

    mn10300: only add -mmem-funcs to KBUILD_CFLAGS if gcc supports it
    
    commit 9957423f035c2071f6d1c5d2f095cdafbeb25ad7 upstream.
    
    It seems the current (gcc 4.6.3) no longer provides this so make it
    conditional.
    
    As reported by Tony before, the mn10300 architecture cross-compiles with
    gcc-4.6.3 if -mmem-funcs is not added to KBUILD_CFLAGS.
    
    Reported-by: Tony Breeds <tony@bakeyournoodle.com>
    Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
    Cc: David Howells <dhowells@redhat.com>
    Cc: Koichi Yasutake <yasutake.koichi@jp.panasonic.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 250c7501a05653cd581be4f0ae74f72e74ae6e5e
Author: Ben Widawsky <ben@bwidawsk.net>
Date:   Wed Oct 3 19:34:24 2012 -0700

    drm/i915: Fix GT_MODE default value
    
    commit f8f2ac9a76b0f80a6763ca316116a7bab8486997 upstream.
    
    I can't even find how I figured this might be needed anymore. But sure
    enough, the value I'm reading back on platforms doesn't match what the
    docs recommends.
    
    It seemed to fix Chris' GT1 in limited testing as well.
    
    Tested-by: Chris Wilson <chris@chris-wilson.co.uk>
    Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    [bwh: Backported to 3.2: open-code _MASKED_BIT_{ENABLE,DISABLE}]
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 40a0ab597cbc4d09d17e5af410c7df7b1b915f2e
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Tue Oct 2 17:54:35 2012 +0200

    drm/i915: call drm_handle_vblank before finish_page_flip
    
    commit 74d44445afb9f50126eba052adeb89827cee88f3 upstream.
    
    ... since finish_page_flip needs the vblank timestamp generated
    in drm_handle_vblank. Somehow all the gmch platforms get it right,
    but all the pch platform irq handlers get is wrong. Hooray for copy&
    pasting!
    
    Currently this gets papered over by a gross hack in finish_page_flip.
    A second patch will remove that.
    
    Note that without this, the new timestamp sanity checks in flip_test
    occasionally get tripped up, hence the cc: stable tag.
    
    Reviewed-by: mario.kleiner@tuebingen.mpg.de
    Tested-by: Imre Deak <imre.deak@intel.com>
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    [bwh: Backported to 3.2: no loop over pipes in ivybridge_irq_handler(),
     so make a similar change to that in ironlake_irq_handler()]
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 9fa4daeca1536418310d338ffc0d0e0d88594157
Author: Rusty Russell <rusty@rustcorp.com.au>
Date:   Thu Oct 4 12:03:25 2012 +0930

    lguest: fix occasional crash in example launcher.
    
    commit ca16f580a5db7e60bfafe59a50bb133bd3347491 upstream.
    
    We usually got away with ->next on the final entry being NULL, but it
    finally bit me.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    [bwh: Backported to 3.2: adjust filename]
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 601e4d671ac72bbb37b6d3c5981bd3792ffd07bb
Author: Nicholas Bellinger <nab@linux-iscsi.org>
Date:   Wed Oct 3 15:42:48 2012 -0700

    iscsi-target: Bump defaults for nopin_timeout + nopin_response_timeout values
    
    commit cf0eb28d3ba60098865bf7dbcbfdd6b1cc483e3b upstream.
    
    This patch increases the default for nopin_timeout to 15 seconds (wait
    between sending a new NopIN ping) and nopin_response_timeout to 30 seconds
    (wait for NopOUT response before failing the connection) in order to avoid
    false positives by iSCSI Initiators who are not always able (under load) to
    respond to NopIN echo PING requests within the current 5 second window.
    
    False positives have been observed recently using Open-iSCSI code on v3.3.x
    with heavy large-block READ workloads over small MTU 1 Gb/sec ports, and
    increasing these values to more reasonable defaults significantly reduces
    the possibility of false positive NopIN response timeout events under
    this specific workload.
    
    Historically these have been set low to initiate connection recovery as
    soon as possible if we don't hear a ping back, but for modern v3.x code
    on 1 -> 10 Gb/sec ports these new defaults make alot more sense.
    
    Cc: Christoph Hellwig <hch@lst.de>
    Cc: Andy Grover <agrover@redhat.com>
    Cc: Mike Christie <michaelc@cs.wisc.edu>
    Cc: Hannes Reinecke <hare@suse.de>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit cf06b5a1c78a13ff25d8b2d367770b2936316006
Author: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Date:   Tue Sep 18 06:42:42 2012 +0000

    mmc: sh-mmcif: avoid oops on spurious interrupts
    
    commit 8464dd52d3198dd05cafb005371d76e5339eb842 upstream.
    
    On some systems, e.g., kzm9g, MMCIF interfaces can produce spurious
    interrupts without any active request. To prevent the Oops, that results
    in such cases, don't dereference the mmc request pointer until we make
    sure, that we are indeed processing such a request.
    
    Reported-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
    Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
    Signed-off-by: Chris Ball <cjb@laptop.org>
    [bwh: Backported to 3.2: adjust context]
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit b1f9cafbf2313768160d3d2587deba1f099fc5f5
Author: Vaibhav Bedia <vaibhav.bedia@ti.com>
Date:   Thu Sep 13 06:31:03 2012 +0000

    mmc: omap_hsmmc: Pass on the suspend failure to the PM core
    
    commit c4c8eeb4df00aabb641553d6fbcd46f458e56cd9 upstream.
    
    In some cases mmc_suspend_host() is not able to claim the
    host and proceed with the suspend process. The core returns
    -EBUSY to the host controller driver. Unfortunately, the
    host controller driver does not pass on this information
    to the PM core and hence the system suspend process continues.
    
    	ret = mmc_suspend_host(host->mmc);
    	if (ret) {
    		host->suspended = 0;
    		if (host->pdata->resume) {
    			ret = host->pdata->resume(dev, host->slot_id);
    
    The return status from mmc_suspend_host() is overwritten by return
    status from host->pdata->resume. So the original return status is lost.
    
    In these cases the MMC core gets to an unexpected state
    during resume and multiple issues related to MMC crop up.
    1. Host controller driver starts accessing the device registers
    before the clocks are enabled which leads to a prefetch abort.
    2. A file copy thread which was launched before suspend gets
    stuck due to the host not being reclaimed during resume.
    
    To avoid such problems pass on the -EBUSY status to the PM core
    from the host controller driver. With this change, MMC core
    suspend might still fail but it does not end up making the
    system unusable. Suspend gets aborted and the user can try
    suspending the system again.
    
    Signed-off-by: Vaibhav Bedia <vaibhav.bedia@ti.com>
    Signed-off-by: Hebbar, Gururaja <gururaja.hebbar@ti.com>
    Acked-by: Venkatraman S <svenkatr@ti.com>
    Signed-off-by: Chris Ball <cjb@laptop.org>
    [bwh: Backported to 3.2:
     - Adjust context, indentation
     - s/dev/\&pdev->dev/]
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 6454738d4395c8a79843f5c2e3eeb687f9b7e7a9
Author: Jean Delvare <jdelvare@suse.de>
Date:   Tue Oct 2 16:42:36 2012 +0200

    kbuild: Fix gcc -x syntax
    
    commit b1e0d8b70fa31821ebca3965f2ef8619d7c5e316 upstream.
    
    The correct syntax for gcc -x is "gcc -x assembler", not
    "gcc -xassembler". Even though the latter happens to work, the former
    is what is documented in the manual page and thus what gcc wrappers
    such as icecream do expect.
    
    This isn't a cosmetic change. The missing space prevents icecream from
    recognizing compilation tasks it can't handle, leading to silent kernel
    miscompilations.
    
    Besides me, credits go to Michael Matz and Dirk Mueller for
    investigating the miscompilation issue and tracking it down to this
    incorrect -x parameter syntax.
    
    Signed-off-by: Jean Delvare <jdelvare@suse.de>
    Acked-by: Ingo Molnar <mingo@kernel.org>
    Cc: Bernhard Walle <bernhard@bwalle.de>
    Cc: Michal Marek <mmarek@suse.cz>
    Cc: Ralf Baechle <ralf@linux-mips.org>
    Signed-off-by: Michal Marek <mmarek@suse.cz>
    [bwh: Backported to 3.2: drop unneeded change to arch/x86/Makefile]
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit d3ccc5b382bf183ad55096743e4fa42d432b9885
Author: Bernhard Walle <bernhard@bwalle.de>
Date:   Sun Feb 26 18:35:18 2012 +0100

    scripts/Kbuild.include: Fix portability problem of "echo -e"
    
    commit 875de98623fa2b29f0cb19915fe3292ab6daa1cb upstream.
    
    "echo -e" is a GNU extension. When cross-compiling the kernel on a
    BSD-like operating system (Mac OS X in my case), this doesn't work.
    
    One could install a GNU version of echo, put that in the $PATH before
    the system echo and use "/usr/bin/env echo", but the solution with
    printf is simpler.
    
    Since it is no disadvantage on Linux, I hope that gets accepted even if
    cross-compiling the Linux kernel on another Unix operating system is
    quite a rare use case.
    
    Signed-off-by: Bernhard Walle <bernhard@bwalle.de>
    Andreas Bießmann <andreas@biessmann.de>
    Signed-off-by: Michal Marek <mmarek@suse.cz>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 5b84d8279eb9fa68c1e8eb3e79cf1e42607dfd1e
Author: Christoph Hellwig <hch@infradead.org>
Date:   Wed Sep 26 08:00:37 2012 -0400

    iscsit: remove incorrect unlock in iscsit_build_sendtargets_resp
    
    commit 904753da183566c71211d23c169a80184648c121 upstream.
    
    Fix a potential multiple spin-unlock -> deadlock scenario during the
    overflow check within iscsit_build_sendtargets_resp() as found by
    sparse static checking.
    
    Signed-off-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 0450a208da987620b839d0eecd6dbf3bb50b38e8
Author: Nicholas Bellinger <nab@linux-iscsi.org>
Date:   Sun Sep 30 12:20:02 2012 -0700

    iscsi-target: Add explicit set of cache_dynamic_acls=1 for TPG demo-mode
    
    commit 38b11bae6ba02da352340aff12ee25755977b222 upstream.
    
    We've had reports in the past about this specific case, so it's time to
    go ahead and explicitly set cache_dynamic_acls=1 for generate_node_acls=1
    (TPG demo-mode) operation.
    
    During normal generate_node_acls=0 operation with explicit NodeACLs ->
    se_node_acl memory is persistent to the configfs group located at
    /sys/kernel/config/target/$TARGETNAME/$TPGT/acls/$INITIATORNAME, so in
    the generate_node_acls=1 case we want the reservation logic to reference
    existing per initiator IQN se_node_acl memory (not to generate a new
    se_node_acl), so go ahead and always set cache_dynamic_acls=1 when
    TPG demo-mode is enabled.
    
    Reported-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 14b557c19dbe677059243246522da15800ca94f0
Author: Nicholas Bellinger <nab@linux-iscsi.org>
Date:   Sat Sep 29 17:15:37 2012 -0700

    target/file: Re-enable optional fd_buffered_io=1 operation
    
    commit b32f4c7ed85c5cee2a21a55c9f59ebc9d57a2463 upstream.
    
    This patch re-adds the ability to optionally run in buffered FILEIO mode
    (eg: w/o O_DSYNC) for device backends in order to once again use the
    Linux buffered cache as a write-back storage mechanism.
    
    This logic was originally dropped with mainline v3.5-rc commit:
    
    commit a4dff3043c231d57f982af635c9d2192ee40e5ae
    Author: Nicholas Bellinger <nab@linux-iscsi.org>
    Date:   Wed May 30 16:25:41 2012 -0700
    
        target/file: Use O_DSYNC by default for FILEIO backends
    
    This difference with this patch is that fd_create_virtdevice() now
    forces the explicit setting of emulate_write_cache=1 when buffered FILEIO
    operation has been enabled.
    
    (v2: Switch to FDBD_HAS_BUFFERED_IO_WCE + add more detailed
         comment as requested by hch)
    
    Reported-by: Ferry <iscsitmp@bananateam.nl>
    Cc: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 642b21bcb45bda793a3ebeaa22b88a1a8b64c120
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Sep 27 21:25:58 2012 +0100

    drm/i915: Flush the pending flips on the CRTC before modification
    
    commit 5bb61643f6a70d48de9cfe91ad0fee0d618b6816 upstream.
    
    This was meant to be the purpose of the
    intel_crtc_wait_for_pending_flips() function which is called whilst
    preparing the CRTC for a modeset or before disabling. However, as Ville
    Syrjala pointed out, we set the pending flip notification on the old
    framebuffer that is no longer attached to the CRTC by the time we come
    to flush the pending operations. Instead, we can simply wait on the
    pending unpin work to be finished on this CRTC, knowning that the
    hardware has therefore finished modifying the registers, before proceeding
    with our direct access.
    
    Fixes i-g-t/flip_test on non-pch platforms. pch platforms simply
    schedule the flip immediately when the pipe is disabled, leading
    to other funny issues.
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
    [danvet: Added i-g-t note and cc: stable]
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 9392e7db7bc62b61ec72c8aa020f4d7e07118bff
Author: Peng Tao <bergwolf@gmail.com>
Date:   Fri Aug 24 00:27:51 2012 +0800

    pnfsblock: fix partial page buffer wirte
    
    commit fe6e1e8d9fad86873eb74a26e80a8f91f9e870b5 upstream.
    
    If applications use flock to protect its write range, generic NFS
    will not do read-modify-write cycle at page cache level. Therefore
    LD should know how to handle non-sector aligned writes. Otherwise
    there will be data corruption.
    
    Signed-off-by: Peng Tao <tao.peng@emc.com>
    Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
    [bwh: Backported to Linux 3.2:
     - Adjust context
     - s/wdata->pages\.npages/wdata->npages/
     - s/header->pnfs_error/wdata->pnfs_error/
     - Drop change in missing out_mds exit path]
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 5ff39e971c87ea9f4c4c7b253898abafa960e32b
Author: Stanislav Kinsbursky <skinsbursky@parallels.com>
Date:   Tue Sep 18 13:37:18 2012 +0400

    lockd: use rpc client's cl_nodename for id encoding
    
    commit 303a7ce92064c285a04c870f2dc0192fdb2968cb upstream.
    
    Taking hostname from uts namespace if not safe, because this cuold be
    performind during umount operation on child reaper death. And in this case
    current->nsproxy is NULL already.
    
    Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
    Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 5ed7d4de6853126fe9bb27d9cd443ee0a2d6e90a
Author: Yuta Ando <yuta.and@gmail.com>
Date:   Mon Oct 1 23:24:30 2012 +0900

    localmodconfig: Fix localyesconfig to set to 'y' not 'm'
    
    commit 4eae518d4b01b0cbf2f0d8edb5a6f3d6245ee8fb upstream.
    
    The kbuild target 'localyesconfig' has been same as 'localmodconfig'
    since the commit 50bce3e "kconfig/streamline_config.pl: merge
    local{mod,yes}config". The commit expects this script generates
    different configure depending on target, but it was not yet implemented.
    
    So I added code that sets to 'yes' when target is 'localyesconfig'.
    
    Link: http://lkml.kernel.org/r/1349101470-12243-1-git-send-email-yuta.and@gmail.com
    
    Cc: linux-kbuild@vger.kernel.org
    Signed-off-by: Yuta Ando <yuta.and@gmail.com>
    Signed-off-by: Steven Rostedt <rostedt@rostedt.homelinux.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 0575df129e2eb4a801beae0e6e041787480f42b9
Author: Bart Van Assche <bvanassche@acm.org>
Date:   Fri Aug 24 10:29:11 2012 +0000

    IB/srp: Avoid having aborted requests hang
    
    commit d8536670916a685df116b5c2cb256573fd25e4e3 upstream.
    
    We need to call scsi_done() for commands after we abort them.
    
    Signed-off-by: Bart Van Assche <bvanassche@acm.org>
    Acked-by: David Dillow <dillowda@ornl.gov>
    Signed-off-by: Roland Dreier <roland@purestorage.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 6bfc0805e76ff5a2fd0e2b2f1bee777c38b0da1c
Author: Bart Van Assche <bvanassche@acm.org>
Date:   Fri Aug 24 10:27:54 2012 +0000

    IB/srp: Fix use-after-free in srp_reset_req()
    
    commit 9b796d06d5d1b1e85ae2316a283ea11dd739ef96 upstream.
    
    srp_free_req() uses the scsi_cmnd structure contents to unmap
    buffers, so we must invoke srp_free_req() before we release
    ownership of that structure.
    
    Signed-off-by: Bart Van Assche <bvanassche@acm.org>
    Acked-by: David Dillow <dillowda@ornl.gov>
    Signed-off-by: Roland Dreier <roland@purestorage.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 1ba95552a4efd2f9e779cd840ffbd159bd0e9c7f
Author: Patrick McHardy <kaber@trash.net>
Date:   Thu Aug 30 07:01:30 2012 +0000

    IPoIB: Fix use-after-free of multicast object
    
    commit bea1e22df494a729978e7f2c54f7bda328f74bc3 upstream.
    
    Fix a crash in ipoib_mcast_join_task().  (with help from Or Gerlitz)
    
    Commit c8c2afe360b7 ("IPoIB: Use rtnl lock/unlock when changing device
    flags") added a call to rtnl_lock() in ipoib_mcast_join_task(), which
    is run from the ipoib_workqueue, and hence the workqueue can't be
    flushed from the context of ipoib_stop().
    
    In the current code, ipoib_stop() (which doesn't flush the workqueue)
    calls ipoib_mcast_dev_flush(), which goes and deletes all the
    multicast entries.  This takes place without any synchronization with
    a possible running instance of ipoib_mcast_join_task() for the same
    ipoib device, leading to a crash due to NULL pointer dereference.
    
    Fix this by making sure that the workqueue is flushed before
    ipoib_mcast_dev_flush() is called.  To make that possible, we move the
    RTNL-lock wrapped code to ipoib_mcast_join_finish().
    
    Signed-off-by: Patrick McHardy <kaber@trash.net>
    Signed-off-by: Roland Dreier <roland@purestorage.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 4a888aa97cc653cb4d82539caea9f149231aeaf0
Author: Richard Genoud <richard.genoud@gmail.com>
Date:   Wed Sep 12 14:26:26 2012 +0200

    mtd: nandsim: bugfix: fail if overridesize is too big
    
    commit bb0a13a13411c4ce24c48c8ff3cdf7b48d237240 upstream.
    
    If override size is too big, the module was actually loaded instead of
    failing, because retval was not set.
    
    This lead to memory corruption with the use of the freed structs nandsim
    and nand_chip.
    
    Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
    Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit f4c8c2f05a24536e4d883d6f3783c78aa6e773ff
Author: Brian Norris <computersforpeace@gmail.com>
Date:   Fri Aug 31 15:01:19 2012 -0700

    JFFS2: don't fail on bitflips in OOB
    
    commit 74d83beaa229aac7d126ac1ed9414658ff1a89d2 upstream.
    
    JFFS2 was designed without thought for OOB bitflips, it seems, but they
    can occur and will be reported to JFFS2 via mtd_read_oob()[1]. We don't
    want to fail on these transactions, since the data was corrected.
    
    [1] Few drivers report bitflips for OOB-only transactions. With such
        drivers, this patch should have no effect.
    
    Signed-off-by: Brian Norris <computersforpeace@gmail.com>
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
    Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
    [bwh: Backported to 3.2: adjust context]
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 8f864fc457e834f71de5b5b44401174170064593
Author: Andreas Bießmann <andreas@biessmann.de>
Date:   Fri Aug 31 13:35:42 2012 +0200

    mtd: omap2: fix module loading
    
    commit 4d3d688da8e7016f15483e9319b41311e1db9515 upstream.
    
    Unloading the omap2 nand driver missed to release the memory region which will
    result in not being able to request it again if one want to load the driver
    later on.
    
    This patch fixes following error when loading omap2 module after unloading:
    ---8<---
    ~ $ rmmod omap2
    ~ $ modprobe omap2
    [   37.420928] omap2-nand: probe of omap2-nand.0 failed with error -16
    ~ $
    --->8---
    
    This error was introduced in 67ce04bf2746f8a1f8c2a104b313d20c63f68378 which
    was the first commit of this driver.
    
    Signed-off-by: Andreas Bießmann <andreas@biessmann.de>
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
    Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit c7cbfe66d8e173bd562e56776dfc96f45c089188
Author: Andreas Bießmann <andreas@biessmann.de>
Date:   Fri Aug 31 13:35:41 2012 +0200

    mtd: omap2: fix omap_nand_remove segfault
    
    commit 7d9b110269253b1d5858cfa57d68dfc7bf50dd77 upstream.
    
    Do not kfree() the mtd_info; it is handled in the mtd subsystem and
    already freed by nand_release(). Instead kfree() the struct
    omap_nand_info allocated in omap_nand_probe which was not freed before.
    
    This patch fixes following error when unloading the omap2 module:
    
    ---8<---
    ~ $ rmmod omap2
    ------------[ cut here ]------------
    kernel BUG at mm/slab.c:3126!
    Internal error: Oops - BUG: 0 [#1] PREEMPT ARM
    Modules linked in: omap2(-)
    CPU: 0    Not tainted  (3.6.0-rc3-00230-g155e36d-dirty #3)
    PC is at cache_free_debugcheck+0x2d4/0x36c
    LR is at kfree+0xc8/0x2ac
    pc : [<c01125a0>]    lr : [<c0112efc>]    psr: 200d0193
    sp : c521fe08  ip : c0e8ef90  fp : c521fe5c
    r10: bf0001fc  r9 : c521e000  r8 : c0d99c8c
    r7 : c661ebc0  r6 : c065d5a4  r5 : c65c4060  r4 : c78005c0
    r3 : 00000000  r2 : 00001000  r1 : c65c4000  r0 : 00000001
    Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment user
    Control: 10c5387d  Table: 86694019  DAC: 00000015
    Process rmmod (pid: 549, stack limit = 0xc521e2f0)
    Stack: (0xc521fe08 to 0xc5220000)
    fe00:                   c008a874 c00bf44c c515c6d0 200d0193 c65c4860 c515c240
    fe20: c521fe3c c521fe30 c008a9c0 c008a854 c521fe5c c65c4860 c78005c0 bf0001fc
    fe40: c780ff40 a00d0113 c521e000 00000000 c521fe84 c521fe60 c0112efc c01122d8
    fe60: c65c4860 c0673778 c06737ac 00000000 00070013 00000000 c521fe9c c521fe88
    fe80: bf0001fc c0112e40 c0673778 bf001ca8 c521feac c521fea0 c02ca11c bf0001ac
    fea0: c521fec4 c521feb0 c02c82c4 c02ca100 c0673778 bf001ca8 c521fee4 c521fec8
    fec0: c02c8dd8 c02c8250 00000000 bf001ca8 bf001ca8 c0804ee0 c521ff04 c521fee8
    fee0: c02c804c c02c8d20 bf001924 00000000 bf001ca8 c521e000 c521ff1c c521ff08
    ff00: c02c950c c02c7fbc bf001d48 00000000 c521ff2c c521ff20 c02ca3a4 c02c94b8
    ff20: c521ff3c c521ff30 bf001938 c02ca394 c521ffa4 c521ff40 c009beb4 bf001930
    ff40: c521ff6c 70616d6f b6fe0032 c0014f84 70616d6f b6fe0032 00000081 60070010
    ff60: c521ff84 c521ff70 c008e1f4 c00bf328 0001a004 70616d6f c521ff94 0021ff88
    ff80: c008e368 0001a004 70616d6f b6fe0032 00000081 c0015028 00000000 c521ffa8
    ffa0: c0014dc0 c009bcd0 0001a004 70616d6f bec2ab38 00000880 bec2ab38 00000880
    ffc0: 0001a004 70616d6f b6fe0032 00000081 00000319 00000000 b6fe1000 00000000
    ffe0: bec2ab30 bec2ab20 00019f00 b6f539c0 60070010 bec2ab38 aaaaaaaa aaaaaaaa
    Backtrace:
    [<c01122cc>] (cache_free_debugcheck+0x0/0x36c) from [<c0112efc>] (kfree+0xc8/0x2ac)
    [<c0112e34>] (kfree+0x0/0x2ac) from [<bf0001fc>] (omap_nand_remove+0x5c/0x64 [omap2])
    [<bf0001a0>] (omap_nand_remove+0x0/0x64 [omap2]) from [<c02ca11c>] (platform_drv_remove+0x28/0x2c)
     r5:bf001ca8 r4:c0673778
    [<c02ca0f4>] (platform_drv_remove+0x0/0x2c) from [<c02c82c4>] (__device_release_driver+0x80/0xdc)
    [<c02c8244>] (__device_release_driver+0x0/0xdc) from [<c02c8dd8>] (driver_detach+0xc4/0xc8)
     r5:bf001ca8 r4:c0673778
    [<c02c8d14>] (driver_detach+0x0/0xc8) from [<c02c804c>] (bus_remove_driver+0x9c/0x104)
     r6:c0804ee0 r5:bf001ca8 r4:bf001ca8 r3:00000000
    [<c02c7fb0>] (bus_remove_driver+0x0/0x104) from [<c02c950c>] (driver_unregister+0x60/0x80)
     r6:c521e000 r5:bf001ca8 r4:00000000 r3:bf001924
    [<c02c94ac>] (driver_unregister+0x0/0x80) from [<c02ca3a4>] (platform_driver_unregister+0x1c/0x20)
     r5:00000000 r4:bf001d48
    [<c02ca388>] (platform_driver_unregister+0x0/0x20) from [<bf001938>] (omap_nand_driver_exit+0x14/0x1c [omap2])
    [<bf001924>] (omap_nand_driver_exit+0x0/0x1c [omap2]) from [<c009beb4>] (sys_delete_module+0x1f0/0x2ec)
    [<c009bcc4>] (sys_delete_module+0x0/0x2ec) from [<c0014dc0>] (ret_fast_syscall+0x0/0x48)
     r8:c0015028 r7:00000081 r6:b6fe0032 r5:70616d6f r4:0001a004
    Code: e1a00005 eb0d9172 e7f001f2 e7f001f2 (e7f001f2)
    ---[ end trace 6a30b24d8c0cc2ee ]---
    Segmentation fault
    --->8---
    
    This error was introduced in 67ce04bf2746f8a1f8c2a104b313d20c63f68378 which
    was the first commit of this driver.
    
    Signed-off-by: Andreas Bießmann <andreas@biessmann.de>
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
    Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit c6d6eb108e31288a1a1abfef69353783dd2be611
Author: Huang Shijie <shijie8@gmail.com>
Date:   Sat Aug 18 13:07:41 2012 -0400

    mtd: mtdpart: break it as soon as we parse out the partitions
    
    commit c51803ddba10d80d9f246066802c6e359cf1d44c upstream.
    
    We may cause a memory leak when the @types has more then one parser.
    
    Take the `default_mtd_part_types` for example. The default_mtd_part_types has
    two parsers now: `cmdlinepart` and `ofpart`.
    
    Assume the following case:
    The kernel command line sets the partitions like:
    	#gpmi-nand:20m(boot),20m(kernel),1g(rootfs),-(user)
    But the devicetree file(such as arch/arm/boot/dts/imx28-evk.dts) also sets
    the same partitions as the kernel command line does.
    
    In the current code, the partitions parsed out by the `ofpart` will
    overwrite the @pparts which has already set by the `cmdlinepart` parser,
    and the the partitions parsed out by the `cmdlinepart` is missed.
    A memory leak occurs.
    
    So we should break the code as soon as we parse out the partitions,
    In actually, this patch makes a priority order between the parsers.
    If one parser has already parsed out the partitions successfully,
    it's no need to use another parser anymore.
    
    Signed-off-by: Huang Shijie <shijie8@gmail.com>
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
    Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 3d6f072401a231375a960010c87945a1e70f0042
Author: Alexander Shiyan <shc_work@mail.ru>
Date:   Wed Aug 15 20:28:05 2012 +0400

    mtd: autcpu12-nvram: Fix compile breakage
    
    commit d1f55c680e5d021e7066f4461dd678d42af18898 upstream.
    
    Update driver autcpu12-nvram.c so it compiles; map_read32/map_write32
    no longer exist in the kernel so the driver is totally broken.
    Additionally, map_info name passed to simple_map_init is incorrect.
    
    Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
    Acked-by: Arnd Bergmann <arnd@arndb.de>
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
    Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 0c53cadfdcd93f76f37fd1ad45e3fa8dacc73bad
Author: Seth Forshee <seth.forshee@canonical.com>
Date:   Fri Sep 28 10:29:21 2012 -0700

    Input: synaptics - adjust threshold for treating position values as negative
    
    commit 824efd37415961d38821ecbd9694e213fb2e8b32 upstream.
    
    Commit c039450 (Input: synaptics - handle out of bounds values from the
    hardware) caused any hardware reported values over 7167 to be treated as
    a wrapped-around negative value. It turns out that some firmware uses
    the value 8176 to indicate a finger near the edge of the touchpad whose
    actual position cannot be determined. This value now gets treated as
    negative, which can cause pointer jumps and broken edge scrolling on
    these machines.
    
    I only know of one touchpad which reports negative values, and this
    hardware never reports any value lower than -8 (i.e. 8184). Moving the
    threshold for treating a value as negative up to 8176 should work fine
    then for any hardware we currently know about, and since we're dealing
    with unspecified behavior it's probably the best we can do. The special
    8176 value is also likely to result in sudden jumps in position, so
    let's also clamp this to the maximum specified value for the axis.
    
    BugLink: http://bugs.launchpad.net/bugs/1046512
    https://bugzilla.kernel.org/show_bug.cgi?id=46371
    
    Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
    Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
    Tested-by: Alan Swanson <swanson@ukfsn.org>
    Tested-by: Arteom <arutemus@gmail.com>
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit aeb048baa36390d8550282a305aabc057a5718cc
Author: Ian Abbott <abbotti@mev.co.uk>
Date:   Thu Sep 27 17:45:27 2012 +0100

    staging: comedi: jr3_pci: fix iomem dereference
    
    commit e1878957b4676a17cf398f7f5723b365e9a2ca48 upstream.
    
    Correct a direct dereference of I/O memory to use an appropriate I/O
    memory access function.  Note that the pointer being dereferenced is not
    currently tagged with `__iomem` but I plan to correct that for 3.7.
    
    Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 0767530346a06285e2c34b239976dae1d0d3d621
Author: Michal Marek <mmarek@suse.cz>
Date:   Tue Sep 25 16:03:03 2012 +0200

    kbuild: Do not package /boot and /lib in make tar-pkg
    
    commit fe04ddf7c2910362f3817c8156e41cbd6c0ee35d upstream.
    
    There were reports of users destroying their Fedora installs by a kernel
    tarball that replaces the /lib -> /usr/lib symlink. Let's remove the
    toplevel directories from the tarball to prevent this from happening.
    
    Reported-by: Andi Kleen <andi@firstfloor.org>
    Suggested-by: Ben Hutchings <ben@decadent.org.uk>
    Signed-off-by: Michal Marek <mmarek@suse.cz>
    [bwh: Fold in commit 3ce9e53e788881da0d5f3912f80e0dd6b501f304 to avoid
     conflicts]
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 9362a27c302da420ff745a51387b2fea9ed2efeb
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Wed Sep 26 12:40:45 2012 -0400

    drm/radeon: force MSIs on RS690 asics
    
    commit fb6ca6d154cdcd53e7f27f8dbba513830372699b upstream.
    
    There are so many quirks, lets just try and force
    this for all RS690s.  See:
    https://bugs.freedesktop.org/show_bug.cgi?id=37679
    
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit dc7faa2792d7377a730249c2decf84c1ec9bbf33
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Wed Sep 26 12:31:45 2012 -0400

    drm/radeon: Add MSI quirk for gateway RS690
    
    commit 3a6d59df80897cc87812b6826d70085905bed013 upstream.
    
    Fixes another system on:
    https://bugs.freedesktop.org/show_bug.cgi?id=37679
    
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit f7d8e23b1b73baeb31b212666b6649e671b89774
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Fri Sep 14 10:59:26 2012 -0400

    drm/radeon: only adjust default clocks on NI GPUs
    
    commit 2e3b3b105ab3bb5b6a37198da4f193cd13781d13 upstream.
    
    SI asics store voltage information differently so we
    don't have a way to deal with it properly yet.
    
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 49e58269dae5c9ed45381ecb40f259c06d2c09be
Author: Jani Nikula <jani.nikula@intel.com>
Date:   Wed Sep 26 18:43:10 2012 +0300

    drm/i915: use adjusted_mode instead of mode for checking the 6bpc force flag
    
    commit 0c96c65b48fba3ffe9822a554cbc0cd610765cd5 upstream.
    
    The dithering introduced in
    
    commit 3b5c78a35cf7511c15e09a9b0ffab290a42d9bcf
    Author: Adam Jackson <ajax@redhat.com>
    Date:   Tue Dec 13 15:41:00 2011 -0800
    
        drm/i915/dp: Dither down to 6bpc if it makes the mode fit
    
    stores the INTEL_MODE_DP_FORCE_6BPC flag in the private_flags of the
    adjusted mode, while i9xx_crtc_mode_set() and ironlake_crtc_mode_set() use
    the original mode, without the flag, so it would never have any
    effect. However, the BPC was clamped by VBT settings, making things work by
    coincidence, until that part was removed in
    
    commit 4344b813f105a19f793f1fd93ad775b784648b95
    Author: Daniel Vetter <daniel.vetter@ffwll.ch>
    Date:   Fri Aug 10 11:10:20 2012 +0200
    
    Use adjusted_mode instead of mode when checking for
    INTEL_MODE_DP_FORCE_6BPC to make the flag have effect.
    
    v2: Don't forget to fix this in i9xx_crtc_mode_set() also, pointed out by
    Daniel both before and after sending the first patch.
    
    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=47621
    CC: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Jani Nikula <jani.nikula@intel.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    [bwh: Backported to 3.2:
     - Adjust context
     - intel_choose_pipe_bpp_dither() doesn't take a drm_framebuffer argument]
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 02eb1e54072c0fedb20fc9458e2bbe8c4e820384
Author: Denys Vlasenko <vda.linux@googlemail.com>
Date:   Wed Sep 26 11:34:50 2012 +1000

    coredump: prevent double-free on an error path in core dumper
    
    commit f34f9d186df35e5c39163444c43b4fc6255e39c5 upstream.
    
    In !CORE_DUMP_USE_REGSET case, if elf_note_info_init fails to allocate
    memory for info->fields, it frees already allocated stuff and returns
    error to its caller, fill_note_info.  Which in turn returns error to its
    caller, elf_core_dump.  Which jumps to cleanup label and calls
    free_note_info, which will happily try to free all info->fields again.
    BOOM.
    
    This is the fix.
    
    Signed-off-by: Oleg Nesterov <oleg@redhat.com>
    Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
    Cc: Venu Byravarasu <vbyravarasu@nvidia.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit d7644110a92a74c71dfa65834eb9484a5ff7bf1f
Author: Jan Kara <jack@suse.cz>
Date:   Wed Sep 26 21:52:20 2012 -0400

    ext4: fix fdatasync() for files with only i_size changes
    
    commit b71fc079b5d8f42b2a52743c8d2f1d35d655b1c5 upstream.
    
    Code tracking when transaction needs to be committed on fdatasync(2) forgets
    to handle a situation when only inode's i_size is changed. Thus in such
    situations fdatasync(2) doesn't force transaction with new i_size to disk
    and that can result in wrong i_size after a crash.
    
    Fix the issue by updating inode's i_datasync_tid whenever its size is
    updated.
    
    Reported-by: Kristian Nielsen <knielsen@knielsen-hq.org>
    Signed-off-by: Jan Kara <jack@suse.cz>
    [bwh: Backported to 3.2: adjust context]
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 9881fcc8b68753201ab8f84041ec70beac6df2f6
Author: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
Date:   Wed Sep 26 21:24:57 2012 -0400

    ext4: always set i_op in ext4_mknod()
    
    commit 6a08f447facb4f9e29fcc30fb68060bb5a0d21c2 upstream.
    
    ext4_special_inode_operations have their own ifdef CONFIG_EXT4_FS_XATTR
    to mask those methods. And ext4_iget also always sets it, so there is
    an inconsistency.
    
    Signed-off-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
    Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 4ac206a50c319f692aab900408f949b04f8deab7
Author: Linus Walleij <linus.walleij@linaro.org>
Date:   Wed Sep 26 17:21:36 2012 +0200

    serial: pl011: handle corruption at high clock speeds
    
    commit c5dd553b9fd069892c9e2de734f4f604e280fa7a upstream.
    
    This works around a few glitches in the ST version of the PL011
    serial driver when using very high baud rates, as we do in the
    Ux500: 3, 3.25, 4 and 4.05 Mbps.
    
    Problem Observed/rootcause:
    
    When using high baud-rates, and the baudrate*8 is getting close to
    the provided clock frequency (so a division factor close to 1), when
    using bursts of characters (so they are abutted), then it seems as if
    there is not enough time to detect the beginning of the start-bit which
    is a timing reference for the entire character, and thus the sampling
    moment of character bits is moving towards the end of each bit, instead
    of the middle.
    
    Fix:
    Increase slightly the RX baud rate of the UART above the theoretical
    baudrate by 5%. This will definitely give more margin time to the
    UART_RX to correctly sample the data at the middle of the bit period.
    
    Also fix the ages old copy-paste error in the very stressed comment,
    it's referencing the registers used in the PL010 driver rather than
    the PL011 ones.
    
    Signed-off-by: Guillaume Jaunet <guillaume.jaunet@stericsson.com>
    Signed-off-by: Christophe Arnal <christophe.arnal@stericsson.com>
    Signed-off-by: Matthias Locher <matthias.locher@stericsson.com>
    Signed-off-by: Rajanikanth HV <rajanikanth.hv@stericsson.com>
    Cc: Bibek Basu <bibek.basu@stericsson.com>
    Cc: Par-Gunnar Hjalmdahl <par-gunnar.hjalmdahl@stericsson.com>
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 96311cce7d8e427aad023c8eea6ba3a08b70e754
Author: Flavio Leitner <fbl@redhat.com>
Date:   Fri Sep 21 21:04:34 2012 -0300

    serial: set correct baud_base for EXSYS EX-41092 Dual 16950
    
    commit 26e8220adb0aec43b7acafa0f1431760eee28522 upstream.
    
    Apparently the same card model has two IDs, so this patch
    complements the commit 39aced68d664291db3324d0fcf0985ab5626aac2
    adding the missing one.
    
    Signed-off-by: Flavio Leitner <fbl@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    [bwh: Backported to 3.2: adjust filename]
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 5a31f0678b0f3d8e826685567d246711f185cb14
Author: Ian Abbott <abbotti@mev.co.uk>
Date:   Mon Sep 24 17:20:52 2012 +0100

    staging: comedi: s626: don't dereference insn->data
    
    commit b655c2c4782ed3e2e71d2608154e295a3e860311 upstream.
    
    `s626_enc_insn_config()` is incorrectly dereferencing `insn->data` which
    is a pointer to user memory.  It should be dereferencing the separate
    `data` parameter that points to a copy of the data in kernel memory.
    
    Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
    Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 6760fa5f3358b9eb6bef4d02144d5d169414cecd
Author: Dmitry Monakhov <dmonakhov@openvz.org>
Date:   Wed Sep 26 12:32:54 2012 -0400

    ext4: online defrag is not supported for journaled files
    
    commit f066055a3449f0e5b0ae4f3ceab4445bead47638 upstream.
    
    Proper block swap for inodes with full journaling enabled is
    truly non obvious task. In order to be on a safe side let's
    explicitly disable it for now.
    
    Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
    Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 90c145ba1ba1648f558f5fec975d2cd927d654d9
Author: Dmitry Monakhov <dmonakhov@openvz.org>
Date:   Wed Sep 26 12:32:19 2012 -0400

    ext4: move_extent code cleanup
    
    commit 03bd8b9b896c8e940f282f540e6b4de90d666b7c upstream.
    
    - Remove usless checks, because it is too late to check that inode != NULL
      at the moment it was referenced several times.
    - Double lock routines looks very ugly and locking ordering relays on
      order of i_ino, but other kernel code rely on order of pointers.
      Let's make them simple and clean.
    - check that inodes belongs to the same SB as soon as possible.
    
    Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
    Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit c948a535b39a2793b574e9594b020139344c7f45
Author: Paulo Zanoni <paulo.r.zanoni@intel.com>
Date:   Tue Sep 25 13:23:34 2012 -0300

    drm/i915: make sure we write all the DIP data bytes
    
    commit adf00b26d18e1b3570451296e03bcb20e4798cdd upstream.
    
    ... even if the actual infoframe is smaller than the maximum possible
    size.
    
    If we don't write all the 32 DIP data bytes the InfoFrame ECC may not
    be correctly calculated in some cases (e.g., when changing the port),
    and this will lead to black screens on HDMI monitors. The ECC value is
    generated by the hardware.
    
    I don't see how this should break anything since we're writing 0 and
    that should be the correct value, so this patch should be safe.
    
    Notice that on IVB and older we actually have 64 bytes available for
    VIDEO_DIP_DATA, but only bytes 0-31 actually store infoframe data: the
    others are either read-only ECC values or marked as "reserved". On HSW
    we only have 32 bytes, and the ECC value is stored on its own separate
    read-only register. See BSpec.
    
    This patch fixes bug #46761, which is marked as a regression
    introduced by commit 4e89ee174bb2da341bf90a84321c7008a3c9210d:
        drm/i915: set the DIP port on ibx_write_infoframe
    
    Before commit 4e89 we were just failing to send AVI infoframes when we
    needed to change the port, which can lead to black screens in some
    cases. After commit 4e89 we started sending infoframes, but with a
    possibly wrong ECC value. After this patch I hope we start sending
    correct infoframes.
    
    Version 2:
      - Improve commit message
      - Try to make the code more clear
    
    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=46761
    Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
    Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    [bwh: Backported to 3.2: only two write_infoframe functions to be modified]
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 2887c281de791c4d81622298997126a0c49a772c
Author: Paulo Zanoni <paulo.r.zanoni@intel.com>
Date:   Mon May 28 16:43:00 2012 -0300

    drm/i915: add some barriers when changing DIPs
    
    commit 9d9740f099f2eaf309c4c9cbc0d732507140db28 upstream.
    
    On IVB and older, we basically have two registers: the control and the
    data register. We write a few consecutitve times to the control
    register, and we need these writes to arrive exactly in the specified
    order.
    
    Also, when we're changing the data register, we need to guarantee that
    anything written to the control register already arrived (since
    changing the control register can change where the data register
    points to). Also, we need to make sure all the writes to the data
    register happen exactly in the specified order, and we also *can't*
    read the data register during this process, since reading and/or
    writing it will change the place it points to.
    
    So invoke the "better safe than sorry" rule and just be careful and
    put barriers everywhere :)
    
    On HSW we still have a control register that we write many times, but
    we have many data registers.
    
    Demanded-by: Chris Wilson <chris@chris-wilson.co.uk>
    Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    [bwh: Backported to 3.2:
     - There are only two write_infoframe functions to be modified
     - The other VIDEO_DIP_CTL writes are in entirely different functions]
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 7cd9c440b3060540775f75afc8cea2e81474f4a6
Author: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Date:   Wed Sep 19 16:27:26 2012 -0700

    xhci: Intel Panther Point BEI quirk.
    
    commit 80fab3b244a22e0ca539d2439bdda50e81e5666f upstream.
    
    When a device with an isochronous endpoint is behind a hub plugged into
    the Intel Panther Point xHCI host controller, and the driver submits
    multiple frames per URB, the xHCI driver will set the Block Event
    Interrupt (BEI) flag on all but the last TD for the URB.  This causes
    the host controller to place an event on the event ring, but not send an
    interrupt.  When the last TD for the URB completes, BEI is cleared, and
    we get an interrupt for the whole URB.
    
    However, under a Panther Point xHCI host controller, if the parent hub
    is unplugged when one or more events from transfers with BEI set are on
    the event ring, a port status change event is placed on the event ring,
    but no interrupt is generated.  This means URBs stop completing, and the
    USB device disconnect is not noticed.  Something like a USB headset will
    cause mplayer to hang when the device is disconnected.
    
    If another transfer is sent (such as running `sudo lsusb -v`), the next
    transfer event seems to "unstick" the event ring, the xHCI driver gets
    an interrupt, and the disconnect is reported to the USB core.
    
    The fix is not to use the BEI flag under the Panther Point xHCI host.
    This will impact power consumption and system responsiveness, because
    the xHCI driver will receive an interrupt for every frame in all
    isochronous URBs instead of once per URB.
    
    Intel chipset developers confirm that this bug will be hit if the BEI
    flag is used on any endpoint, not just ones that are behind a hub.
    
    This patch should be backported to kernels as old as 3.0, that contain
    the commit 69e848c2090aebba5698a1620604c7dccb448684 "Intel xhci: Support
    EHCI/xHCI port switching."
    
    Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 03b6b180216ccfa64746329e9ce71e8fc9df828b
Author: Sujith Manoharan <c_manoha@qualcomm.com>
Date:   Sat Sep 22 00:14:28 2012 +0530

    ath9k: Disable ASPM only for AR9285
    
    commit 046b6802c8d3c8a57448485513bf7291633e0fa3 upstream.
    
    Currently, ASPM is disabled for all WLAN+BT combo chipsets
    when BTCOEX is enabled. This is incorrect since the workaround
    is required only for WB195, which is a AR9285+AR3011 combo
    solution. Fix this by checking for the HW version when enabling
    the workaround.
    
    Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
    Tested-by: Paul Stewart <pstew@chromium.org>
    Signed-off-by: John W. Linville <linville@tuxdriver.com>
    [bwh: Backported to 3.2: ath9k_hw_get_btcoex_scheme() function is missing]
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit e7d2d9799d2c4e6db4b63f84d363e033024dcc93
Author: Lin Ming <ming.m.lin@intel.com>
Date:   Mon Jul 16 16:30:21 2012 +0800

    ACPI: run _OSC after ACPI_FULL_INITIALIZATION
    
    commit fc54ab72959edbf229b65ac74b2f122d799ca002 upstream.
    
    The _OSC method may exist in module level code,
    so it must be called after ACPI_FULL_INITIALIZATION
    
    On some new platforms with Zero-Power-Optical-Disk-Drive (ZPODD)
    support, this fix is necessary to save power.
    
    Signed-off-by: Lin Ming <ming.m.lin@intel.com>
    Tested-by: Aaron Lu <aaron.lu@intel.com>
    Signed-off-by: Len Brown <len.brown@intel.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 78b9c6cd299fec4645f7f4c712708a749ec6ee67
Author: Antonio Ospite <ospite@studenti.unina.it>
Date:   Sun Sep 23 09:57:25 2012 +0200

    USB: ftdi_sio: add TIAO USB Multi-Protocol Adapter (TUMPA) support
    
    commit 54575b05af36959dfb6a49a3e9ca0c2b456b7126 upstream.
    
    TIAO/DIYGADGET USB Multi-Protocol Adapter (TUMPA) is an FTDI FT2232H
    based device which provides an easily accessible JTAG, SPI, I2C, serial
    breakout.
    
    http://www.diygadget.com/tiao-usb-multi-protocol-adapter-jtag-spi-i2c-serial.html
    http://www.tiaowiki.com/w/TIAO_USB_Multi_Protocol_Adapter_User%27s_Manual
    
    FTDI FT2232H provides two serial channels (A and B), but on the TUMPA
    channel A is dedicated to JTAG/SPI while channel B can be used for
    UART/RS-232: use the ftdi_jtag_quirk to expose only channel B as
    a usb-serial interface to userspace.
    
    Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 47fe88540de43b9ee65f1c1e52483ce2f0e77968
Author: Vivek Gautam <gautam.vivek@samsung.com>
Date:   Sat Sep 22 18:11:19 2012 +0530

    usb: host: xhci: Fix Null pointer dereferencing with 71c731a for non-x86 systems
    
    commit 457a73d346187c2cc5d599072f38676f18f130e0 upstream.
    
    In 71c731a: usb: host: xhci: Fix Compliance Mode on SN65LVPE502CP Hardware
    when extracting DMI strings (vendor or product_name) to mark them as quirk
    we may get NULL pointer in case of non-x86 systems which won't define
    CONFIG_DMI. Hence susbsequent strstr() calls crash while driver probing.
    
    So, returning 'false' here in case we get a NULL vendor or product_name.
    
    This is tested with ARM (exynos) system.
    
    This patch should be backported to stable kernels as old as 3.6, that
    contain the commit 71c731a296f1b08a3724bd1b514b64f1bda87a23 "usb: host:
    xhci: Fix Compliance Mode on SN65LVPE502CP Hardware"
    
    Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
    Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
    Reported-by: Sebastian Gottschall (DD-WRT) <s.gottschall@dd-wrt.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 2d74f106e8696f8c629324f7630be5fa0fc15bbc
Author: Michael Spang <spang@chromium.org>
Date:   Fri Sep 14 13:05:49 2012 -0400

    Increase XHCI suspend timeout to 16ms
    
    commit a6e097dfdfd189b6929af6efa1d289af61858386 upstream.
    
    The Intel XHCI specification says that after clearing the run/stop bit
    the controller may take up to 16ms to halt. We've seen a device take
    14ms, which with the current timeout of 10ms causes the kernel to
    abort the suspend. Increasing the timeout to the recommended value
    fixes the problem.
    
    This patch should be backported to kernels as old as 2.6.37, that
    contain the commit 5535b1d5f8885695c6ded783c692e3c0d0eda8ca "USB: xHCI:
    PCI power management implementation".
    
    Signed-off-by: Michael Spang <spang@chromium.org>
    Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit b75790b5ef148639ab1f7378b3d8deacf48df0c7
Author: Bart Van Assche <bvanassche@acm.org>
Date:   Fri Aug 24 09:08:41 2012 +0000

    scsi_dh_alua: Enable STPG for unavailable ports
    
    commit e47f8976d8e573928824a06748f7bc82c58d747f upstream.
    
    A quote from SPC-4: "While in the unavailable primary target port
    asymmetric access state, the device server shall support those of
    the following commands that it supports while in the active/optimized
    state: [ ... ] d) SET TARGET PORT GROUPS; [ ... ]". Hence enable
    sending STPG to a target port group that is in the unavailable state.
    
    Signed-off-by: Bart Van Assche <bvanassche@acm.org>
    Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
    Acked-by: Hannes Reinecke <hare@suse.de>
    Signed-off-by: James Bottomley <JBottomley@Parallels.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 85764e725e7dc6374aece7e6859c48c14c14a4fa
Author: Dan Williams <djbw@fb.com>
Date:   Tue Aug 28 22:12:10 2012 -0700

    scsi_remove_target: fix softlockup regression on hot remove
    
    commit bc3f02a795d3b4faa99d37390174be2a75d091bd upstream.
    
    John reports:
     BUG: soft lockup - CPU#2 stuck for 23s! [kworker/u:8:2202]
     [..]
     Call Trace:
      [<ffffffff8141782a>] scsi_remove_target+0xda/0x1f0
      [<ffffffff81421de5>] sas_rphy_remove+0x55/0x60
      [<ffffffff81421e01>] sas_rphy_delete+0x11/0x20
      [<ffffffff81421e35>] sas_port_delete+0x25/0x160
      [<ffffffff814549a3>] mptsas_del_end_device+0x183/0x270
    
    ...introduced by commit 3b661a9 "[SCSI] fix hot unplug vs async scan race".
    
    Don't restart lookup of more stargets in the multi-target case, just
    arrange to traverse the list once, on the assumption that new targets
    are always added at the end.  There is no guarantee that the target will
    change state in scsi_target_reap() so we can end up spinning if we
    restart.
    
    Acked-by: Jack Wang <jack_wang@usish.com>
    LKML-Reference: <CAEhu1-6wq1YsNiscGMwP4ud0Q+MrViRzv=kcWCQSBNc8c68N5Q@mail.gmail.com>
    Reported-by: John Drescher <drescherjm@gmail.com>
    Tested-by: John Drescher <drescherjm@gmail.com>
    Signed-off-by: Dan Williams <djbw@fb.com>
    Signed-off-by: James Bottomley <JBottomley@Parallels.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 9b6c30f597019f8817fb8a7619c8197b0cdc396a
Author: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date:   Mon Jul 30 11:33:05 2012 +1000

    ibmvscsi: Fix host config length field overflow
    
    commit 225c56960fcafeccc2b6304f96cd3f0dbf42a16a upstream.
    
    The length field in the host config packet is only 16-bit long, so
    passing it 0x10000 (64K which is our standard PAGE_SIZE) doesn't
    work and result in an empty config from the server.
    
    Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    Acked-by: Robert Jennings <rcj@linux.vnet.ibm.com>
    Signed-off-by: James Bottomley <JBottomley@Parallels.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit a7e99acebfbeab9dec2bda2c1754f98d41ace1e2
Author: Martin Peschke <mpeschke@linux.vnet.ibm.com>
Date:   Tue Sep 4 15:23:36 2012 +0200

    zfcp: only access zfcp_scsi_dev for valid scsi_device
    
    commit d436de8ce25f53a8a880a931886821f632247943 upstream.
    
    __scsi_remove_device (e.g. due to dev_loss_tmo) calls
    zfcp_scsi_slave_destroy which in turn sends a close LUN FSF request to
    the adapter. After 30 seconds without response,
    zfcp_erp_timeout_handler kicks the ERP thread failing the close LUN
    ERP action. zfcp_erp_wait in zfcp_erp_lun_shutdown_wait and thus
    zfcp_scsi_slave_destroy returns and then scsi_device is no longer
    valid. Sometime later the response to the close LUN FSF request may
    finally come in. However, commit
    b62a8d9b45b971a67a0f8413338c230e3117dff5
    "[SCSI] zfcp: Use SCSI device data zfcp_scsi_dev instead of zfcp_unit"
    introduced a number of attempts to unconditionally access struct
    zfcp_scsi_dev through struct scsi_device causing a use-after-free.
    This leads to an Oops due to kernel page fault in one of:
    zfcp_fsf_abort_fcp_command_handler, zfcp_fsf_open_lun_handler,
    zfcp_fsf_close_lun_handler, zfcp_fsf_req_trace,
    zfcp_fsf_fcp_handler_common.
    Move dereferencing of zfcp private data zfcp_scsi_dev allocated in
    scsi_device via scsi_transport_reserve_device after the check for
    potentially aborted FSF request and thus no longer valid scsi_device.
    Only then assign sdev_to_zfcp(sdev) to the local auto variable struct
    zfcp_scsi_dev *zfcp_sdev.
    
    Signed-off-by: Martin Peschke <mpeschke@linux.vnet.ibm.com>
    Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com>
    Signed-off-by: James Bottomley <JBottomley@Parallels.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 54178d7685c20d802568b632e6038ec5070fd8fa
Author: Steffen Maier <maier@linux.vnet.ibm.com>
Date:   Tue Sep 4 15:23:34 2012 +0200

    zfcp: restore refcount check on port_remove
    
    commit d99b601b63386f3395dc26a699ae703a273d9982 upstream.
    
    Upstream commit f3450c7b917201bb49d67032e9f60d5125675d6a
    "[SCSI] zfcp: Replace local reference counting with common kref"
    accidentally dropped a reference count check before tearing down
    zfcp_ports that are potentially in use by zfcp_units.
    Even remote ports in use can be removed causing
    unreachable garbage objects zfcp_ports with zfcp_units.
    Thus units won't come back even after a manual port_rescan.
    The kref of zfcp_port->dev.kobj is already used by the driver core.
    We cannot re-use it to track the number of zfcp_units.
    Re-introduce our own counter for units per port
    and check on port_remove.
    
    Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com>
    Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com>
    Signed-off-by: James Bottomley <JBottomley@Parallels.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit c6a407c66df3865d89f0146b502a4f9f8a1115a2
Author: Julia Lawall <Julia.Lawall@lip6.fr>
Date:   Tue Sep 4 15:23:33 2012 +0200

    zfcp: remove invalid reference to list iterator variable
    
    commit ca579c9f136af4274ccfd1bcaee7f38a29a0e2e9 upstream.
    
    If list_for_each_entry, etc complete a traversal of the list, the iterator
    variable ends up pointing to an address at an offset from the list head,
    and not a meaningful structure.  Thus this value should not be used after
    the end of the iterator.  Replace port->adapter->scsi_host by
    adapter->scsi_host.
    
    This problem was found using Coccinelle (http://coccinelle.lip6.fr/).
    
    Oversight in upsteam commit of v2.6.37
    a1ca48319a9aa1c5b57ce142f538e76050bb8972
    "[SCSI] zfcp: Move ACL/CFDC code to zfcp_cfdc.c"
    which merged the content of zfcp_erp_port_access_changed().
    
    Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
    Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com>
    Reviewed-by: Martin Peschke <mpeschke@linux.vnet.ibm.com>
    Signed-off-by: James Bottomley <JBottomley@Parallels.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 50c67dae8c18bf57b23a83e51edacb35ab119021
Author: Steffen Maier <maier@linux.vnet.ibm.com>
Date:   Tue Sep 4 15:23:32 2012 +0200

    zfcp: Do not wakeup while suspended
    
    commit cb45214960bc989af8b911ebd77da541c797717d upstream.
    
    If the mapping of FCP device bus ID and corresponding subchannel
    is modified while the Linux image is suspended, the resume of FCP
    devices can fail. During resume, zfcp gets callbacks from cio regarding
    the modified subchannels but they can be arbitrarily mixed with the
    restore/resume callback. Since the cio callbacks would trigger
    adapter recovery, zfcp could wakeup before the resume callback.
    Therefore, ignore the cio callbacks regarding subchannels while
    being suspended. We can safely do so, since zfcp does not deal itself
    with subchannels. For problem determination purposes, we still trace the
    ignored callback events.
    
    The following kernel messages could be seen on resume:
    
    kernel: <WWPN>: parent <FCP device bus ID> should not be sleeping
    
    As part of adapter reopen recovery, zfcp performs auto port scanning
    which can erroneously try to register new remote ports with
    scsi_transport_fc and the device core code complains about the parent
    (adapter) still sleeping.
    
    kernel: zfcp.3dff9c: <FCP device bus ID>:\
     Setting up the QDIO connection to the FCP adapter failed
    <last kernel message repeated 3 more times>
    kernel: zfcp.574d43: <FCP device bus ID>:\
     ERP cannot recover an error on the FCP device
    
    In such cases, the adapter gave up recovery and remained blocked along
    with its child objects: remote ports and LUNs/scsi devices. Even the
    adapter shutdown as part of giving up recovery failed because the ccw
    device state remained disconnected. Later, the corresponding remote
    ports ran into dev_loss_tmo. As a result, the LUNs were erroneously
    not available again after resume.
    
    Even a manually triggered adapter recovery (e.g. sysfs attribute
    failed, or device offline/online via sysfs) could not recover the
    adapter due to the remaining disconnected state of the corresponding
    ccw device.
    
    Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com>
    Signed-off-by: James Bottomley <JBottomley@Parallels.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 64b0bb9b6ce5cfd183b3545e294eac630db52dc8
Author: Steffen Maier <maier@linux.vnet.ibm.com>
Date:   Tue Sep 4 15:23:31 2012 +0200

    zfcp: Bounds checking for deferred error trace
    
    commit 01e60527f0a49b3d7df603010bd6079bb4b6cf07 upstream.
    
    The pl vector has scount elements, i.e. pl[scount-1] is the last valid
    element. For maximum sized requests, payload->counter == scount after
    the last loop iteration. Therefore, do bounds checking first (with
    boolean shortcut) to not access the invalid element pl[scount].
    
    Do not trust the maximum sbale->scount value from the HBA
    but ensure we won't access the pl vector out of our allocated bounds.
    While at it, clean up scoping and prevent unnecessary memset.
    
    Minor fix for 86a9668a8d29ea711613e1cb37efa68e7c4db564
    "[SCSI] zfcp: support for hardware data router"
    
    Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com>
    Reviewed-by: Martin Peschke <mpeschke@linux.vnet.ibm.com>
    Signed-off-by: James Bottomley <JBottomley@Parallels.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 38256c96b86de6a47e45c9b729594a1093c86027
Author: Steffen Maier <maier@linux.vnet.ibm.com>
Date:   Tue Sep 4 15:23:30 2012 +0200

    zfcp: Make trace record tags unique
    
    commit 0100998dbfe6dfcd90a6e912ca7ed6f255d48f25 upstream.
    
    Duplicate fssrh_2 from a54ca0f62f953898b05549391ac2a8a4dad6482b
    "[SCSI] zfcp: Redesign of the debug tracing for HBA records."
    complicates distinction of generic status read response from
    local link up.
    Duplicate fsscth1 from 2c55b750a884b86dea8b4cc5f15e1484cc47a25c
    "[SCSI] zfcp: Redesign of the debug tracing for SAN records."
    complicates distinction of good common transport response from
    invalid port handle.
    
    Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com>
    Reviewed-by: Martin Peschke <mpeschke@linux.vnet.ibm.com>
    Signed-off-by: James Bottomley <JBottomley@Parallels.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 9abfe7ade8904531f0fafd61b4e97dcc68e9254c
Author: Paul E. McKenney <paul.mckenney@linaro.org>
Date:   Sat Sep 22 13:55:30 2012 -0700

    rcu: Fix day-one dyntick-idle stall-warning bug
    
    commit a10d206ef1a83121ab7430cb196e0376a7145b22 upstream.
    
    Each grace period is supposed to have at least one callback waiting
    for that grace period to complete.  However, if CONFIG_NO_HZ=n, an
    extra callback-free grace period is no big problem -- it will chew up
    a tiny bit of CPU time, but it will complete normally.  In contrast,
    CONFIG_NO_HZ=y kernels have the potential for all the CPUs to go to
    sleep indefinitely, in turn indefinitely delaying completion of the
    callback-free grace period.  Given that nothing is waiting on this grace
    period, this is also not a problem.
    
    That is, unless RCU CPU stall warnings are also enabled, as they are
    in recent kernels.  In this case, if a CPU wakes up after at least one
    minute of inactivity, an RCU CPU stall warning will result.  The reason
    that no one noticed until quite recently is that most systems have enough
    OS noise that they will never remain absolutely idle for a full minute.
    But there are some embedded systems with cut-down userspace configurations
    that consistently get into this situation.
    
    All this begs the question of exactly how a callback-free grace period
    gets started in the first place.  This can happen due to the fact that
    CPUs do not necessarily agree on which grace period is in progress.
    If a CPU still believes that the grace period that just completed is
    still ongoing, it will believe that it has callbacks that need to wait for
    another grace period, never mind the fact that the grace period that they
    were waiting for just completed.  This CPU can therefore erroneously
    decide to start a new grace period.  Note that this can happen in
    TREE_RCU and TREE_PREEMPT_RCU even on a single-CPU system:  Deadlock
    considerations mean that the CPU that detected the end of the grace
    period is not necessarily officially informed of this fact for some time.
    
    Once this CPU notices that the earlier grace period completed, it will
    invoke its callbacks.  It then won't have any callbacks left.  If no
    other CPU has any callbacks, we now have a callback-free grace period.
    
    This commit therefore makes CPUs check more carefully before starting a
    new grace period.  This new check relies on an array of tail pointers
    into each CPU's list of callbacks.  If the CPU is up to date on which
    grace periods have completed, it checks to see if any callbacks follow
    the RCU_DONE_TAIL segment, otherwise it checks to see if any callbacks
    follow the RCU_WAIT_TAIL segment.  The reason that this works is that
    the RCU_WAIT_TAIL segment will be promoted to the RCU_DONE_TAIL segment
    as soon as the CPU is officially notified that the old grace period
    has ended.
    
    This change is to cpu_needs_another_gp(), which is called in a number
    of places.  The only one that really matters is in rcu_start_gp(), where
    the root rcu_node structure's ->lock is held, which prevents any
    other CPU from starting or completing a grace period, so that the
    comparison that determines whether the CPU is missing the completion
    of a grace period is stable.
    
    Reported-by: Becky Bruce <bgillbruce@gmail.com>
    Reported-by: Subodh Nijsure <snijsure@grid-net.com>
    Reported-by: Paul Walmsley <paul@pwsan.com>
    Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org>
    Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
    Tested-by: Paul Walmsley <paul@pwsan.com>  # OMAP3730, OMAP4430
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 68c333c5d6ebaf6468fa25b774396c7f359f316d
Author: Nicholas Bellinger <nab@linux-iscsi.org>
Date:   Sat Sep 22 17:21:06 2012 -0700

    iscsi-target: Correctly set 0xffffffff field within ISCSI_OP_REJECT PDU
    
    commit f25590f39d543272f7ae7b00d533359c8d7ff331 upstream.
    
    This patch adds a missing iscsi_reject->ffffffff assignment within
    iscsit_send_reject() code to properly follow RFC-3720 Section 10.17
    Bytes 16 -> 19 for the PDU format definition of ISCSI_OP_REJECT.
    
    We've not seen any initiators care about this bytes in practice, but
    as Ronnie reported this was causing trouble with wireshark packet
    decoding lets go ahead and fix this up now.
    
    Reported-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 320c688c8963c531f4c6228f326d65f1b9aad866
Author: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Date:   Fri Sep 21 15:09:47 2012 +0800

    can: mscan-mpc5xxx: fix return value check in mpc512x_can_get_clock()
    
    commit f61bd0585dfc7d99db4936d7467de4ca8e2f7ea0 upstream.
    
    In case of error, the function clk_get() returns ERR_PTR()
    and never returns NULL pointer. The NULL test in the error
    handling should be replaced with IS_ERR().
    
    dpatch engine is used to auto generated this patch.
    (https://github.com/weiyj/dpatch)
    
    Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
    Acked-by: Wolfgang Grandegger <wg@grandegger.com>
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit cd2e82d4af8f6ac20b082aedb1bed3a25a74017f
Author: Bjørn Mork <bjorn@mork.no>
Date:   Wed Sep 19 22:02:03 2012 +0200

    USB: qcaux: add Pantech vendor class match
    
    commit c638eb2872b3af079501e7ee44cbb8a5cce9b4b5 upstream.
    
    The three Pantech devices UML190 (106c:3716), UML290 (106c:3718) and
    P4200 (106c:3721) all use the same subclasses to identify vendor
    specific functions.  Replace the existing device specific entries
    with generic vendor matching, adding support for the P4200.
    
    Signed-off-by: Bjørn Mork <bjorn@mork.no>
    Cc: Thomas Schäfer <tschaefer@t-online.de>
    Acked-by: Dan Williams <dcbw@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit a806ca8384cbc7f08ae9db75f9e06004e1cdaa13
Author: Bjørn Mork <bjorn@mork.no>
Date:   Wed Sep 19 22:02:12 2012 +0200

    USB: option: blacklist QMI interface on ZTE MF683
    
    commit 160c9425ac52cb30502be2d9c5e848cec91bb115 upstream.
    
    Interface #5 on ZTE MF683 is a QMI/wwan interface.
    
    Signed-off-by: Bjørn Mork <bjorn@mork.no>
    Cc: Shawn J. Goff <shawn7400@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 2a522045b7ede8773e4966b427391184a2b81d0c
Author: Ian Abbott <abbotti@mev.co.uk>
Date:   Wed Sep 19 19:37:39 2012 +0100

    staging: comedi: fix memory leak for saved channel list
    
    commit c8cad4c89ee3b15935c532210ae6ebb5c0a2734d upstream.
    
    When `do_cmd_ioctl()` allocates memory for the kernel copy of a channel
    list, it frees any previously allocated channel list in
    `async->cmd.chanlist` and replaces it with the new one.  However, if the
    device is ever removed (or "detached") the cleanup code in
    `cleanup_device()` in "drivers.c" does not free this memory so it is
    lost.
    
    A sensible place to free the kernel copy of the channel list is in
    `do_become_nonbusy()` as at that point the comedi asynchronous command
    associated with the channel list is no longer valid.  Free the channel
    list in `do_become_nonbusy()` instead of `do_cmd_ioctl()` and clear the
    pointer to prevent it being freed more than once.
    
    Note that `cleanup_device()` could be called at an inappropriate time
    while the comedi device is open, but that's a separate bug not related
    to this this patch.
    
    Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    [bwh: Backported to 3.2: adjust context]
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit fda55976471f47647592f59b14a907fe2c0d38a0
Author: Theodore Ts'o <tytso@mit.edu>
Date:   Wed Sep 19 22:42:36 2012 -0400

    ext4: fix potential deadlock in ext4_nonda_switch()
    
    commit 00d4e7362ed01987183e9528295de3213031309c upstream.
    
    In ext4_nonda_switch(), if the file system is getting full we used to
    call writeback_inodes_sb_if_idle().  The problem is that we can be
    holding i_mutex already, and this causes a potential deadlock when
    writeback_inodes_sb_if_idle() when it tries to take s_umount.  (See
    lockdep output below).
    
    As it turns out we don't need need to hold s_umount; the fact that we
    are in the middle of the write(2) system call will keep the superblock
    pinned.  Unfortunately writeback_inodes_sb() checks to make sure
    s_umount is taken, and the VFS uses a different mechanism for making
    sure the file system doesn't get unmounted out from under us.  The
    simplest way of dealing with this is to just simply grab s_umount
    using a trylock, and skip kicking the writeback flusher thread in the
    very unlikely case that we can't take a read lock on s_umount without
    blocking.
    
    Also, we now check the cirteria for kicking the writeback thread
    before we decide to whether to fall back to non-delayed writeback, so
    if there are any outstanding delayed allocation writes, we try to get
    them resolved as soon as possible.
    
       [ INFO: possible circular locking dependency detected ]
       3.6.0-rc1-00042-gce894ca #367 Not tainted
       -------------------------------------------------------
       dd/8298 is trying to acquire lock:
        (&type->s_umount_key#18){++++..}, at: [<c02277d4>] writeback_inodes_sb_if_idle+0x28/0x46
    
       but task is already holding lock:
        (&sb->s_type->i_mutex_key#8){+.+...}, at: [<c01ddcce>] generic_file_aio_write+0x5f/0xd3
    
       which lock already depends on the new lock.
    
       2 locks held by dd/8298:
        #0:  (sb_writers#2){.+.+.+}, at: [<c01ddcc5>] generic_file_aio_write+0x56/0xd3
        #1:  (&sb->s_type->i_mutex_key#8){+.+...}, at: [<c01ddcce>] generic_file_aio_write+0x5f/0xd3
    
       stack backtrace:
       Pid: 8298, comm: dd Not tainted 3.6.0-rc1-00042-gce894ca #367
       Call Trace:
        [<c015b79c>] ? console_unlock+0x345/0x372
        [<c06d62a1>] print_circular_bug+0x190/0x19d
        [<c019906c>] __lock_acquire+0x86d/0xb6c
        [<c01999db>] ? mark_held_locks+0x5c/0x7b
        [<c0199724>] lock_acquire+0x66/0xb9
        [<c02277d4>] ? writeback_inodes_sb_if_idle+0x28/0x46
        [<c06db935>] down_read+0x28/0x58
        [<c02277d4>] ? writeback_inodes_sb_if_idle+0x28/0x46
        [<c02277d4>] writeback_inodes_sb_if_idle+0x28/0x46
        [<c026f3b2>] ext4_nonda_switch+0xe1/0xf4
        [<c0271ece>] ext4_da_write_begin+0x27/0x193
        [<c01dcdb0>] generic_file_buffered_write+0xc8/0x1bb
        [<c01ddc47>] __generic_file_aio_write+0x1dd/0x205
        [<c01ddce7>] generic_file_aio_write+0x78/0xd3
        [<c026d336>] ext4_file_write+0x480/0x4a6
        [<c0198c1d>] ? __lock_acquire+0x41e/0xb6c
        [<c0180944>] ? sched_clock_cpu+0x11a/0x13e
        [<c01967e9>] ? trace_hardirqs_off+0xb/0xd
        [<c018099f>] ? local_clock+0x37/0x4e
        [<c0209f2c>] do_sync_write+0x67/0x9d
        [<c0209ec5>] ? wait_on_retry_sync_kiocb+0x44/0x44
        [<c020a7b9>] vfs_write+0x7b/0xe6
        [<c020a9a6>] sys_write+0x3b/0x64
        [<c06dd4bd>] syscall_call+0x7/0xb
    
    Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 4dad484180d610ab1ce8f87124526c05f7d71d74
Author: Trond Myklebust <Trond.Myklebust@netapp.com>
Date:   Wed Sep 12 16:49:15 2012 -0400

    SUNRPC: Ensure that the TCP socket is closed when in CLOSE_WAIT
    
    commit a519fc7a70d1a918574bb826cc6905b87b482eb9 upstream.
    
    Instead of doing a shutdown() call, we need to do an actual close().
    Ditto if/when the server is sending us junk RPC headers.
    
    Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
    Tested-by: Simon Kirby <sim@hostway.ca>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 20a94a21d7cc392568e70c945983ecf5a79851ff
Author: Ian Abbott <abbotti@mev.co.uk>
Date:   Tue Sep 18 19:46:58 2012 +0100

    staging: comedi: don't dereference user memory for INSN_INTTRIG
    
    commit 5d06e3df280bd230e2eadc16372e62818c63e894 upstream.
    
    `parse_insn()` is dereferencing the user-space pointer `insn->data`
    directly when handling the `INSN_INTTRIG` comedi instruction.  It
    shouldn't be using `insn->data` at all; it should be using the separate
    `data` pointer passed to the function.  Fix it.
    
    Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 3a5a8c3f40090ff66c7738e0ebff8d61a5a9b318
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date:   Wed Aug 15 01:38:11 2012 -0300

    Bluetooth: Add USB_VENDOR_AND_INTERFACE_INFO() for Broadcom/Foxconn
    
    commit ee66401bb94b1f2ce51089c341dcdd25d26ae631 upstream.
    
    Foxconn devices has a vendor specific class of device, we will match them
    differently now.
    
    Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
    [bwh: Backported to 3.2: adjust context]
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 9f714c689f6cbc7c196d7aa12f739009bc9dccca
Author: Yinghai Lu <yinghai@kernel.org>
Date:   Mon Sep 10 17:19:33 2012 -0700

    PCI: Check P2P bridge for invalid secondary/subordinate range
    
    commit 1965f66e7db08d1ebccd24a59043eba826cc1ce8 upstream.
    
    For bridges with "secondary > subordinate", i.e., invalid bus number
    apertures, we don't enumerate anything behind the bridge unless the
    user specified "pci=assign-busses".
    
    This patch makes us automatically try to reassign the downstream bus
    numbers in this case (just for that bridge, not for all bridges as
    "pci=assign-busses" does).
    
    We don't discover all the devices on the Intel DP43BF motherboard
    without this change (or "pci=assign-busses") because its BIOS configures
    a bridge as:
    
        pci 0000:00:1e.0: PCI bridge to [bus 20-08] (subtractive decode)
    
    [bhelgaas: changelog, change message to dev_info]
    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=18412
    Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=625754
    Reported-by: Brian C. Huffman <bhuffman@graze.net>
    Reported-by: VL <vl.homutov@gmail.com>
    Tested-by: VL <vl.homutov@gmail.com>
    Signed-off-by: Yinghai Lu <yinghai@kernel.org>
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 69db9d4382f1a90aa4343e7a4aa4ead72654ca8f
Author: Lai Jiangshan <laijs@cn.fujitsu.com>
Date:   Tue Sep 18 10:40:00 2012 -0700

    workqueue: fix possible stall on try_to_grab_pending() of a delayed work item
    
    commit 3aa62497594430ea522050b75c033f71f2c60ee6 upstream.
    
    Currently, when try_to_grab_pending() grabs a delayed work item, it
    leaves its linked work items alone on the delayed_works.  The linked
    work items are always NO_COLOR and will cause future
    cwq_activate_first_delayed() increase cwq->nr_active incorrectly, and
    may cause the whole cwq to stall.  For example,
    
    state: cwq->max_active = 1, cwq->nr_active = 1
           one work in cwq->pool, many in cwq->delayed_works.
    
    step1: try_to_grab_pending() removes a work item from delayed_works
           but leaves its NO_COLOR linked work items on it.
    
    step2: Later on, cwq_activate_first_delayed() activates the linked
           work item increasing ->nr_active.
    
    step3: cwq->nr_active = 1, but all activated work items of the cwq are
           NO_COLOR.  When they finish, cwq->nr_active will not be
           decreased due to NO_COLOR, and no further work items will be
           activated from cwq->delayed_works. the cwq stalls.
    
    Fix it by ensuring the target work item is activated before stealing
    PENDING in try_to_grab_pending().  This ensures that all the linked
    work items are activated without incorrectly bumping cwq->nr_active.
    
    tj: Updated comment and description.
    
    Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
    Signed-off-by: Tejun Heo <tj@kernel.org>
    [bwh: Backported to 3.2: adjust context]
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 606d8a8ad41c307aa763579e50f81c565c210f48
Author: Alex Williamson <alex.williamson@redhat.com>
Date:   Fri Nov 11 17:26:44 2011 -0700

    intel-iommu: Default to non-coherent for domains unattached to iommus
    
    commit 2e12bc29fc5a12242d68e11875db3dd58efad9ff upstream.
    
    domain_update_iommu_coherency() currently defaults to setting domains
    as coherent when the domain is not attached to any iommus.  This
    allows for a window in domain_context_mapping_one() where such a
    domain can update context entries non-coherently, and only after
    update the domain capability to clear iommu_coherency.
    
    This can be seen using KVM device assignment on VT-d systems that
    do not support coherency in the ecap register.  When a device is
    added to a guest, a domain is created (iommu_coherency = 0), the
    device is attached, and ranges are mapped.  If we then hot unplug
    the device, the coherency is updated and set to the default (1)
    since no iommus are attached to the domain.  A subsequent attach
    of a device makes use of the same dmar domain (now marked coherent)
    updates context entries with coherency enabled, and only disables
    coherency as the last step in the process.
    
    To fix this, switch domain_update_iommu_coherency() to use the
    safer, non-coherent default for domains not attached to iommus.
    
    Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
    Tested-by: Donald Dutile <ddutile@redhat.com>
    Acked-by: Donald Dutile <ddutile@redhat.com>
    Acked-by: Chris Wright <chrisw@sous-sol.org>
    Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
    [bwh: Backported to 3.2: dmar_domain::iommu_bmp is a single unsigned long
     not an array, so add &]
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 7ced5a34e7b6f387c1b50115874fc78c4e4ff84e
Author: Gavin Shan <shangw@linux.vnet.ibm.com>
Date:   Mon Sep 17 04:34:27 2012 +0000

    powerpc/eeh: Lock module while handling EEH event
    
    commit feadf7c0a1a7c08c74bebb4a13b755f8c40e3bbc upstream.
    
    The EEH core is talking with the PCI device driver to determine the
    action (purely reset, or PCI device removal). During the period, the
    driver might be unloaded and in turn causes kernel crash as follows:
    
    EEH: Detected PCI bus error on PHB#4-PE#10000
    EEH: This PCI device has failed 3 times in the last hour
    lpfc 0004:01:00.0: 0:2710 PCI channel disable preparing for reset
    Unable to handle kernel paging request for data at address 0x00000490
    Faulting instruction address: 0xd00000000e682c90
    cpu 0x1: Vector: 300 (Data Access) at [c000000fc75ffa20]
        pc: d00000000e682c90: .lpfc_io_error_detected+0x30/0x240 [lpfc]
        lr: d00000000e682c8c: .lpfc_io_error_detected+0x2c/0x240 [lpfc]
        sp: c000000fc75ffca0
       msr: 8000000000009032
       dar: 490
     dsisr: 40000000
      current = 0xc000000fc79b88b0
      paca    = 0xc00000000edb0380	 softe: 0	 irq_happened: 0x00
        pid   = 3386, comm = eehd
    enter ? for help
    [c000000fc75ffca0] c000000fc75ffd30 (unreliable)
    [c000000fc75ffd30] c00000000004fd3c .eeh_report_error+0x7c/0xf0
    [c000000fc75ffdc0] c00000000004ee00 .eeh_pe_dev_traverse+0xa0/0x180
    [c000000fc75ffe70] c00000000004ffd8 .eeh_handle_event+0x68/0x300
    [c000000fc75fff00] c0000000000503a0 .eeh_event_handler+0x130/0x1a0
    [c000000fc75fff90] c000000000020138 .kernel_thread+0x54/0x70
    1:mon>
    
    The patch increases the reference of the corresponding driver modules
    while EEH core does the negotiation with PCI device driver so that the
    corresponding driver modules can't be unloaded during the period and
    we're safe to refer the callbacks.
    
    Reported-by: Alexey Kardashevskiy <aik@ozlabs.ru>
    Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
    Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    [bwh: Backported to 3.2:
     - Adjust context
     - Reporting functions return int (success = 0), not void * (success = NULL)
     - Assume that the 'dev' arguments are non-null]
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 3f9797d12e427691217ca7203790d7256731bc06
Author: Peter Senna Tschudin <peter.senna@gmail.com>
Date:   Mon Sep 17 20:05:33 2012 +0200

    target: fix return code in target_core_init_configfs error path
    
    commit 37bb7899ca366dc212b71b150e78566d04808cc0 upstream.
    
    This patch fixes error cases within target_core_init_configfs() to
    properly set ret = -ENOMEM before jumping to the out_global exception
    path.
    
    This was originally discovered with the following Coccinelle semantic
    match information:
    
    Convert a nonnegative error return code to a negative one, as returned
    elsewhere in the function.  A simplified version of the semantic match
    that finds this problem is as follows: (http://coccinelle.lip6.fr/)
    
    // <smpl>
    (
    if@p1 (\(ret < 0\|ret != 0\))
     { ... return ret; }
    |
    ret@p1 = 0
    )
    ... when != ret = e1
        when != &ret
    *if(...)
    {
      ... when != ret = e2
          when forall
     return ret;
    }
    // </smpl>
    
    Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 20ce58f23298e3184eb85838d00c08aa62d835d6
Author: Ben Hutchings <ben@decadent.org.uk>
Date:   Sun Sep 16 04:18:50 2012 +0100

    staging: speakup_soft: Fix reading of init string
    
    commit 40fe4f89671fb3c7ded94190fb267402a38b0261 upstream.
    
    softsynth_read() reads a character at a time from the init string;
    when it finds the null terminator it sets the initialized flag but
    then repeats the last character.
    
    Additionally, if the read() buffer is not big enough for the init
    string, the next read() will start reading from the beginning again.
    So the caller may never progress to reading anything else.
    
    Replace the simple initialized flag with the current position in
    the init string, carried over between calls.  Switch to reading
    real data once this reaches the null terminator.
    
    (This assumes that the length of the init string can't change, which
    seems to be the case.  Really, the string and position belong together
    in a per-file private struct.)
    
    Tested-by: Samuel Thibault <sthibault@debian.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit a4d44b6bfa193d1b25d8fb72f6566c4556cad0d5
Author: Ben Hutchings <ben@decadent.org.uk>
Date:   Sun Aug 19 19:32:27 2012 -0300

    rc: ite-cir: Initialise ite_dev::rdev earlier
    
    commit 4b961180ef275035b1538317ffd0e21e80e63e77 upstream.
    
    ite_dev::rdev is currently initialised in ite_probe() after
    rc_register_device() returns.  If a newly registered device is opened
    quickly enough, we may enable interrupts and try to use ite_dev::rdev
    before it has been initialised.  Move it up to the earliest point we
    can, right after calling rc_allocate_device().
    
    Reported-and-tested-by: YunQiang Su <wzssyqa@gmail.com>
    
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
    Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

commit 2239182005cc209df395cae2316f4e6688642b8d
Author: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Date:   Thu Jul 26 11:34:10 2012 -0500

    hpsa: Use LUN reset instead of target reset
    
    commit 21e89afd325849eb38adccf382df16cc895911f9 upstream.
    
    It turns out Smart Array logical drives do not support target
    reset and when the target reset fails, the logical drive will
    be taken off line.  Symptoms look like this:
    
    hpsa 0000:03:00.0: Abort request on C1:B0:T0:L0
    hpsa 0000:03:00.0: resetting device 1:0:0:0
    hpsa 0000:03:00.0: cp ffff880037c56000 is reported invalid (probably means target device no longer present)
    hpsa 0000:03:00.0: resetting device failed.
    sd 1:0:0:0: Device offlined - not ready after error recovery
    sd 1:0:0:0: rejecting I/O to offline device
    EXT3-fs error (device sdb1): read_block_bitmap:
    
    LUN reset is supported though, and is what we should be using.
    Target reset is also disruptive in shared SAS situations,
    for example, an external MSA1210m which does support target
    reset attached to Smart Arrays in multiple hosts -- a target
    reset from one host is disruptive to other hosts as all LUNs
    on the target will be reset and will abort all outstanding i/os
    back to all the attached hosts.  So we should use LUN reset,
    not target reset.
    
    Tested this with Smart Array logical drives and with tape drives.
    Not sure how this bug survived since 2009, except it must be very
    rare for a Smart Array to require more than 30s to complete a request.
    
    Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
    Signed-off-by: James Bottomley <JBottomley@Parallels.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 2535cfea69e86c6f1ca22893411a2d92fcfc08ff
Author: Elric Fu <elricfu1@gmail.com>
Date:   Wed Jun 27 16:31:52 2012 +0800

    xHCI: cancel command after command timeout
    
    commit 6e4468b9a0793dfb53eb80d9fe52c739b13b27fd upstream.
    
    The patch is used to cancel command when the command isn't
    acknowledged and a timeout occurs.
    
    This patch should be backported to kernels as old as 3.0, that contain
    the commit 7ed603ecf8b68ab81f4c83097d3063d43ec73bb8 "xhci: Add an
    assertion to check for virt_dev=0 bug." That commit papers over a NULL
    pointer dereference, and this patch fixes the underlying issue that
    caused the NULL pointer dereference.
    
    Signed-off-by: Elric Fu <elricfu1@gmail.com>
    Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
    Tested-by: Miroslav Sabljic <miroslav.sabljic@avl.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 88bd928daafb5912c269af628b1e5347620c9a62
Author: Elric Fu <elricfu1@gmail.com>
Date:   Wed Jun 27 16:31:12 2012 +0800

    xHCI: add aborting command ring function
    
    commit b92cc66c047ff7cf587b318fe377061a353c120f upstream.
    
    Software have to abort command ring and cancel command
    when a command is failed or hang. Otherwise, the command
    ring will hang up and can't handle the others. An example
    of a command that may hang is the Address Device Command,
    because waiting for a SET_ADDRESS request to be acknowledged
    by a USB device is outside of the xHC's ability to control.
    
    To cancel a command, software will initialize a command
    descriptor for the cancel command, and add it into a
    cancel_cmd_list of xhci.
    
    Sarah: Fixed missing newline on "Have the command ring been stopped?"
    debugging statement.
    
    This patch should be backported to kernels as old as 3.0, that contain
    the commit 7ed603ecf8b68ab81f4c83097d3063d43ec73bb8 "xhci: Add an
    assertion to check for virt_dev=0 bug." That commit papers over a NULL
    pointer dereference, and this patch fixes the underlying issue that
    caused the NULL pointer dereference.
    
    Signed-off-by: Elric Fu <elricfu1@gmail.com>
    Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
    Tested-by: Miroslav Sabljic <miroslav.sabljic@avl.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit df045069dcc9242c4de84d2a117af313f7b00853
Author: Elric Fu <elricfu1@gmail.com>
Date:   Wed Jun 27 16:30:57 2012 +0800

    xHCI: add cmd_ring_state
    
    commit c181bc5b5d5c79b71203cd10cef97f802fb6f9c1 upstream.
    
    Adding cmd_ring_state for command ring. It helps to verify
    the current command ring state for controlling the command
    ring operations.
    
    This patch should be backported to kernels as old as 3.0.  The commit
    7ed603ecf8b68ab81f4c83097d3063d43ec73bb8 "xhci: Add an assertion to
    check for virt_dev=0 bug." papers over the NULL pointer dereference that
    I now believe is related to a timed out Set Address command.  This (and
    the four patches that follow it) contain the real fix that also allows
    VIA USB 3.0 hubs to consistently re-enumerate during the plug/unplug
    stress tests.
    
    Signed-off-by: Elric Fu <elricfu1@gmail.com>
    Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
    Tested-by: Miroslav Sabljic <miroslav.sabljic@avl.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit b89d0660eba658f9afa5ddeabc742e07bcaabea7
Author: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Date:   Fri Mar 16 12:58:20 2012 -0700

    xhci: Warn when hosts don't halt.
    
    commit 5af98bb06dee79d28c805f9fd0805ce791121784 upstream.
    
    Eric Fu reports a problem with his VIA host controller fetching a zeroed
    event ring pointer on resume from suspend.  The host should have been
    halted, but we can't be sure because that code ignores the return value
    from xhci_halt().  Print a warning when the host controller refuses to
    halt within XHCI_MAX_HALT_USEC (currently 16 seconds).
    
    (Update: it turns out that the VIA host controller is reporting a halted
    state when it fetches the zeroed event ring pointer.  However, we still
    need this warning for other host controllers.)
    
    Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 6a230d70aa30b1fd6780a3d885579f599843514d
Author: Frank Schäfer <fschaefer.oss@googlemail.com>
Date:   Sun Sep 9 15:02:19 2012 -0300

    gspca_pac7302: add support for device 1ae7:2001 Speedlink Snappy Microphone SL-6825-SBK
    
    commit 97d2fbf501e3cf105ac957086c7e40e62e15cdf8 upstream.
    
    Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
    [bwh: Backported to 3.2: adjust filename]
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit fed48514a7408839119e5a37e63eb087683de6f9
Author: Hans de Goede <hdegoede@redhat.com>
Date:   Fri Dec 30 19:15:53 2011 -0300

    gspca_pac7302: Add usb-id for 145f:013c
    
    commit 4d6454dbae935825e729f34dc7410bb1b22c7944 upstream.
    
    Reported by: Grzegorz Woźniak
    
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 77b640378a406a49356cb82cc3fc87e5ad594c52
Author: Michael Wang <wangyun@linux.vnet.ibm.com>
Date:   Wed Sep 5 10:33:18 2012 +0800

    slab: fix the DEADLOCK issue on l3 alien lock
    
    commit 947ca1856a7e60aa6d20536785e6a42dff25aa6e upstream.
    
    DEADLOCK will be report while running a kernel with NUMA and LOCKDEP enabled,
    the process of this fake report is:
    
    	   kmem_cache_free()	//free obj in cachep
    	-> cache_free_alien()	//acquire cachep's l3 alien lock
    	-> __drain_alien_cache()
    	-> free_block()
    	-> slab_destroy()
    	-> kmem_cache_free()	//free slab in cachep->slabp_cache
    	-> cache_free_alien()	//acquire cachep->slabp_cache's l3 alien lock
    
    Since the cachep and cachep->slabp_cache's l3 alien are in the same lock class,
    fake report generated.
    
    This should not happen since we already have init_lock_keys() which will
    reassign the lock class for both l3 list and l3 alien.
    
    However, init_lock_keys() was invoked at a wrong position which is before we
    invoke enable_cpucache() on each cache.
    
    Since until set slab_state to be FULL, we won't invoke enable_cpucache()
    on caches to build their l3 alien while creating them, so although we invoked
    init_lock_keys(), the l3 alien lock class won't change since we don't have
    them until invoked enable_cpucache() later.
    
    This patch will invoke init_lock_keys() after we done enable_cpucache()
    instead of before to avoid the fake DEADLOCK report.
    
    Michael traced the problem back to a commit in release 3.0.0:
    
    commit 30765b92ada267c5395fc788623cb15233276f5c
    Author: Peter Zijlstra <peterz@infradead.org>
    Date:   Thu Jul 28 23:22:56 2011 +0200
    
        slab, lockdep: Annotate the locks before using them
    
        Fernando found we hit the regular OFF_SLAB 'recursion' before we
        annotate the locks, cure this.
    
        The relevant portion of the stack-trace:
    
        > [    0.000000]  [<c085e24f>] rt_spin_lock+0x50/0x56
        > [    0.000000]  [<c04fb406>] __cache_free+0x43/0xc3
        > [    0.000000]  [<c04fb23f>] kmem_cache_free+0x6c/0xdc
        > [    0.000000]  [<c04fb2fe>] slab_destroy+0x4f/0x53
        > [    0.000000]  [<c04fb396>] free_block+0x94/0xc1
        > [    0.000000]  [<c04fc551>] do_tune_cpucache+0x10b/0x2bb
        > [    0.000000]  [<c04fc8dc>] enable_cpucache+0x7b/0xa7
        > [    0.000000]  [<c0bd9d3c>] kmem_cache_init_late+0x1f/0x61
        > [    0.000000]  [<c0bba687>] start_kernel+0x24c/0x363
        > [    0.000000]  [<c0bba0ba>] i386_start_kernel+0xa9/0xaf
    
        Reported-by: Fernando Lopez-Lezcano <nando@ccrma.Stanford.EDU>
        Acked-by: Pekka Enberg <penberg@kernel.org>
        Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
        Link: http://lkml.kernel.org/r/1311888176.2617.379.camel@laptop
        Signed-off-by: Ingo Molnar <mingo@elte.hu>
    
    The commit moved init_lock_keys() before we build up the alien, so we
    failed to reclass it.
    
    Acked-by: Christoph Lameter <cl@linux.com>
    Tested-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
    Signed-off-by: Michael Wang <wangyun@linux.vnet.ibm.com>
    Signed-off-by: Pekka Enberg <penberg@kernel.org>
    [bwh: Backported to 3.2: adjust context]
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 54d3eed065283324ff9acba401f337ead40af27b
Author: Ben Hutchings <ben@decadent.org.uk>
Date:   Wed Sep 5 14:37:36 2012 -0700

    tools/hv: Fix exit() error code
    
    commit 6bb22fea25624ab593eee376fa5fb82d1b13f45a upstream.
    
    Linux native exit codes are 8-bit unsigned values.  exit(-1) results
    in an exit code of 255, which is usually reserved for shells reporting
    'command not found'.  Use the portable value EXIT_FAILURE.  (Not that
    this matters much for a daemon.)
    
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
    Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    [bwh: Backported to 3.2: drop changes to exit() calls not in this version]

commit 77ad5624ead898018901874d19671164d5ee741c
Author: Khalid Aziz <khalid.aziz@hp.com>
Date:   Mon Sep 10 12:52:42 2012 -0600

    firmware: Add missing attributes to EFI variable attribute print out from sysfs
    
    commit 7083909023bbe29b3176e92d2d089def1aa7aa1e upstream.
    
    Some of the EFI variable attributes are missing from print out from
    /sys/firmware/efi/vars/*/attributes. This patch adds those in. It also
    updates code to use pre-defined constants for masking current value
    of attributes.
    
    Signed-off-by: Khalid Aziz <khalid.aziz@hp.com>
    Reviewed-by: Kees Cook <keescook@chromium.org>
    Acked-by: Matthew Garrett <mjg@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 04ed02cc7d431eb295bf9a4cb33c13319f34c48a
Author: Matthieu CASTET <matthieu.castet@parrot.com>
Date:   Wed Aug 22 16:03:46 2012 +0200

    UBI: erase free PEB with bitflip in EC header
    
    commit 193819cf2e6e395b1e1be2d36785dc5563a6edca upstream.
    
    Without this patch, these PEB are not scrubbed until we put data in them.
    Bitflip can accumulate latter and we can loose the EC header (but VID header
    should be intact and allow to recover data).
    
    Signed-off-by: Matthieu Castet <matthieu.castet@parrot.com>
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
    [bwh: Backported to 3.2: adjust filename, context]
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit aa85d9855447adcbc162705e922654ff4df96467
Author: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Date:   Sat Aug 18 14:11:42 2012 +0200

    UBI: fix autoresize handling in R/O mode
    
    commit abb3e01103eb4e2ea5c15e6fedbc74e08bd4cc2b upstream.
    
    Currently UBI fails in autoresize when it is in R/O mode (e.g., because the
    underlying MTD device is R/O). This patch fixes the issue - we just skip
    autoresize and print a warning.
    
    Reported-by: Pali Rohár <pali.rohar@gmail.com>
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit f11829e7da3cd59400fe60287a3c3a11a6ddb2ac
Author: Russ Gorby <russ.gorby@intel.com>
Date:   Mon Aug 13 13:45:30 2012 +0100

    n_gsm: memory leak in uplink error path
    
    commit 88ed2a60610974443335c924d7cb8e5dcf9dbdc1 upstream.
    
    Uplink (TX) network data will go through gsm_dlci_data_output_framed
    there is a bug where if memory allocation fails, the skb which
    has already been pulled off the list will be lost.
    
    In addition TX skbs were being processed in LIFO order
    
    Fixed the memory leak, and changed to FIFO order processing
    
    Signed-off-by: Russ Gorby <russ.gorby@intel.com>
    Tested-by: Kappel, LaurentX <laurentx.kappel@intel.com>
    Signed-off-by: Alan Cox <alan@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 0afc4d3b3b1320437cdcc8a290ba9dd9dabe35c0
Author: Russ Gorby <russ.gorby@intel.com>
Date:   Mon Aug 13 13:45:15 2012 +0100

    n_gsm: replace kfree_skb w/ appropriate dev_* versions
    
    commit 329e56780e514a7ab607bcb51a52ab0dc2669414 upstream.
    
    Drivers are supposed to use the dev_* versions of the kfree_skb
    interfaces. In a couple of cases we were called with IRQs
    disabled as well which kfree_skb() does not expect.
    
    Replaced kfree_skb calls w/ dev_kfree_skb and dev_kfree_skb_any
    
    Signed-off-by: Russ Gorby <russ.gorby@intel.com>
    Tested-by: Yin, Fengwei <fengwei.yin@intel.com>
    Signed-off-by: Alan Cox <alan@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 93ed2b137b974b6515f0c847438c7d78a567c1ce
Author: Russ Gorby <russ.gorby@intel.com>
Date:   Mon Aug 13 13:44:59 2012 +0100

    n_gsm: avoid accessing freed memory during CMD_FCOFF condition
    
    commit b4338e1efc339986cf6c0a3652906e914a86e2d3 upstream.
    
    gsm_data_kick was recently modified to allow messages on the
    tx queue bound for DLCI0 to flow even during FCOFF conditions.
    Unfortunately we introduced a bug discovered by code inspection
    where subsequent list traversers can access freed memory if
    the DLCI0 messages were not all at the head of the list.
    
    Replaced singly linked tx list w/ a list_head and used
    provided interfaces for traversing and deleting members.
    
    Signed-off-by: Russ Gorby <russ.gorby@intel.com>
    Tested-by: Yin, Fengwei <fengwei.yin@intel.com>
    Signed-off-by: Alan Cox <alan@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 083500a74cb59d5b3a3ccec5368ac850f41f3dcd
Author: Russ Gorby <russ.gorby@intel.com>
Date:   Mon Aug 13 13:44:40 2012 +0100

    n_gsm: added interlocking for gsm_data_lock for certain code paths
    
    commit 5e44708f75b0f8712da715d6babb0c21089b2317 upstream.
    
    There were some locking holes in the management of the MUX's
    message queue for 2 code paths:
    1) gsmld_write_wakeup
    2) receipt of CMD_FCON flow-control message
    In both cases gsm_data_kick is called w/o locking so it can collide
    with other other instances of gsm_data_kick (pulling messages tx_tail)
    or potentially other instances of __gsm_data_queu (adding messages to tx_head)
    
    Changed to take the tx_lock in these 2 cases
    
    Signed-off-by: Russ Gorby <russ.gorby@intel.com>
    Tested-by: Yin, Fengwei <fengwei.yin@intel.com>
    Signed-off-by: Alan Cox <alan@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit ba3fd3d6cf4a97bcb934614295aa2ee4d2cd6ac9
Author: samix.lebsir <samix.lebsir@intel.com>
Date:   Mon Aug 13 13:44:22 2012 +0100

    char: n_gsm: remove message filtering for contipated DLCI
    
    commit 10c6c383e43565c9c6ec07ff8eb2825f8091bdf0 upstream.
    
    The design of uplink flow control in the mux driver is
    that for constipated channels data will backup into the
    per-channel fifos, and any messages that make it to the
    outbound message queue will still go out.
    Code was added to also stop messages that were in the outbound
    queue but this requires filtering through all the messages on the
    queue for stopped dlcis and changes some of the mux logic unneccessarily.
    
    The message fiiltering was removed to be in line w/ the original design
    as the message filtering does not provide any solution.
    Extra debug messages used during investigation were also removed.
    
    Signed-off-by: samix.lebsir <samix.lebsir@intel.com>
    Signed-off-by: Alan Cox <alan@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 6e9b3851b52f170abd7e7cabd01f34f327626c1c
Author: Frederic Berat <fredericx.berat@intel.com>
Date:   Mon Aug 13 13:43:58 2012 +0100

    n_gsm : Flow control handling in Mux driver
    
    commit c01af4fec2c8f303d6b3354d44308d9e6bef8026 upstream.
    
    - Correcting handling of FCon/FCoff in order to respect 27.010 spec
    - Consider FCon/off will overide all dlci flow control except for
      dlci0 as we must be able to send control frames.
    - Dlci constipated handling according to FC, RTC and RTR values.
    - Modifying gsm_dlci_data_kick and gsm_dlci_data_sweep according
      to dlci constipated value
    
    Signed-off-by: Frederic Berat <fredericx.berat@intel.com>
    Signed-off-by: Russ Gorby <russ.gorby@intel.com>
    Signed-off-by: Alan Cox <alan@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 5c6bb8b0c87d472cce008255db25c0ae61e86d52
Author: Russ Gorby <russ.gorby@intel.com>
Date:   Mon Aug 13 13:43:36 2012 +0100

    n_gsm: uplink SKBs accumulate on list
    
    commit 192b6041e75bb4a2aae73834037038cea139a92d upstream.
    
    gsm_dlci_data_kick will not call any output function if tx_bytes > THRESH_LO
    furthermore it will call the output function only once if tx_bytes == 0
    If the size of the IP writes are on the order of THRESH_LO
    we can get into a situation where skbs accumulate on the outbound list
    being starved for events to call the output function.
    
    gsm_dlci_data_kick now calls the sweep function when tx_bytes==0
    
    Signed-off-by: Russ Gorby <russ.gorby@intel.com>
    Tested-by: Kappel, LaurentX <laurentx.kappel@intel.com>
    Signed-off-by: Alan Cox <alan@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 338f04583d9431abef3dbe46ada8263ecefce059
Author: xiaojin <jin.xiao@intel.com>
Date:   Mon Aug 13 13:43:15 2012 +0100

    n_gsm.c: Implement 3GPP27.010 DLC start-up procedure in MUX
    
    commit 7e8ac7b23b67416700dfb8b4136a4e81ce675b48 upstream.
    
    In 3GPP27.010 5.8.1, it defined:
    The TE multiplexer initiates the establishment of the multiplexer control channel by sending a SABM frame on DLCI 0 using the procedures of clause 5.4.1.
    Once the multiplexer channel is established other DLCs may be established using the procedures of clause 5.4.1.
    This patch implement 5.8.1 in MUX level, it make sure DLC0 is the first channel to be setup.
    
    [or for those not familiar with the specification: it was possible to try
     and open a data connection while the control channel was not yet fully
     open, which is a spec violation and confuses some modems]
    
    Signed-off-by: xiaojin <jin.xiao@intel.com>
    Tested-by: Yin, Fengwei <fengwei.yin@intel.com>
    [tweaked the order we check things and error code]
    Signed-off-by: Alan Cox <alan@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit f39a95cd513843b051b9854bc3b60dc9c1077479
Author: Stanislav Kozina <skozina@redhat.com>
Date:   Thu Aug 16 12:01:47 2012 +0100

    Remove BUG_ON from n_tty_read()
    
    commit e9490e93c1978b6669f3e993caa3189be13ce459 upstream.
    
    Change the BUG_ON to WARN_ON and return in case of tty->read_buf==NULL. We want to track a
    couple of long standing reports of this but at the same time we can avoid killing the box.
    
    Signed-off-by: Stanislav Kozina <skozina@redhat.com>
    Signed-off-by: Alan Cox <alan@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 49167eecdec7620e15678f7a0ac30c4e8e4b32db
Author: Jiri Slaby <jslaby@suse.cz>
Date:   Tue Aug 7 21:47:39 2012 +0200

    TTY: ttyprintk, don't touch behind tty->write_buf
    
    commit ee8b593affdf893012e57f4c54a21984d1b0d92e upstream.
    
    If a user provides a buffer larger than a tty->write_buf chunk and
    passes '\r' at the end of the buffer, we touch an out-of-bound memory.
    
    Add a check there to prevent this.
    
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>
    Cc: Samo Pogacnik <samo_pogacnik@t-2.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit 563ce0476bddbd8e9818c3c7088186dd01479ffe
Author: Tejun Heo <tj@kernel.org>
Date:   Fri Aug 3 10:30:45 2012 -0700

    workqueue: add missing smp_wmb() in process_one_work()
    
    commit 959d1af8cffc8fd38ed53e8be1cf4ab8782f9c00 upstream.
    
    WORK_STRUCT_PENDING is used to claim ownership of a work item and
    process_one_work() releases it before starting execution.  When
    someone else grabs PENDING, all pre-release updates to the work item
    should be visible and all updates made by the new owner should happen
    afterwards.
    
    Grabbing PENDING uses test_and_set_bit() and thus has a full barrier;
    however, clearing doesn't have a matching wmb.  Given the preceding
    spin_unlock and use of clear_bit, I don't believe this can be a
    problem on an actual machine and there hasn't been any related report
    but it still is theretically possible for clear_pending to permeate
    upwards and happen before work->entry update.
    
    Add an explicit smp_wmb() before work_clear_pending().
    
    Signed-off-by: Tejun Heo <tj@kernel.org>
    Cc: Oleg Nesterov <oleg@redhat.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit b05d6bcb7e538370b7a4d3c8b3552be60f1fbb8d
Author: Eugeni Dodonov <eugeni.dodonov@intel.com>
Date:   Mon Jun 18 19:03:38 2012 -0300

    drm/i915: prevent possible pin leak on error path
    
    commit ab3951eb74e7c33a2f5b7b64d72e82f1eea61571 upstream.
    
    We should not hit this under any sane conditions, but still, this does not
    looks right.
    
    CC: Chris Wilson <chris@chris-wilson.co.uk>
    CC: Daniel Vetter <daniel.vetter@ffwll.ch>
    Reported-by: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
    Reviewed-by: Chris Wlison <chris@chris-wilson.co.uk>
    Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit fda0be7fdddfb748257c7d6d7d5c12e5b50f7ae1
Author: Shmulik Ladkani <shmulik.ladkani@gmail.com>
Date:   Sun Jun 10 13:58:12 2012 +0300

    mtd: nand: Use the mirror BBT descriptor when reading its version
    
    commit 7bb9c75436212813b38700c34df4bbb6eb82debe upstream.
    
    The code responsible for reading the version of the mirror bbt was
    incorrectly using the descriptor of the main bbt.
    
    Pass the mirror bbt descriptor to 'scan_read_raw' when reading the
    version of the mirror bbt.
    
    Signed-off-by: Shmulik Ladkani <shmulik.ladkani@gmail.com>
    Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
    Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

commit d562efad2326a7c2383a211f41d0d4121fad5d4b
Author: Dan Williams <dan.j.williams@intel.com>
Date:   Fri Jun 22 11:31:14 2012 -0700

    isci: fix isci_pci_probe() generates warning on efi failure path
    
    commit 6d70a74ffd616073a68ae0974d98819bfa8e6da6 upstream.
    
    The oem parameter image embedded in the efi variable is at an offset
    from the start of the variable.  However, in the failure path we try to
    free the 'orom' pointer which is only valid when the paramaters are
    being read from the legacy option-rom space.
    
    Since failure to load the oem parameters is unlikely and we keep the
    memory around in the success case just defer all de-allocation to devm.
    
    Reported-by: Don Morris <don.morris@hp.com>
    Signed-off-by: Dan Williams <dan.j.williams@intel.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>