commit 845720650c557a75262b629b0bc228fffcf64638
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Fri Jun 1 15:16:13 2012 +0800

    Linux 3.3.8

commit 4f1f847dc0563d85b05decd5128741c1103d4035
Author: Jes Sorensen <Jes.Sorensen@redhat.com>
Date:   Sun Apr 1 23:48:38 2012 +1000

    md: Avoid OOPS when reshaping raid1 to raid0
    
    commit 24b961f811a3e790a9b93604d2594bfb6cce4fa4 upstream.
    
    raid1 arrays do not have the notion of chunk size. Calculate the
    largest chunk sector size we can use to avoid a divide by zero OOPS
    when aligning the size of the new array to the chunk size.
    
    Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
    Signed-off-by: NeilBrown <neilb@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 0bbc87944127ab0cd27fbf2251f60dc134b1d4c0
Author: Larry Finger <Larry.Finger@lwfinger.net>
Date:   Tue Apr 3 15:31:41 2012 -0500

    rtlwifi: rtl8192de: Fix firmware initialization
    
    commit 0298dc9f2273fb2d596ae10d7700f054bfce601d upstream.
    
    Before the switch to asynchronous firmware loading (mainline commit b0302ab),
    it was necessary to load firmware when initializing the first of the units
    in a dual-mac system. After the change, it is necessary to load firmware in
    both units.
    
    Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
    Signed-off-by: John W. Linville <linville@tuxdriver.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 88fad6c0b5f2528a32c58161cc0157a13868c095
Author: Laxman Dewangan <ldewangan@nvidia.com>
Date:   Mon May 7 12:16:19 2012 +0530

    i2c: tegra: notify transfer-complete after clearing status.
    
    commit c889e91d2cc22123f20f40dde0c0a91856a20eea upstream.
    
    The notification of the transfer complete by calling complete()
    should be done after clearing all interrupt status.
    This avoids the race condition of misconfigure the i2c controller
    in multi-core environment.
    
    Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
    Acked-by: Stephen Warren <swarren@wwwdotorg.org>
    Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit e9c769c264f57a11979b56f114183ef01402a11d
Author: Marcus Folkesson <marcus.folkesson@gmail.com>
Date:   Thu May 3 15:56:36 2012 +0200

    i2c: davinci: Free requested IRQ in remove
    
    commit 9868a060ccf769c08ec378a9829137e272e9a92c upstream.
    
    The freed IRQ is not necessary the one requested in probe.
    Even if it was, with two or more i2c-controllers it will fails anyway.
    
    Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
    Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 8fa23b6a048234f83c790a82bbcc6e23a6826b5d
Author: Andi Kleen <andi@firstfloor.org>
Date:   Fri Nov 19 13:16:22 2010 +0100

    MCE: Fix vm86 handling for 32bit mce handler
    
    commit a129a7c84582629741e5fa6f40026efcd7a65bd4 upstream.
    
    When running on 32bit the mce handler could misinterpret
    vm86 mode as ring 0. This can affect whether it does recovery
    or not; it was possible to panic when recovery was actually
    possible.
    
    Fix this by always forcing vm86 to look like ring 3.
    
    Signed-off-by: Andi Kleen <ak@linux.intel.com>
    Signed-off-by: Tony Luck <tony.luck@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit bb9fd9febc705a28ad26f1c6654433dfccb7ca9e
Author: Dima Zavin <dima@android.com>
Date:   Mon Apr 30 10:26:14 2012 +0100

    ARM: 7409/1: Do not call flush_cache_user_range with mmap_sem held
    
    commit 435a7ef52db7d86e67a009b36cac1457f8972391 upstream.
    
    We can't be holding the mmap_sem while calling flush_cache_user_range
    because the flush can fault. If we fault on a user address, the
    page fault handler will try to take mmap_sem again. Since both places
    acquire the read lock, most of the time it succeeds. However, if another
    thread tries to acquire the write lock on the mmap_sem (e.g. mmap) in
    between the call to flush_cache_user_range and the fault, the down_read
    in do_page_fault will deadlock.
    
    [will: removed drop of vma parameter as already queued by rmk (7365/1)]
    
    Acked-by: Catalin Marinas <catalin.marinas@arm.com>
    Signed-off-by: Dima Zavin <dima@android.com>
    Signed-off-by: John Stultz <john.stultz@linaro.org>
    Signed-off-by: Will Deacon <will.deacon@arm.com>
    Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 58d4de16ad04743b5f5eb5a237f2ee16595df38f
Author: Dima Zavin <dima@android.com>
Date:   Thu Mar 29 20:44:06 2012 +0100

    ARM: 7365/1: drop unused parameter from flush_cache_user_range
    
    commit 4542b6a0fa6b48d9ae6b41c1efeb618b7a221b2a upstream.
    
    vma isn't used and flush_cache_user_range isn't a standard macro that
    is used on several archs with the same prototype. In fact only unicore32
    has a macro with the same name (with an identical implementation and no
    in-tree users).
    
    This is a part of a patch proposed by Dima Zavin (with Message-id:
    1272439931-12795-1-git-send-email-dima@android.com) that didn't get
    accepted.
    
    Cc: Dima Zavin <dima@android.com>
    Acked-by: Catalin Marinas <catalin.marinas@arm.com>
    Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
    Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
    Cc: Will Deacon <will.deacon@arm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 0adf705f805bbb05a776c72f7cdff03d85218513
Author: Larry Finger <Larry.Finger@lwfinger.net>
Date:   Fri May 4 08:27:43 2012 -0500

    rtlwifi: fix for race condition when firmware is cached
    
    commit 574e02abaf816b582685805f0c1150ca9f1f18ee upstream.
    
    In commit b0302ab, the rtlwifi family of drivers was converted to use
    asynchronous firmware loading. Unfortumately, the implementation was
    racy, and the ieee80211 routines could be started before rtl_init_core()
    was called to setup the data.
    
    This patch fixes the bug noted in https://bugzilla.kernel.org/show_bug.cgi?id=43187.
    
    Reported-by: Joshua Roys <Joshua.Roys@gtri.gatech.edu>
    Tested-by: Neptune Ning <frostyplanet@gmail.com>
    Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
    Signed-off-by: John W. Linville <linville@tuxdriver.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 4f4e3f10fb3427bfafd2e3439124000f2874c457
Author: Dan Carpenter <dan.carpenter@oracle.com>
Date:   Sun May 13 20:09:38 2012 +0300

    iommu: Fix off by one in dmar_get_fault_reason()
    
    commit fefe1ed1398b81e3fadc92d11d91162d343c8836 upstream.
    
    fault_reason - 0x20 == ARRAY_SIZE(irq_remap_fault_reasons) is
    one past the end of the array.
    
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Cc: Joerg Roedel <joerg.roedel@amd.com>
    Cc: Youquan Song <youquan.song@intel.com>
    Cc: walter harms <wharms@bfs.de>
    Cc: Suresh Siddha <suresh.b.siddha@intel.com>
    Link: http://lkml.kernel.org/r/20120513170938.GA4280@elgon.mountain
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    [bwh: Backported to 3.2: s/irq_remap_fault_reasons/intr_remap_fault_reasons/]
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 82ca2576c67650f4d5513de798a712538a4f2756
Author: David Woodhouse <dwmw2@infradead.org>
Date:   Fri May 25 17:42:54 2012 +0100

    intel-iommu: Add device info into list before doing context mapping
    
    commit e2ad23d04c1304431ab5176c89b7b476ded2d995 upstream.
    
    Add device info into list before doing context mapping, because device
    info will be used by iommu_enable_dev_iotlb(). Without it, ATS won't get
    enabled as it should be.
    
    ATS, while a dubious decision from a security point of view, can be very
    important for performance.
    
    Signed-off-by: Xudong Hao <xudong.hao@intel.com>
    Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
    Acked-by: Chris Wright <chrisw@sous-sol.org>
    Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 55dfa192b4b01123e289f8435dd15cd3717c3698
Author: Chris Metcalf <cmetcalf@tilera.com>
Date:   Fri May 25 12:32:09 2012 -0400

    tile: fix bug where fls(0) was not returning 0
    
    commit 9f1d62bed7f015d11b9164078b7fea433b474114 upstream.
    
    This is because __builtin_clz(0) returns 64 for the "undefined" case
    of 0, since the builtin just does a right-shift 32 and "clz" instruction.
    So, use the alpha approach of casting to u32 and using __builtin_clzll().
    
    Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 83f5ec1fcfbaca44ac717f790170d66d3750e3c3
Author: Ming Lei <ming.lei@canonical.com>
Date:   Thu May 17 10:27:12 2012 +0800

    mmc: omap_hsmmc: pass IRQF_ONESHOT to request_threaded_irq
    
    commit db35f83ef47b5f180f2670d11f5f93992314ea09 upstream.
    
    The flag of IRQF_ONESHOT should be passed to request_threaded_irq,
    otherwise the following failure message should be dumped because
    hardware handler is defined as NULL:
    
    [    3.383483] genirq: Threaded irq requested with handler=NULL and
    !ONESHOT for irq 368
    [    3.392730] omap_hsmmc: probe of omap_hsmmc.0 failed with error -22
    
    The patch fixes one kernel hang bug which is caused by mmc card
    probe failure and root device can't be brought up.
    
    Signed-off-by: Ming Lei <ming.lei@canonical.com>
    Acked-by: Venkatraman S <svenkatr@ti.com>
    Signed-off-by: Chris Ball <cjb@laptop.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 9011fd18ebcfcb648761afb3e23bf55e55bc038c
Author: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Date:   Tue Apr 24 17:56:29 2012 +0200

    mmc: cd-gpio: protect against NULL context in mmc_cd_gpio_free()
    
    commit 0e9f480bb553d39ee06ccd45639ba7a5446a7b81 upstream.
    
    Do not oops, even if mmc_cd_gpio_free() is mistakenly called on a driver
    cleanup path, even though a previous call to mmc_cd_gpio_request() failed.
    
    Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
    [stable@: please apply to 3.3-stable]
    Signed-off-by: Chris Ball <cjb@laptop.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 591c8732fb7d28b5a5d1299bf8822f3880efaa47
Author: Nicolas Pitre <nicolas.pitre@linaro.org>
Date:   Mon Apr 16 19:16:54 2012 -0400

    mmc: sdio: avoid spurious calls to interrupt handlers
    
    commit bbbc4c4d8c5face097d695f9bf3a39647ba6b7e7 upstream.
    
    Commit 06e8935feb ("optimized SDIO IRQ handling for single irq")
    introduced some spurious calls to SDIO function interrupt handlers,
    such as when the SDIO IRQ thread is started, or the safety check
    performed upon a system resume.  Let's add a flag to perform the
    optimization only when a real interrupt is signaled by the host
    driver and we know there is no point confirming it.
    
    Reported-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
    Signed-off-by: Nicolas Pitre <nico@linaro.org>
    Signed-off-by: Chris Ball <cjb@laptop.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit fd1a48fe1d6813c141c890541951fcb54b0f20d7
Author: Tony Luck <tony.luck@intel.com>
Date:   Wed May 23 14:14:22 2012 -0700

    x86/mce: Fix check for processor context when machine check was taken.
    
    commit 875e26648cf9b6db9d8dc07b7959d7c61fb3f49c upstream.
    
    Linus pointed out that there was no value is checking whether m->ip
    was zero - because zero is a legimate value.  If we have a reliable
    (or faked in the VM86 case) "m->cs" we can use it to tell whether we
    were in user mode or kernelwhen the machine check hit.
    
    Reported-by: Linus Torvalds <torvalds@linuxfoundation.org>
    Signed-off-by: Tony Luck <tony.luck@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 43504f70a86b70d4e6eab50b0d46fefe685876be
Author: H. Peter Anvin <hpa@zytor.com>
Date:   Thu May 24 07:01:38 2012 -0700

    x86, relocs: Add jiffies and jiffies_64 to the relative whitelist
    
    commit ea17e7414bc62e8d3bde8d08e3df1d921c518c17 upstream.
    
    The symbol jiffies is created in the linker script as an alias to
    jiffies_64.  Unfortunately this is done outside any section, and
    apparently GNU ld 2.21 doesn't carry the section with it, so we end up
    with an absolute symbol and therefore a broken kernel.
    
    Add jiffies and jiffies_64 to the whitelist.
    
    The most disturbing bit with this discovery is that it shows that we
    have had multiple linker bugs in this area crossing multiple
    generations, and have been silently building bad kernels for some time.
    
    Link: http://lkml.kernel.org/r/20120524171604.0d98284f3affc643e9714470@canb.auug.org.au
    Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
    Signed-off-by: H. Peter Anvin <hpa@zytor.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 3a9a33e0157ecf06f70ef6791ce1dd30dac21b75
Author: H. Peter Anvin <hpa@zytor.com>
Date:   Wed May 23 14:02:34 2012 -0700

    x86-32, relocs: Whitelist more symbols for ld bug workaround
    
    commit fd952815307f0f272bf49fd364a7fd2f9992bc42 upstream.
    
    As noted in checkin:
    
    a3e854d95 x86, relocs: Workaround for binutils 2.22.52.0.1 section bug
    
    ld version 2.22.52.0.[12] can incorrectly promote relative symbols to
    absolute, if the output section they appear in is otherwise empty.
    
    Since checkin:
    
    6520fe55 x86, realmode: 16-bit real-mode code support for relocs tool
    
    we actually check for this and error out rather than silently creating
    a kernel which will malfunction if relocated.
    
    Ingo found a configuration in which __start_builtin_fw triggered the
    warning.
    
    Go through the linker script sources and look for more symbols that
    could plausibly get bogusly promoted to absolute, and add them to the
    whitelist.
    
    In general, if the following error triggers:
    
    	Invalid absolute R_386_32 relocation: <symbol>
    
    ... then we should verify that <symbol> is really meant to be
    relocated, and add it and any related symbols manually to the S_REL
    regexp.
    
    Please note that 6520fe55 does not introduce the error, only the check
    for the error -- without 6520fe55 this version of ld will simply
    produce a corrupt kernel if CONFIG_RELOCATABLE is set on x86-32.
    
    Reported-by: Ingo Molnar <mingo@kernel.org>
    Signed-off-by: H. Peter Anvin <hpa@zytor.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 50a08146f2d2447d3e5e12b8458f096394891d70
Author: Jarkko Sakkinen <jarkko.sakkinen@intel.com>
Date:   Mon May 21 20:51:24 2012 +0300

    x86, relocs: Build clean fix
    
    commit b2d668da9307c4c163dd603d2bb3cadb10f9fd37 upstream.
    
    relocs was not cleaned up when "make clean" is issued. This
    patch fixes the issue.
    
    Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@intel.com>
    Link: http://lkml.kernel.org/r/1337622684-6834-1-git-send-email-jarkko.sakkinen@intel.com
    Signed-off-by: H. Peter Anvin <hpa@zytor.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit e27a45a6869d586cc2558373f9cd2ffdc005497c
Author: H. Peter Anvin <hpa@linux.intel.com>
Date:   Fri May 18 09:52:01 2012 -0700

    x86, relocs: When printing an error, say relative or absolute
    
    commit 24ab82bd9bf18f3efc69a131d73577940941e1b7 upstream.
    
    When the relocs tool throws an error, let the error message say if it
    is an absolute or relative symbol.  This should make it a lot more
    clear what action the programmer needs to take and should help us find
    the reason if additional symbol bugs show up.
    
    Signed-off-by: H. Peter Anvin <hpa@zytor.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit b3329716c886dca2b7cc105b7dc833c1525ba24c
Author: H. Peter Anvin <hpa@linux.intel.com>
Date:   Fri May 18 00:24:09 2012 -0700

    x86, relocs: Workaround for binutils 2.22.52.0.1 section bug
    
    commit a3e854d95a76862cd37937e0b0438f540536771a upstream.
    
    GNU ld 2.22.52.0.1 has a bug that it blindly changes symbols from
    section-relative to absolute if they are in a section of zero length.
    This turns the symbols __init_begin and __init_end into absolute
    symbols.  Let the relocs program know that those should be treated as
    relative symbols.
    
    Reported-by: Ingo Molnar <mingo@kernel.org>
    Signed-off-by: H. Peter Anvin <hpa@zytor.com>
    Cc: H.J. Lu <hjl.tools@gmail.com>
    Cc: Jarkko Sakkinen <jarkko.sakkinen@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit fb24d9d9c13c7c6d0e1f4ae5301288be0e38fb8e
Author: H. Peter Anvin <hpa@linux.intel.com>
Date:   Tue May 8 21:22:24 2012 +0300

    x86, realmode: 16-bit real-mode code support for relocs tool
    
    commit 6520fe5564acf07ade7b18a1272db1184835c487 upstream.
    
    A new option is added to the relocs tool called '--realmode'.
    This option causes the generation of 16-bit segment relocations
    and 32-bit linear relocations for the real-mode code. When
    the real-mode code is moved to the low-memory during kernel
    initialization, these relocation entries can be used to
    relocate the code properly.
    
    In the assembly code 16-bit segment relocations must be relative
    to the 'real_mode_seg' absolute symbol. Linear relocations must be
    relative to a symbol prefixed with 'pa_'.
    
    16-bit segment relocation is used to load cs:ip in 16-bit code.
    Linear relocations are used in the 32-bit code for relocatable
    data references. They are declared in the linker script of the
    real-mode code.
    
    The relocs tool is moved to arch/x86/tools/relocs.c, and added new
    target archscripts that can be used to build scripts needed building
    an architecture.  be compiled before building the arch/x86 tree.
    
    [ hpa: accelerating this because it detects invalid absolute
      relocations, a serious bug in binutils 2.22.52.0.x which currently
      produces bad kernels. ]
    
    [ jsakkine: applied against 3.3.7 ]
    
    Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
    Link: http://lkml.kernel.org/r/1336501366-28617-2-git-send-email-jarkko.sakkinen@intel.com
    Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@intel.com>
    Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
    Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@iki.fi>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit e2947ba083b522948032aa60b575ff10fd825586
Author: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Date:   Wed Mar 21 09:50:36 2012 -0300

    media: uvcvideo: Fix ENUMINPUT handling
    
    commit 31c5f0c5e25ed71eeced170f113bb590f2f1f6f3 upstream.
    
    Properly validate the user-supplied index against the number of inputs.
    The code used the pin local variable instead of the index by mistake.
    
    Reported-by: Jozef Vesely <vesely@gjh.sk>
    Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
    Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 9fc6d76cb43ea34715daa04841dc29f37c519fac
Author: Michael Krufky <mkrufky@linuxtv.org>
Date:   Thu Mar 22 13:55:05 2012 -0300

    smsusb: add autodetection support for USB ID 2040:c0a0
    
    commit 4d1b58b84472d1d300a66e1c5fd765b21e74ba15 upstream.
    
    Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
    Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit a4e821f4c08856af4e199d8362d548845857f730
Author: Dave Airlie <airlied@redhat.com>
Date:   Fri May 18 15:31:12 2012 +0100

    nouveau: nouveau_set_bo_placement takes TTM flags
    
    commit c284815debba2f14ee2fd07b1b4cc972ab116110 upstream.
    
    This seems to be wrong to me, spotted while thinking about dma-buf.
    
    Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 16f6501e8bd7d8f07cf76ef2bf0a188a97892c09
Author: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date:   Mon May 21 16:54:10 2012 +0100

    xen: do not map the same GSI twice in PVHVM guests.
    
    commit 68c2c39a76b094e9b2773e5846424ea674bf2c46 upstream.
    
    PV on HVM guests map GSIs into event channels. At restore time the
    event channels are resumed by restore_pirqs.
    
    Device drivers might try to register the same GSI again through ACPI at
    restore time, but the GSI has already been mapped and bound by
    restore_pirqs. This patch detects these situations and avoids
     mapping the same GSI multiple times.
    
    Without this patch we get:
    (XEN) irq.c:2235: dom4: pirq 23 or emuirq 28 already mapped
    and waste a pirq.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 3970d41e9fdd12f6a450eb2d4a44e8172d773285
Author: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
Date:   Fri May 11 15:29:50 2012 -0700

    spi/spi-fsl-spi: reference correct pdata in fsl_spi_cs_control
    
    commit 067aa4815a9bc12a569d8a06afef50ba5773afbf upstream.
    
    Commit 178db7d3, "spi: Fix device unregistration when unregistering
    the bus master", changed spi device initialization of dev.parent pointer
    to be the master's device pointer instead of his parent.
    
    This introduced a bug in spi-fsl-spi, since its usage of spi device
    pointer was not updated accordingly. This was later fixed by commit
    5039a86, "spi/mpc83xx: fix NULL pdata dereference bug", but it missed
    another spot on fsl_spi_cs_control function where we also need to update
    usage of spi device pointer. This change address that.
    
    Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
    Acked-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 5edee64eb24b5eb8908324e3305ae46bbc7f1191
Author: Thomas Gleixner <tglx@linutronix.de>
Date:   Thu May 3 12:22:06 2012 +0200

    gpio: mpc8xxx: Prevent NULL pointer deref in demux handler
    
    commit d6de85e85edcc38c9edcde45a0a568818fcddc13 upstream.
    
    commit cfadd838(powerpc/8xxx: Fix interrupt handling in MPC8xxx GPIO
    driver) added an unconditional call of chip->irq_eoi() to the demux
    handler.
    
    This leads to a NULL pointer derefernce on MPC512x platforms which use
    this driver as well.
    
    Make it conditional.
    
    Reported-by: Thomas Wucher <thwucher@linutronix.de>
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Cc: Felix Radensky <felix@embedded-sol.com>
    Cc: Kumar Gala <galak@kernel.crashing.org>
    Cc: Grant Likely <grant.likely@secretlab.ca>
    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 4a460c43e3fa262f336957ab3eb3476b437c4791
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Sun May 13 22:29:25 2012 +0200

    drm/i915: don't clobber the pipe param in sanitize_modesetting
    
    commit a9dcf84b14ef4e9a609910367576995e6f32f3dc upstream.
    
    ... we need it later on in the function to clean up pipe <-> plane
    associations. This regression has been introduced in
    
    commit f47166d2b0001fcb752b40c5a2d4db986dfbea68
    Author: Chris Wilson <chris@chris-wilson.co.uk>
    Date:   Thu Mar 22 15:00:50 2012 +0000
    
        drm/i915: Sanitize BIOS debugging bits from PIPECONF
    
    Spotted by staring at debug output of an (as it turns out) totally
    unrelated bug.
    
    v2: I've totally failed to do the s/pipe/i/ correctly, spotted by
    Chris Wilson.
    
    Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
    Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
    Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit d0156f2c9fde7b8bc0698fe45ab432d14f9bfe69
Author: Ben Widawsky <ben@bwidawsk.net>
Date:   Sat Apr 14 18:41:32 2012 -0700

    drm/i915: [GEN7] Use HW scheduler for fixed function shaders
    
    commit a1e969e0332de7a430e62822cee8f2ec8d83cd7c upstream.
    
    This originally started as a patch from Bernard as a way of simply
    setting the VS scheduler. After submitting the RFC patch, we decided to
    also modify the DS scheduler. To be most explicit, I've made the patch
    explicitly set all scheduler modes, and included the defines for other
    modes (in case someone feels frisky later).
    
    The rest of the story gets a bit weird. The first version of the patch
    showed an almost unbelievable performance improvement. Since rebasing my
    branch it appears the performance improvement has gone, unfortunately.
    But setting these bits seem to be the right thing to do given that the
    docs describe corruption that can occur with the default settings.
    
    In summary, I am seeing no more perf improvements (or regressions) in my
    limited testing, but we believe this should be set to prevent rendering
    corruption, therefore cc stable.
    
    v1: Clear bit 4 also (Ken + Eugeni)
    Do a full clear + set of the bits we want (Me).
    
    Cc: Bernard Kilarski <bernard.r.kilarski@intel.com>
    Reviewed-by (RFC): Kenneth Graunke <kenneth@whitecape.org>
    Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
    Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
    Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit dde97656524d4381c6b1532ba7ddc80b06a3a9ef
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed May 9 21:45:43 2012 +0100

    drm/i915: Avoid a double-read of PCH_IIR during interrupt handling
    
    commit 9adab8b5a7fde248504f484e197589f3e3c922e2 upstream.
    
    Currently the code re-reads PCH_IIR during the hotplug interrupt
    processing. Not only is this a wasted read, but introduces a potential
    for handling a spurious interrupt as we then may not clear all the
    interrupts processed (since the re-read IIR may contains more interrupts
    asserted than we clear using the result of the original read).
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
    Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit c6fd0e9bb4b9d4189eb93609081e3281e3d985d6
Author: Larry Finger <Larry.Finger@lwfinger.net>
Date:   Sun May 6 16:01:05 2012 -0500

    b43legacy: Fix error due to MMIO access with SSB unpowered
    
    commit 8f4b20388fa77226a3605627a33a23f90d559e50 upstream.
    
    There is a dummy read of a PCI MMIO register that occurs before the SSB bus
    has been powered, which is an error. This bug has not been seen earlier,
    but was apparently exposed when udev was updated to version 182.
    
    Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
    Signed-off-by: John W. Linville <linville@tuxdriver.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 1b647277e17c5242963410d273ab88c30b6c8d3b
Author: Alan Cox <alan@linux.intel.com>
Date:   Mon May 21 15:27:44 2012 +0100

    gma500: Fix Poulsbo suspend/resume crash on devices with SDVO ports
    
    commit 7beff62ee39d3ccf088bb77f61a63037f714d235 upstream.
    
    Reported-by: Guillaume Clément <guillaume@baobob.org>
    Signed-off-by: Alan Cox <alan@linux.intel.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 32e177ae69d32118eba963f6d4eb041db88b7653
Author: Andiry Xu <andiry.xu@gmail.com>
Date:   Sat May 5 00:50:10 2012 +0800

    usbcore: enable USB2 LPM if port suspend fails
    
    commit c3e751e4f4754793bb52bd5ae30e9cc027edbb12 upstream.
    
    USB2 LPM is disabled when device begin to suspend and enabled after device
    is resumed. That's because USB spec does not define the transition from
    U1/U2 state to U3 state.
    
    If usb_port_suspend() fails, usb_port_resume() is never called, and USB2 LPM
    is disabled in this situation. Enable USB2 LPM if port suspend fails.
    
    This patch should be backported to kernels as old as 3.2, that contain
    the commit 65580b4321eb36f16ae8b5987bfa1bb948fc5112 "xHCI: set USB2
    hardware LPM".
    
    Signed-off-by: Andiry Xu <andiry.xu@gmail.com>
    Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 8ccb02914be80e1ca08fe978e8a02e472f9d143c
Author: Oliver Neukum <oneukum@suse.de>
Date:   Thu May 10 10:19:21 2012 +0200

    USB: fix resource leak in xhci power loss path
    
    commit f8a9e72d125f4e00ec529ba67b674321a1f3bf31 upstream.
    
    Some more data structures must be freed and counters
    reset if an XHCI controller has lost power. The failure
    to do so renders some chips inoperative after a certain number
    of S4 cycles.
    
    This patch should be backported to kernels as old as 3.2,
    that contain the commits c29eea621900f18287d50519f72cb9113746d75a
    "xhci: Implement HS/FS/LS bandwidth checking." and
    commit 839c817ce67178ca3c7c7ad534c571bba1e69ebe
    "xhci: Implement HS/FS/LS bandwidth checking."
    
    Signed-off-by: Oliver Neukum <oneukum@suse.de>
    Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 904590abe2a30abe7fc3345fde087a91c21db2e1
Author: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Date:   Tue May 8 09:22:49 2012 -0700

    xhci: Add new short TX quirk for Fresco Logic host.
    
    commit 1530bbc6272d9da1e39ef8e06190d42c13a02733 upstream.
    
    Sergio reported that when he recorded audio from a USB headset mic
    plugged into the USB 3.0 port on his ASUS N53SV-DH72, the audio sounded
    "robotic".  When plugged into the USB 2.0 port under EHCI on the same
    laptop, the audio sounded fine.  The device is:
    
    Bus 002 Device 004: ID 046d:0a0c Logitech, Inc. Clear Chat Comfort USB Headset
    
    The problem was tracked down to the Fresco Logic xHCI host controller
    not correctly reporting short transfers on isochronous IN endpoints.
    The driver would submit a 96 byte transfer, the device would only send
    88 or 90 bytes, and the xHCI host would report the transfer had a
    "successful" completion code, with an untransferred buffer length of 8
    or 6 bytes.
    
    The successful completion code and non-zero untransferred length is a
    contradiction.  The xHCI host is supposed to only mark a transfer as
    successful if all the bytes are transferred.  Otherwise, the transfer
    should be marked with a short packet completion code.  Without the EHCI
    bus trace, we wouldn't know whether the xHCI driver should trust the
    completion code or the untransferred length.  With it, we know to trust
    the untransferred length.
    
    Add a new xHCI quirk for the Fresco Logic host controller.  If a
    transfer is reported as successful, but the untransferred length is
    non-zero, print a warning.  For the Fresco Logic host, change the
    completion code to COMP_SHORT_TX and process the transfer like a short
    transfer.
    
    This should be backported to stable kernels that contain the commit
    f5182b4155b9d686c5540a6822486400e34ddd98 "xhci: Disable MSI for some
    Fresco Logic hosts."  That commit was marked for stable kernels as old
    as 2.6.36.
    
    Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
    Reported-by: Sergio Correia <lists@uece.net>
    Tested-by: Sergio Correia <lists@uece.net>
    Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 66c4d8a0d9b4732d5792b658a6bd879d94c3da46
Author: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Date:   Tue May 8 07:09:26 2012 -0700

    xhci: Reset reserved command ring TRBs on cleanup.
    
    commit 33b2831ac870d50cc8e01c317b07fb1e69c13fe1 upstream.
    
    When the xHCI driver needs to clean up memory (perhaps due to a failed
    register restore on resume from S3 or resume from S4), it needs to reset
    the number of reserved TRBs on the command ring to zero.  Otherwise,
    several resume cycles (about 30) with a UAS device attached will
    continually increment the number of reserved TRBs, until all command
    submissions fail because there isn't enough room on the command ring.
    
    This patch should be backported to kernels as old as 2.6.32,
    that contain the commit 913a8a344ffcaf0b4a586d6662a2c66a7106557d
    "USB: xhci: Change how xHCI commands are handled."
    
    Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 540304dabfad54a3b9171cc8c310831a8c273535
Author: Hans de Goede <hdegoede@redhat.com>
Date:   Mon Apr 23 15:06:09 2012 +0200

    usb-xhci: Handle COMP_TX_ERR for isoc tds
    
    commit 9c745995ae5c4ff787f34a359de908facc11ee00 upstream.
    
    While testing unplugging an UVC HD webcam with usb-redirection (so through
    usbdevfs), my userspace usb-redir code was getting a value of -1 in
    iso_frame_desc[n].status, which according to Documentation/usb/error-codes.txt
    is not a valid value.
    
    The source of this -1 is the default case in xhci-ring.c:process_isoc_td()
    adding a kprintf there showed the value of trb_comp_code to be COMP_TX_ERR
    in this case, so this patch adds handling for that completion code to
    process_isoc_td().
    
    This was observed and tested with the following xhci controller:
    1033:0194 NEC Corporation uPD720200 USB 3.0 Host Controller (rev 04)
    
    Note: I also wonder if setting frame->status to -1 (-EPERM) is the best we can
    do, but since I cannot come up with anything better I've left that as is.
    
    This patch should be backported to kernels as old as 2.6.36, which contain the
    commit 04e51901dd44f40a5a385ced897f6bca87d5f40a "USB: xHCI: Isochronous
    transfer implementation".
    
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 829cd2d3f62dd84a14c4d80cbb24f46bf5e591e7
Author: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Date:   Mon Apr 16 10:56:47 2012 -0700

    xhci: Avoid dead ports when CONFIG_USB_XHCI_HCD=n
    
    commit 51c9e6c7732b67769c0a514d31f505e49fa82dd4 upstream.
    
    If the user chooses to say "no" to CONFIG_USB_XHCI_HCD on a system
    with an Intel Panther Point chipset, the PCI quirks code or the EHCI
    driver will switch the ports over to the xHCI host, but the xHCI driver
    will never load.  The ports will be powered off and seem "dead" to the
    user.
    
    Fix this by only switching the ports over if CONFIG_USB_XHCI_HCD is
    either compiled in, or compiled as a module.
    
    This patch should be backported to stable kernels as old as 3.0,
    that contain commit 69e848c2090aebba5698a1620604c7dccb448684
    "Intel xhci: Support EHCI/xHCI port switching."
    
    Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
    Reported-by: Eric Anholt <eric.anholt@intel.com>
    Reported-by: David Bein <d.bein@f5.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit ea650a02e573f8588b4b35f66219326e7e2c81a6
Author: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Date:   Thu Feb 9 15:55:13 2012 -0800

    xhci: Add Lynx Point to list of Intel switchable hosts.
    
    commit 1c12443ab8eba71a658fae4572147e56d1f84f66 upstream.
    
    The upcoming Intel Lynx Point chipset includes an xHCI host controller
    that can have ports switched from the EHCI host controller, just like
    the Intel Panther Point xHCI host.  This time, ports from both EHCI
    hosts can be switched to the xHCI host controller.  The PCI config
    registers to do the port switching are in the exact same place in the
    xHCI PCI configuration registers, with the same semantics.
    
    Hooray for shipping patches for next-gen hardware before the current gen
    hardware is even available for purchase!
    
    This patch should be backported to stable kernels as old as 3.0,
    that contain commit 69e848c2090aebba5698a1620604c7dccb448684
    "Intel xhci: Support EHCI/xHCI port switching."
    
    Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 4da57eb3268c888778bdc2689a71cde1dadd9ca6
Author: Steffen Müller <steffen.mueller@radio-frei.de>
Date:   Mon Apr 30 13:05:34 2012 +0200

    usb: add USB_QUIRK_RESET_RESUME for M-Audio 88es
    
    commit 166cb70e97bd83d7ae9bbec6ae59a178fd9bb823 upstream.
    
    Tested-by: Steffen Müller <steffen.mueller@radio-frei.de>
    Signed-off-by: Steffen Müller <steffen.mueller@radio-frei.de>
    Signed-off-by: Stefan Seyfried <seife+kernel@b1-systems.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 6a7ecec6315dfdeac08d163146b0260735e95f39
Author: Peter Chen <peter.chen@freescale.com>
Date:   Sun Apr 1 15:17:16 2012 +0800

    usb: gadget: fsl_udc_core: dTD's next dtd pointer need to be updated once written
    
    commit 4d0947dec4db1224354e2f6f00ae22ce38e62a43 upstream.
    
    dTD's next dtd pointer need to be updated once CPU writes it, or this
    request may not be handled by controller, then host will get NAK from
    device forever.
    
    This problem occurs when there is a request is handling, we need to add
    a new request to dTD list, if this new request is added before the current
    one is finished, the new request is intended to added as next dtd pointer
    at current dTD, but without wmb(), the dTD's next dtd pointer may not be
    updated when the controller reads it. In that case, the controller will
    still get Terminate Bit is 1 at dTD's next dtd pointer, that means there is
    no next request, then this new request is missed by controller.
    
    Signed-off-by: Peter Chen <peter.chen@freescale.com>
    Acked-by: Li Yang <leoli@freescale.com>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 4c03c1245df37a3a64ae6aeed2bdec8780e879a6
Author: Darren Hart <dvhart@linux.intel.com>
Date:   Fri May 11 13:56:57 2012 -0700

    USB: serial: ti_usb_3410_5052: Add support for the FRI2 serial console
    
    commit 975dc33b82cb887d75a29b1e3835c8eb063a8e99 upstream.
    
    The Kontron M2M development board, also known as the Fish River Island II,
    has an optional daughter card providing access to the PCH_UART (EG20T) via
    a ti_usb_3410_5052 uart to usb chip.
    
    http://us.kontron.com/products/systems+and+platforms/m2m/m2m+smart+services+developer+kit.html
    
    Signed-off-by: Darren Hart <dvhart@linux.intel.com>
    CC: Al Borchers <alborchers@steinerpoint.com>
    CC: Peter Berger <pberger@brimson.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit a8467ea0e79ca99f4114e7c64ad6b1adaf2ca7ce
Author: Huajun Li <huajun.li.lee@gmail.com>
Date:   Fri May 18 20:12:51 2012 +0800

    USB: Remove races in devio.c
    
    commit 4e09dcf20f7b5358615514c2ec8584b248ab8874 upstream.
    
    There exist races in devio.c, below is one case,
    and there are similar races in destroy_async()
    and proc_unlinkurb().  Remove these races.
    
     cancel_bulk_urbs()        async_completed()
    -------------------                -----------------------
     spin_unlock(&ps->lock);
    
                               list_move_tail(&as->asynclist,
    		                    &ps->async_completed);
    
                               wake_up(&ps->wait);
    
                               Lead to free_async() be triggered,
                               then urb and 'as' will be freed.
    
     usb_unlink_urb(as->urb);
     ===> refer to the freed 'as'
    
    Signed-off-by: Huajun Li <huajun.li.lee@gmail.com>
    Cc: Alan Stern <stern@rowland.harvard.edu>
    Cc: Oncaphillis <oncaphillis@snafu.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit fdda49b01c157b6723137040e2033fe92188903c
Author: Nicolas Ferre <nicolas.ferre@atmel.com>
Date:   Wed May 9 10:48:54 2012 +0200

    USB: ohci-at91: add a reset function to fix race condition
    
    commit 07e4e556eff4938eb2edf2591de3aa7d7fb82b52 upstream.
    
    A possible race condition appears because we are not initializing
    the ohci->regs before calling usb_hcd_request_irqs().
    We move the call to ohci_init() in hcd->driver->reset() instead of
    hcd->driver->start() to fix this.
    This was experienced when we share the same IRQ line between OHCI and EHCI
    controllers.
    
    Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
    Tested-by: Christian Eggers <christian.eggers@kathrein.de>
    Acked-by: Alan Stern <stern@rowland.harvard.edu>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit e7e5a2686457f5c759002a3406cbc7354cf2412e
Author: Paul Zimmerman <Paul.Zimmerman@synopsys.com>
Date:   Mon Apr 16 14:19:07 2012 -0700

    usb: usbtest: two super speed fixes for usbtest
    
    commit 6a23ccd216b6a8ba2c67a9f9d8969b4431ad2920 upstream.
    
    bMaxPacketSize0 field for super speed is a power of 2, not a count.
    The size itself is always 512.
    
    Max packet size for a super speed bulk endpoint is 1024, so
    allocate the urb size in halt_simple() accordingly.
    
    Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
    Acked-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit d9a6848be5cecc306fe5848047f1211fc11efeea
Author: Bernie Thompson <bernie@plugable.com>
Date:   Thu Mar 1 17:35:48 2012 -0800

    udlfb: fix hcd_buffer_free panic on unplug/replug
    
    commit 8d21547d3c9c3bc653261f26d554cfabc4a083de upstream.
    
    Fix race conditions with unplug/replug behavior, in particular
    take care not to hold up USB probe/disconnect for long-running
    framebuffer operations and rely on usb to handle teardown.
    
    Fix for kernel panic reported with new F17 multiseat support.
    
    Reported-by: Kay Sievers <kay.sievers@vrfy.org>
    Signed-off-by: Bernie Thompson <bernie@plugable.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 7b5853a08620d9565b1f03b36f1bc1c8e4768938
Author: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Date:   Thu Jan 19 14:01:04 2012 -0600

    SCSI: hpsa: Fix problem with MSA2xxx devices
    
    commit 9bc3711cbb67ac620bf09b4a147cbab45b2c36c0 upstream.
    
    Upgraded firmware on Smart Array P7xx (and some others) made them show up as
    SCSI revision 5 devices and this caused the driver to fail to map MSA2xxx
    logical drives to the correct bus/target/lun.  A symptom of this would be that
    the target ID of the logical drives as presented by the external storage array
    is ignored, and all such logical drives are assigned to target zero,
    differentiated only by LUN.  Some multipath software reportedly does not deal
    well with this behavior, failing to recognize different paths to the same
    device as such.
    
    Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
    Signed-off-by: Scott Teel <scott.teel@hp.com>
    Signed-off-by: James Bottomley <JBottomley@Parallels.com>
    Cc: Jonathan Nieder <jrnieder@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit bde33cae2b281f28d2e15337b9f046ccbdf6c61e
Author: Rajkumar Kasirajan <rajkumar.kasirajan@stericsson.com>
Date:   Thu May 17 17:03:24 2012 -0700

    drivers/rtc/rtc-pl031.c: configure correct wday for 2000-01-01
    
    commit c0a5f4a05af588a0f9951f8d24e2564b09501918 upstream.
    
    The reset date of the ST Micro version of PL031 is 2000-01-01.  The
    correct weekday for 2000-01-01 is saturday, but pl031 is initialized to
    sunday.  This may lead to alarm malfunction, so configure the correct
    wday if RTC_DR indicates reset.
    
    Signed-off-by: Rajkumar Kasirajan <rajkumar.kasirajan@stericsson.com>
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
    Cc: Mattias Wallin <mattias.wallin@stericsson.com>
    Cc: Alessandro Zummo <a.zummo@towertech.it>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 18b5662507ee7c2187bac6ff4cfc712cf5880309
Author: Matthias Fend <Matthias.Fend@wolfvision.net>
Date:   Mon May 7 14:37:30 2012 +0200

    USB: ffs-test: fix length argument of out function call
    
    commit eb9c5836384cd2a276254df6254ed71117983626 upstream.
    
    The out functions should only handle actual available data instead of the complete buffer.
    Otherwise for example the ep0_consume function will report ghost events since it tries to decode
    the complete buffer - which may contain partly invalid data.
    
    Signed-off-by: Matthias Fend <matthias.fend@wolfvision.net>
    Acked-by: Michal Nazarewicz <mina86@mina86.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 4f75ce2d7ce4640be427d60f6b8f70461dc6ba07
Author: Alan Stern <stern@rowland.harvard.edu>
Date:   Tue May 8 15:15:25 2012 -0400

    usb-storage: unusual_devs entry for Yarvik PMP400 MP4 player
    
    commit df767b71e5816692134d59c0c17e0f77cd73333d upstream.
    
    This patch (as1553) adds an unusual_dev entrie for the Yarvik PMP400
    MP4 music player.
    
    Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
    Reported-by: Jesse Feddema <jdfeddema@gmail.com>
    Tested-by: Jesse Feddema <jdfeddema@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 4db8021767b5d557744cc854440a820369e51c4b
Author: Éric Piel <piel@delmic.com>
Date:   Mon May 7 12:37:54 2012 +0200

    USB: ftdi-sio: add support for Physik Instrumente E-861
    
    commit b69cc672052540e8efb1368420f10d7d4d8b8a3d upstream.
    
    This adds VID/PID for the PI E-861. Without it, I had to do:
    modprobe -q ftdi-sio product=0x1008 vendor=0x1a72
    
    http://www.physikinstrumente.com/en/products/prdetail.php?sortnr=900610
    
    Signed-off-by: Éric Piel <piel@delmic.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 084a66bbb3dad4431692e4e0ebc673c93b23c340
Author: Alan Cox <alan@linux.intel.com>
Date:   Mon May 14 14:51:22 2012 +0100

    tty: Allow uart_register/unregister/register
    
    commit 1e66cded334e6cea596c72f6f650eec351b1e959 upstream.
    
    This is legitimate but because we don't clear the drv->state pointer in the
    unregister code causes a bogus BUG().
    
    Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=42880
    Signed-off-by: Alan Cox <alan@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 98e2a3c2af332867f0bb979c32470b9c4ca19d42
Author: Arnaud Patard <apatard@hupstream.com>
Date:   Wed Apr 25 12:17:24 2012 +0200

    8250_pci: fix pch uart matching
    
    commit aaa10eb1d0034eccc096f583fe308f0921617598 upstream.
    
    The rules used to make 8250_pci "ignore" the PCH uarts are lacking pci subids
    entries, preventing it to match and thus is breaking serial port support for
    theses systems.
    
    This has been tested on a nanoETXexpress-TT, which has a specifici uart clock.
    
    Tested-by: Erwan Velu <Erwan.Velu@zodiacaerospace.com>
    [stable@: please apply to 3.0-stable, 3.2-stable and 3.3-stable]
    Signed-off-by: Arnaud Patard <apatard@hupstream.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 8e517a979cbbcf034ad019313d4e057c6f4c7e3b
Author: Lothar Waßmann <LW@KARO-electronics.de>
Date:   Thu May 3 11:37:12 2012 +0200

    Add missing call to uart_update_timeout()
    
    commit 8b979f7c6bf13a57e7b6002f1175312a44773960 upstream.
    
    This patch fixes a problem reported here:
    http://article.gmane.org/gmane.linux.ports.arm.kernel/155242/match=auart
    
    Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 5404dd3464ae620fbcb9977a0690670f91544be1
Author: Shaohua Li <shli@kernel.org>
Date:   Mon May 21 09:26:59 2012 +1000

    md: using GFP_NOIO to allocate bio for flush request
    
    commit b5e1b8cee7ad58a15d2fa79bcd7946acb592602d upstream.
    
    A flush request is usually issued in transaction commit code path, so
    using GFP_KERNEL to allocate memory for flush request bio falls into
    the classic deadlock issue.
    
    This is suitable for any -stable kernel to which it applies as it
    avoids a possible deadlock.
    
    Signed-off-by: Shaohua Li <shli@fusionio.com>
    Signed-off-by: NeilBrown <neilb@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 29fdad4cf1cd116ff029456bf85d62d032c2c3e2
Author: Mel Gorman <mgorman@suse.de>
Date:   Wed May 23 12:48:13 2012 +0100

    mm: mempolicy: Let vma_merge and vma_split handle vma->vm_policy linkages
    
    commit 05f144a0d5c2207a0349348127f996e104ad7404 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
    
    This implied a reference counting bug and the problem happened during
    mbind().
    
    mbind() applies a new memory policy to a range and uses mbind_range() to
    merge existing VMAs or split them as necessary.  In the event of splits,
    mpol_dup() will allocate a new struct mempolicy and maintain existing
    reference counts whose rules are documented in
    Documentation/vm/numa_memory_policy.txt .
    
    The problem occurs with shared memory policies.  The vm_op->set_policy
    increments the reference count if necessary and split_vma() and
    vma_merge() have already handled the existing reference counts.
    However, policy_vma() screws it up by replacing an existing
    vma->vm_policy with one that potentially has the wrong reference count
    leading to a premature free.  This patch removes the damage caused by
    policy_vma().
    
    With this patch applied Dave's trinity tool runs an mbind test for 5
    minutes without error.  /proc/slabinfo reported that there are no
    numa_policy or shared_policy_node objects allocated after the test
    completed and the shared memory region was deleted.
    
    Signed-off-by: Mel Gorman <mgorman@suse.de>
    Cc: Dave Jones <davej@redhat.com>
    Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
    Cc: Stephen Wilson <wilsons@start.ca>
    Cc: Christoph Lameter <cl@linux.com>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit f93a3288552cceebe6b44f4f6690ba2fbc310e91
Author: Tejun Heo <tj@kernel.org>
Date:   Mon May 14 15:04:50 2012 -0700

    workqueue: skip nr_running sanity check in worker_enter_idle() if trustee is active
    
    commit 544ecf310f0e7f51fa057ac2a295fc1b3b35a9d3 upstream.
    
    worker_enter_idle() has WARN_ON_ONCE() which triggers if nr_running
    isn't zero when every worker is idle.  This can trigger spuriously
    while a cpu is going down due to the way trustee sets %WORKER_ROGUE
    and zaps nr_running.
    
    It first sets %WORKER_ROGUE on all workers without updating
    nr_running, releases gcwq->lock, schedules, regrabs gcwq->lock and
    then zaps nr_running.  If the last running worker enters idle
    inbetween, it would see stale nr_running which hasn't been zapped yet
    and trigger the WARN_ON_ONCE().
    
    Fix it by performing the sanity check iff the trustee is idle.
    
    Signed-off-by: Tejun Heo <tj@kernel.org>
    Reported-by: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit d560ed31a515b0003d27bdbf21298dd81ee9937d
Author: Bjørn Mork <bjorn@mork.no>
Date:   Wed May 9 13:53:21 2012 +0200

    USB: cdc-wdm: poll must return POLLHUP if device is gone
    
    commit 616b6937e348ef2b4c6ea5fef2cd3c441145efb0 upstream.
    
    Else the poll will be restarted indefinitely in a tight loop,
    preventing final device cleanup.
    
    Cc: Oliver Neukum <oliver@neukum.org>
    Signed-off-by: Bjørn Mork <bjorn@mork.no>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 36ad7025bc4b5883a20ab106473a754cc93c6353
Author: Oliver Neukum <oliver@neukum.org>
Date:   Fri Apr 27 14:23:54 2012 +0200

    USB: cdc-wdm: sanitize error returns
    
    commit 24a85bae5da2b43fed423859c09c5a81ab359473 upstream.
    
    wdm_flush() returns unsanitized USB error codes.
    They must be cleaned up to before being anded to user space
    
    Signed-off-by: Oliver Neukum <oneukum@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 9d346718bee344c97e4214021c0dd42078195622
Author: Shaohua Li <shli@kernel.org>
Date:   Wed Mar 21 16:34:17 2012 -0700

    swap: don't do discard if no discard option added
    
    commit 052b1987faca3606109d88d96bce124851f7c4c2 upstream.
    
    When swapon() was not passed the SWAP_FLAG_DISCARD option, sys_swapon()
    will still perform a discard operation.  This can cause problems if
    discard is slow or buggy.
    
    Reverse the order of the check so that a discard operation is performed
    only if the sys_swapon() caller is attempting to enable discard.
    
    Signed-off-by: Shaohua Li <shli@fusionio.com>
    Reported-by: Holger Kiehl <Holger.Kiehl@dwd.de>
    Tested-by: Holger Kiehl <Holger.Kiehl@dwd.de>
    Cc: Hugh Dickins <hughd@google.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Cc: William Dauchy <wdauchy@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit a00d1280903d1372fc057ffb86899cfc0997f4fa
Author: Kees Cook <keescook@chromium.org>
Date:   Wed Apr 18 23:16:45 2012 -0700

    docs: update HOWTO for 2.6.x -> 3.x versioning
    
    commit 591bfc6bf9e5e25e464fd4c87d64afd5135667c4 upstream.
    
    The HOWTO document needed updating for the new kernel versioning. The
    git URI for -next was updated as well.
    
    Signed-off-by: Kees Cook <keescook@chromium.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit db29d1cb1ccc533308f6987359e0209e86ed7530
Author: Richard Weinberger <richard@nod.at>
Date:   Sat Apr 14 17:29:30 2012 +0200

    um: Implement a custom pte_same() function
    
    commit f15b9000eb1d09bbaa4b0a6b2089d7e1f64e84b3 upstream.
    
    UML uses the _PAGE_NEWPAGE flag to mark pages which are not jet
    installed on the host side using mmap().
    pte_same() has to ignore this flag, otherwise unuse_pte_range()
    is unable to unuse the page because two identical
    page tables entries with different _PAGE_NEWPAGE flags would not
    match and swapoff() would never return.
    
    Analyzed-by: Hugh Dickins <hughd@google.com>
    Signed-off-by: Richard Weinberger <richard@nod.at>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit ec69e1aa3d7b846b578a5873918f150f37410a77
Author: Richard Weinberger <richard@nod.at>
Date:   Sat Apr 14 17:46:01 2012 +0200

    um: Fix __swp_type()
    
    commit 2b76ebaa728f8a3967c52aa189261c72fe56a6f1 upstream.
    
    The current __swp_type() function uses a too small bitshift.
    Using more than one swap files causes bad pages because
    the type bits clash with other page flags.
    
    Analyzed-by: Hugh Dickins <hughd@google.com>
    Signed-off-by: Richard Weinberger <richard@nod.at>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 724b145e78108c88e7e07b25658f5350219569a5
Author: Jonathan Nieder <jrnieder@gmail.com>
Date:   Fri May 11 16:17:16 2012 +0200

    HID: logitech: read all 32 bits of report type bitfield
    
    commit 44d27f7dfedd9aadc082cda31462f6600f56e4ec upstream.
    
    On big-endian systems (e.g., Apple PowerBook), trying to use a
    logitech wireless mouse with the Logitech Unifying Receiver does not
    work with v3.2 and later kernels.  The device doesn't show up in
    /dev/input.  Older kernels work fine.
    
    That is because the new hid-logitech-dj driver claims the device.  The
    device arrival notification appears:
    
    	20 00 41 02 00 00 00 00 00 00 00 00 00 00 00
    
    and we read the report_types bitfield (02 00 00 00) to find out what
    kind of device it is.  Unfortunately the driver only reads the first 8
    bits and treats that value as a 32-bit little-endian number, so on a
    powerpc the report type seems to be 0x02000000 and is not recognized.
    
    Even on little-endian machines, connecting a media center remote
    control (report type 00 01 00 00) with this driver loaded would
    presumably fail for the same reason.
    
    Fix both problems by using get_unaligned_le32() to read all four
    bytes, which is a little clearer anyway.  After this change, the
    wireless mouse works on Hugo's PowerBook again.
    
    Based on a patch by Nestor Lopez Casado.
    Addresses http://bugs.debian.org/671292
    
    Reported-by: Hugo Osvaldo Barrera <hugo@osvaldobarrera.com.ar>
    Inspired-by: Nestor Lopez Casado <nlopezcasad@logitech.com>
    Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
    Signed-off-by: Nestor Lopez Casado <nlopezcasad@logitech.com>
    Signed-off-by: Jiri Kosina <jkosina@suse.cz>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 06d5f73748c6a78f612880f190b151801aca046c
Author: Oliver Neukum <oliver@neukum.org>
Date:   Mon Apr 30 09:13:46 2012 +0200

    usbhid: prevent deadlock during timeout
    
    commit 8815bb09af21316aeb5f8948b24ac62181670db2 upstream.
    
    On some HCDs usb_unlink_urb() can directly call the
    completion handler. That limits the spinlocks that can
    be taken in the handler to locks not held while calling
    usb_unlink_urb()
    To prevent a race with resubmission, this patch exposes
    usbcore's infrastructure for blocking submission, uses it
    and so drops the lock without causing a race in usbhid.
    
    Signed-off-by: Oliver Neukum <oneukum@suse.de>
    Acked-by: Jiri Kosina <jkosina@suse.cz>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 5b3a8e30b04642379e6f5ca87e050497e439ca2f
Author: David Herrmann <dh.herrmann@googlemail.com>
Date:   Tue May 8 16:52:31 2012 +0200

    HID: wiimote: Fix IR data parser
    
    commit 74b89e8a3625c17c7452532dfb997ac4f1a38751 upstream.
    
    We incorrectly parse incoming IR data. The extra byte contains the upper
    bits and not the lower bits of the x/y coordinates. User-space expects
    absolute position data from us so this patch does not break existing
    applications. On the contrary, it extends the virtual view and fixes
    garbage reports for margin areas of the virtual screen.
    
    Reported-by: Peter Bukovsky <bukovsky.peter@gmail.com>
    Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
    Signed-off-by: Jiri Kosina <jkosina@suse.cz>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit f573daace50066c0bea75acd8c3fdb97ae0fc601
Author: Matt Johnson <johnso87@illinois.edu>
Date:   Fri Apr 27 01:42:30 2012 -0500

    ahci: Detect Marvell 88SE9172 SATA controller
    
    commit 642d89252201c4155fc3946bf9cdea409e5d263e upstream.
    
    The Marvell 88SE9172 SATA controller (PCI ID 1b4b 917a) already worked
    once it was detected, but was missing an ahci_pci_tbl entry.
    
    Boot tested on a Gigabyte Z68X-UD3H-B3 motherboard.
    
    Signed-off-by: Matt Johnson <johnso87@illinois.edu>
    Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit c8e230a5c50448957a350c0a9119c11c6a7af975
Author: Lin Ming <ming.m.lin@intel.com>
Date:   Wed Apr 18 09:29:47 2012 +0800

    libata: forbid port runtime pm by default, fixing regression
    
    commit 0c8d32c27f5cf6e14ca14b4758d1e994eebd50fd upstream.
    
    Forbid port runtime pm by default because it has known hotplug issue.
    User can allow it by, for example
    
    echo auto > /sys/devices/pci0000:00/0000:00:1f.2/ata2/power/control
    
    Signed-off-by: Lin Ming <ming.m.lin@intel.com>
    Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 7e23582643704c0ad61a5216b9d418310ceff7b5
Author: Maxim Levitsky <maximlevitsky@gmail.com>
Date:   Sat Mar 17 20:16:53 2012 +0200

    mtd: sm_ftl: fix typo in major number.
    
    commit 452380efbd72d8d41f53ea64c8a6ea1fedc4394d upstream.
    
    major == 0 allocates dynamic major, not major == -1
    
    Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
    Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit c110a3c6ef497b687b2e9777fe0e4cff7c587957
Author: Robert Richter <robert.richter@amd.com>
Date:   Fri May 18 12:40:42 2012 +0200

    perf/x86: Update event scheduling constraints for AMD family 15h models
    
    commit 5bcdf5e4fee3c45e1281c25e4941f2163cb28c65 upstream.
    
    This update is for newer family 15h cpu models from 0x02 to 0x1f.
    
    Signed-off-by: Robert Richter <robert.richter@amd.com>
    Acked-by: Peter Zijlstra <peterz@infradead.org>
    Cc: Stephane Eranian <eranian@google.com>
    Link: http://lkml.kernel.org/r/1337337642-1621-1-git-send-email-robert.richter@amd.com
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 514ea2c8a2f05932f1b301b80f5762df7e5fc08e
Author: Julia Lawall <Julia.Lawall@lip6.fr>
Date:   Sun Apr 22 13:37:09 2012 +0200

    drivers/staging/comedi/comedi_fops.c: add missing vfree
    
    commit abae41e6438b798e046d721b6ccdd55b4a398170 upstream.
    
    aux_free is freed on all other exits from the function.  By removing the
    return, we can benefit from the vfree already at the end of the function.
    
    Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 84cee24be425e540821da23ccb00f810735f5745
Author: Yishai Hadas <yishaih@mellanox.com>
Date:   Thu May 10 23:28:05 2012 +0300

    IB/core: Fix mismatch between locked and pinned pages
    
    commit c4870eb874ac16dccef40e1bc7a002c7e9156adc upstream.
    
    Commit bc3e53f682d9 ("mm: distinguish between mlocked and pinned
    pages") introduced a separate counter for pinned pages and used it in
    the IB stack.  However, in ib_umem_get() the pinned counter is
    incremented, but ib_umem_release() wrongly decrements the locked
    counter.  Fix this.
    
    Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
    Reviewed-by: Christoph Lameter <cl@linux.com>
    Signed-off-by: Roland Dreier <roland@purestorage.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 77c5da9f6f487c3c86ab5b520f3f680bef1c3487
Author: Eric Paris <eparis@redhat.com>
Date:   Wed Apr 4 13:47:11 2012 -0400

    SELinux: if sel_make_bools errors don't leave inconsistent state
    
    commit 154c50ca4eb9ae472f50b6a481213e21ead4457d upstream.
    
    We reset the bool names and values array to NULL, but do not reset the
    number of entries in these arrays to 0.  If we error out and then get back
    into this function we will walk these NULL pointers based on the belief
    that they are non-zero length.
    
    Signed-off-by: Eric Paris <eparis@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 6cb2c7c77044d6b551b0fbdf5fdcb6fcebbc30b1
Author: David Howells <dhowells@redhat.com>
Date:   Fri May 11 10:56:56 2012 +0100

    KEYS: Use the compat keyctl() syscall wrapper on Sparc64 for Sparc32 compat
    
    commit 45de6767dc51358a188f75dc4ad9dfddb7fb9480 upstream.
    
    Use the 32-bit compat keyctl() syscall wrapper on Sparc64 for Sparc32 binary
    compatibility.
    
    Without this, keyctl(KEYCTL_INSTANTIATE_IOV) is liable to malfunction as it
    uses an iovec array read from userspace - though the kernel should survive this
    as it checks pointers and sizes anyway.
    
    I think all the other keyctl() function should just work, provided (a) the top
    32-bits of each 64-bit argument register are cleared prior to invoking the
    syscall routine, and the 32-bit address space is right at the 0-end of the
    64-bit address space.  Most of the arguments are 32-bit anyway, and so for
    those clearing is not required.
    
    Signed-off-by: David Howells <dhowells@redhat.com
    cc: "David S. Miller" <davem@davemloft.net>
    cc: sparclinux@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 492fe7726d0d0125ff6155c4d67dd2727fdb0d8a
Author: Thomas Gleixner <tglx@linutronix.de>
Date:   Mon May 7 17:59:47 2012 +0000

    powerpc: Fix broken cpu_idle_wait() implementation
    
    commit 9cd75e13de2dcf32ecc21c7f277cff3c0ced059e upstream.
    
    commit 771dae818 (powerpc/cpuidle: Add cpu_idle_wait() to allow
    switching of idle routines) implemented cpu_idle_wait() for powerpc.
    
    The changelog says:
     "The equivalent routine for x86 is in arch/x86/kernel/process.c
      but the powerpc implementation is different.":
    
    Unfortunately the changelog is completely useless as it does not tell
    _WHY_ it is different.
    
    Aside of being different the implementation is patently wrong.
    
    The rescheduling IPI is async. That means that there is no guarantee,
    that the other cores have executed the IPI when cpu_idle_wait()
    returns. But that's the whole purpose of this function: to guarantee
    that no CPU uses the old idle handler anymore.
    
    Use the smp_functional_call() based implementation, which fulfils the
    requirements.
    
    [ This code is going to replaced by a core version to remove all the
      pointless copies in arch/*, but this one should go to stable ]
    
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Acked-by: Peter Zijlstra <peterz@infradead.org>
    Cc: Deepthi Dharwar <deepthi@linux.vnet.ibm.com>
    Cc: Trinabh Gupta <g.trinabh@gmail.com>
    Cc: Arun R Bharadwaj <arun.r.bharadwaj@gmail.com>
    Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    Link: http://lkml.kernel.org/r/20120507175651.980164748@linutronix.de
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit f156a872141a6fe174301e4935d5cd6959607fbe
Author: Steve Wise <swise@opengridcomputing.com>
Date:   Mon Apr 30 15:31:29 2012 -0500

    RDMA/cxgb4: Drop peer_abort when no endpoint found
    
    commit 14b9222808bb8bfefc71f72bc0dbdcf3b2f0140f upstream.
    
    Log a warning and drop the abort message.  Otherwise we will do a
    bogus wake_up() and crash.
    
    Signed-off-by: Steve Wise <swise@opengridcomputing.com>
    Signed-off-by: Roland Dreier <roland@purestorage.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit a4dd32e712e3e8ac25b7875f018616d60badcce5
Author: Steve Wise <swise@opengridcomputing.com>
Date:   Fri Apr 27 10:24:33 2012 -0500

    RDMA/cxgb4: Use dst parameter in import_ep()
    
    commit bd61baaf59669accae2720799394a51fecabe5d9 upstream.
    
    Function import_ep() is incorrectly using ep->dst instead of the dst
    ptr passed in.  This causes a crash when accepting new rdma connections
    becase ep->dst is not initialized yet.
    
    Signed-off-by: Steve Wise <swise@opengridcomputing.com>
    Signed-off-by: Roland Dreier <roland@purestorage.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 3b86beb67adb9eea10b3391ec3ebf64bdf0053ed
Author: Steve Wise <swise@opengridcomputing.com>
Date:   Fri Apr 27 09:59:16 2012 -0500

    RDMA/cxgb4: Always wake up waiters in c4iw_peer_abort_intr()
    
    commit 0f1dcfae6bc5563424346ad3a03282b8235a4c33 upstream.
    
    This fixes a race where an ingress abort fails to wake up the thread
    blocked in rdma_init() causing the app to hang.
    
    Signed-off-by: Steve Wise <swise@opengridcomputing.com>
    Signed-off-by: Roland Dreier <roland@purestorage.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit e10991c98929fe1b47278c0eafe8548a2d09bc86
Author: Dan Williams <dan.j.williams@intel.com>
Date:   Mon Apr 30 11:57:44 2012 -0700

    isci: fix oem parameter validation on single controller skus
    
    commit fc25f79af321c01a739150ba2c09435cf977a63d upstream.
    
    OEM parameters [1] are parsed from the platform option-rom / efi
    driver.  By default the driver was validating the parameters for the
    dual-controller case, but in single-controller case only the first set
    of parameters may be valid.
    
    Limit the validation to the number of actual controllers detected
    otherwise the driver may fail to parse the valid parameters leading to
    driver-load or runtime failures.
    
    [1] the platform specific set of phy address, configuration,and analog
        tuning values
    
    Reported-by: Dave Jiang <dave.jiang@intel.com>
    Tested-by: Dave Jiang <dave.jiang@intel.com>
    Signed-off-by: Dan Williams <dan.j.williams@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit d13153e06a7f23823dab5567da85647c0ae1bcc3
Author: nagalakshmi.nandigama@lsi.com <nagalakshmi.nandigama@lsi.com>
Date:   Tue Mar 20 12:10:01 2012 +0530

    SCSI: mpt2sas: Fix for panic happening because of improper memory allocation
    
    commit e42fafc25fa86c61824e8d4c5e7582316415d24f upstream.
    
    The ioc->pfacts member in the IOC structure is getting set to zero
    following a call to _base_get_ioc_facts due to the memset in that routine.
    So if the ioc->pfacts was read after a host reset, there would be a NULL
    pointer dereference. The routine _base_get_ioc_facts is called from context
    of host reset.  The problem in _base_get_ioc_facts  is the size of
    Mpi2IOCFactsReply is 64, whereas the sizeof "struct mpt2sas_facts" is 60,
    so there is a four byte overflow resulting from the memset.
    
    Also, there is memset in _base_get_port_facts using the incorrect structure,
    it should be "struct mpt2sas_port_facts" instead of Mpi2PortFactsReply.
    
    Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com>
    Signed-off-by: James Bottomley <JBottomley@Parallels.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 7bf1ce22f9471b5daed82608b5f7a0cf47e74f30
Author: Heiko Carstens <heiko.carstens@de.ibm.com>
Date:   Wed May 9 09:37:30 2012 +0200

    s390/pfault: fix task state race
    
    commit d5e50a51ccbda36b379aba9d1131a852eb908dda upstream.
    
    When setting the current task state to TASK_UNINTERRUPTIBLE this can
    race with a different cpu. The other cpu could set the task state after
    it inspected it (while it was still TASK_RUNNING) to TASK_RUNNING which
    would change the state from TASK_UNINTERRUPTIBLE to TASK_RUNNING again.
    
    This race was always present in the pfault interrupt code but didn't
    cause anything harmful before commit f2db2e6c "[S390] pfault: cpu hotplug
    vs missing completion interrupts" which relied on the fact that after
    setting the task state to TASK_UNINTERRUPTIBLE the task would really
    sleep.
    Since this is not necessarily the case the result may be a list corruption
    of the pfault_list or, as observed, a use-after-free bug while trying to
    access the task_struct of a task which terminated itself already.
    
    To fix this, we need to get a reference of the affected task when receiving
    the initial pfault interrupt and add special handling if we receive yet
    another initial pfault interrupt when the task is already enqueued in the
    pfault list.
    
    Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
    Reviewed-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
    Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 450c2ff21b4257b27be424df1e3a161684be83bb
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Mon May 21 12:52:42 2012 -0700

    Fix blocking allocations called very early during bootup
    
    commit 31a67102f4762df5544bc2dfb34a931233d2a5b2 upstream.
    
    During early boot, when the scheduler hasn't really been fully set up,
    we really can't do blocking allocations because with certain (dubious)
    configurations the "might_resched()" calls can actually result in
    scheduling events.
    
    We could just make such users always use GFP_ATOMIC, but quite often the
    code that does the allocation isn't really aware of the fact that the
    scheduler isn't up yet, and forcing that kind of random knowledge on the
    initialization code is just annoying and not good for anybody.
    
    And we actually have a the 'gfp_allowed_mask' exactly for this reason:
    it's just that the kernel init sequence happens to set it to allow
    blocking allocations much too early.
    
    So move the 'gfp_allowed_mask' initialization from 'start_kernel()'
    (which is some of the earliest init code, and runs with preemption
    disabled for good reasons) into 'kernel_init()'.  kernel_init() is run
    in the newly created thread that will become the 'init' process, as
    opposed to the early startup code that runs within the context of what
    will be the first idle thread.
    
    So by the time we reach 'kernel_init()', we know that the scheduler must
    be at least limping along, because we've already scheduled from the idle
    thread into the init thread.
    
    Reported-by: Steven Rostedt <rostedt@goodmis.org>
    Cc: David Rientjes <rientjes@google.com>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 4666b31d6dadd715732179f47aaf43f9143306d8
Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
Date:   Sun May 13 18:35:56 2012 +0100

    regulator: core: Release regulator-regulator supplies on error
    
    commit e81dba85c6388dfabcb76cbc2b8bd02836a53ae5 upstream.
    
    If we fail while registering a regulator make sure we release the supply
    for the regulator if there is one.
    
    Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
    Acked-by: Liam Girdwood <lrg@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 44f289c7e60fb04330ddf1c650a0ec0311ce29f6
Author: Luis R. Rodriguez <mcgrof@frijolero.org>
Date:   Fri Mar 23 07:23:31 2012 -0700

    cfg80211: warn if db.txt is empty with CONFIG_CFG80211_INTERNAL_REGDB
    
    commit 80007efeff0568375b08faf93c7aad65602cb97e upstream.
    
    It has happened twice now where elaborate troubleshooting has
    undergone on systems where CONFIG_CFG80211_INTERNAL_REGDB [0]
    has been set but yet net/wireless/db.txt was not updated.
    
    Despite the documentation on this it seems system integrators could
    use some more help with this, so throw out a kernel warning at boot time
    when their database is empty.
    
    This does mean that the error-prone system integrator won't likely
    realize the issue until they boot the machine but -- it does not seem
    to make sense to enable a build bug breaking random build testing.
    
    [0] http://wireless.kernel.org/en/developers/Regulatory/CRDA#CONFIG_CFG80211_INTERNAL_REGDB
    
    Cc: Stephen Rothwell <sfr@canb.auug.org.au>
    Cc: Youngsin Lee <youngsin@qualcomm.com>
    Cc: Raja Mani <rmani@qca.qualcomm.com>
    Cc: Senthil Kumar Balasubramanian <senthilb@qca.qualcomm.com>
    Cc: Vipin Mehta <vipimeht@qca.qualcomm.com>
    Cc: yahuan@qca.qualcomm.com
    Cc: jjan@qca.qualcomm.com
    Cc: vthiagar@qca.qualcomm.com
    Cc: henrykim@qualcomm.com
    Cc: jouni@qca.qualcomm.com
    Cc: athiruve@qca.qualcomm.com
    Cc: cjkim@qualcomm.com
    Cc: philipk@qca.qualcomm.com
    Cc: sunnykim@qualcomm.com
    Cc: sskwak@qualcomm.com
    Cc: kkim@qualcomm.com
    Cc: mattbyun@qualcomm.com
    Cc: ryanlee@qualcomm.com
    Cc: simbap@qualcomm.com
    Cc: krislee@qualcomm.com
    Cc: conner@qualcomm.com
    Cc: hojinkim@qualcomm.com
    Cc: honglee@qualcomm.com
    Cc: johnwkim@qualcomm.com
    Cc: jinyong@qca.qualcomm.com
    Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
    Signed-off-by: John W. Linville <linville@tuxdriver.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 947e94b2b68de55880b4a84c07d6af0d465c25f6
Author: Kenth Eriksson <kenth.eriksson@transmode.com>
Date:   Fri Mar 30 17:05:30 2012 +0200

    spi/mpc83xx: fix NULL pdata dereference bug
    
    commit 5039a86973cd35bdb2f64d28ee12f13fe2bb5a4c upstream.
    
    Commit 178db7d3, "spi: Fix device unregistration when unregistering
    the bus master", changed device initialization to be children of the
    bus master, not children of the bus masters parent device. The pdata
    pointer used in fsl_spi_chipselect must updated to reflect the changed
    initialization.
    
    Signed-off-by: Kenth Eriksson <kenth.eriksson@transmode.com>
    Acked-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit ea15dd3cd4a8f3b097cccf7739edde04b69e0a03
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Mon May 21 16:06:20 2012 -0700

    vfs: make AIO use the proper rw_verify_area() area helpers
    
    commit a70b52ec1aaeaf60f4739edb1b422827cb6f3893 upstream.
    
    We had for some reason overlooked the AIO interface, and it didn't use
    the proper rw_verify_area() helper function that checks (for example)
    mandatory locking on the file, and that the size of the access doesn't
    cause us to overflow the provided offset limits etc.
    
    Instead, AIO did just the security_file_permission() thing (that
    rw_verify_area() also does) directly.
    
    This fixes it to do all the proper helper functions, which not only
    means that now mandatory file locking works with AIO too, we can
    actually remove lines of code.
    
    Reported-by: Manish Honap <manish_honap_vit@yahoo.co.in>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 6801b1bfcd1eceac564df643cad179a15c7d9a10
Author: Tilman Schmidt <tilman@imap.cc>
Date:   Wed Apr 25 13:02:19 2012 +0000

    isdn/gigaset: ratelimit CAPI message dumps
    
    commit 8e618aad5348b6e6c5a90e8d97ea643197963b20 upstream.
    
    Introduce a global ratelimit for CAPI message dumps to protect
    against possible log flood.
    Drop the ratelimit for ignored messages which is now covered by the
    global one.
    
    Signed-off-by: Tilman Schmidt <tilman@imap.cc>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 4d4297f42d0de1f91f580cec857dbcc9ebcb12d0
Author: James Bottomley <JBottomley@Parallels.com>
Date:   Wed May 16 11:10:27 2012 +0100

    PARISC: fix panic on prefetch(NULL) on PA7300LC
    
    commit b3cb8674811d1851bbf1486a73d62b90c119b994 upstream.
    
    Due to an errata, the PA7300LC generates a TLB miss interruption even on the
    prefetch instruction.  This means that prefetch(NULL), which is supposed to be
    a nop on linux actually generates a NULL deref fault.  Fix this by testing the
    address of prefetch against NULL before doing the prefetch.
    
    Signed-off-by: James Bottomley <JBottomley@Parallels.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 0e963bc00d88981ecaf4266bd9fe2a0d7b8674e4
Author: John David Anglin <dave.anglin@bell.net>
Date:   Wed May 16 10:14:52 2012 +0100

    PARISC: fix crash in flush_icache_page_asm on PA1.1
    
    commit 207f583d7179f707f402c36a7bda5ca1fd03ad5b upstream.
    
    As pointed out by serveral people, PA1.1 only has a type 26 instruction
    meaning that the space register must be explicitly encoded.  Not giving an
    explicit space means that the compiler uses the type 24 version which is PA2.0
    only resulting in an illegal instruction crash.
    
    This regression was caused by
    
        commit f311847c2fcebd81912e2f0caf8a461dec28db41
        Author: James Bottomley <James.Bottomley@HansenPartnership.com>
        Date:   Wed Dec 22 10:22:11 2010 -0600
    
            parisc: flush pages through tmpalias space
    
    Reported-by: Helge Deller <deller@gmx.de>
    Signed-off-by: John David Anglin <dave.anglin@bell.net>
    Signed-off-by: James Bottomley <JBottomley@Parallels.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 31df6ef255a183cc9c8caa1ccc3b14e935505c02
Author: James Bottomley <JBottomley@Parallels.com>
Date:   Tue May 15 11:04:19 2012 +0100

    PARISC: fix PA1.1 oops on boot
    
    commit 5e185581d7c46ddd33cd9c01106d1fc86efb9376 upstream.
    
    All PA1.1 systems have been oopsing on boot since
    
    commit f311847c2fcebd81912e2f0caf8a461dec28db41
    Author: James Bottomley <James.Bottomley@HansenPartnership.com>
    Date:   Wed Dec 22 10:22:11 2010 -0600
    
        parisc: flush pages through tmpalias space
    
    because a PA2.0 instruction was accidentally introduced into the PA1.1 TLB
    insertion interruption path when it was consolidated with the do_alias macro.
    Fix the do_alias macro only to use PA2.0 instructions if compiled for 64 bit.
    
    Signed-off-by: James Bottomley <JBottomley@Parallels.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 3735b0a1d73af536484ddefef4d8438dd468c4a6
Author: Jeff Moyer <jmoyer@redhat.com>
Date:   Fri May 11 16:34:10 2012 +0200

    block: don't mark buffers beyond end of disk as mapped
    
    commit 080399aaaf3531f5b8761ec0ac30ff98891e8686 upstream.
    
    Hi,
    
    We have a bug report open where a squashfs image mounted on ppc64 would
    exhibit errors due to trying to read beyond the end of the disk.  It can
    easily be reproduced by doing the following:
    
    [root@ibm-p750e-02-lp3 ~]# ls -l install.img
    -rw-r--r-- 1 root root 142032896 Apr 30 16:46 install.img
    [root@ibm-p750e-02-lp3 ~]# mount -o loop ./install.img /mnt/test
    [root@ibm-p750e-02-lp3 ~]# dd if=/dev/loop0 of=/dev/null
    dd: reading `/dev/loop0': Input/output error
    277376+0 records in
    277376+0 records out
    142016512 bytes (142 MB) copied, 0.9465 s, 150 MB/s
    
    In dmesg, you'll find the following:
    
    squashfs: version 4.0 (2009/01/31) Phillip Lougher
    [   43.106012] attempt to access beyond end of device
    [   43.106029] loop0: rw=0, want=277410, limit=277408
    [   43.106039] Buffer I/O error on device loop0, logical block 138704
    [   43.106053] attempt to access beyond end of device
    [   43.106057] loop0: rw=0, want=277412, limit=277408
    [   43.106061] Buffer I/O error on device loop0, logical block 138705
    [   43.106066] attempt to access beyond end of device
    [   43.106070] loop0: rw=0, want=277414, limit=277408
    [   43.106073] Buffer I/O error on device loop0, logical block 138706
    [   43.106078] attempt to access beyond end of device
    [   43.106081] loop0: rw=0, want=277416, limit=277408
    [   43.106085] Buffer I/O error on device loop0, logical block 138707
    [   43.106089] attempt to access beyond end of device
    [   43.106093] loop0: rw=0, want=277418, limit=277408
    [   43.106096] Buffer I/O error on device loop0, logical block 138708
    [   43.106101] attempt to access beyond end of device
    [   43.106104] loop0: rw=0, want=277420, limit=277408
    [   43.106108] Buffer I/O error on device loop0, logical block 138709
    [   43.106112] attempt to access beyond end of device
    [   43.106116] loop0: rw=0, want=277422, limit=277408
    [   43.106120] Buffer I/O error on device loop0, logical block 138710
    [   43.106124] attempt to access beyond end of device
    [   43.106128] loop0: rw=0, want=277424, limit=277408
    [   43.106131] Buffer I/O error on device loop0, logical block 138711
    [   43.106135] attempt to access beyond end of device
    [   43.106139] loop0: rw=0, want=277426, limit=277408
    [   43.106143] Buffer I/O error on device loop0, logical block 138712
    [   43.106147] attempt to access beyond end of device
    [   43.106151] loop0: rw=0, want=277428, limit=277408
    [   43.106154] Buffer I/O error on device loop0, logical block 138713
    [   43.106158] attempt to access beyond end of device
    [   43.106162] loop0: rw=0, want=277430, limit=277408
    [   43.106166] attempt to access beyond end of device
    [   43.106169] loop0: rw=0, want=277432, limit=277408
    ...
    [   43.106307] attempt to access beyond end of device
    [   43.106311] loop0: rw=0, want=277470, limit=2774
    
    Squashfs manages to read in the end block(s) of the disk during the
    mount operation.  Then, when dd reads the block device, it leads to
    block_read_full_page being called with buffers that are beyond end of
    disk, but are marked as mapped.  Thus, it would end up submitting read
    I/O against them, resulting in the errors mentioned above.  I fixed the
    problem by modifying init_page_buffers to only set the buffer mapped if
    it fell inside of i_size.
    
    Cheers,
    Jeff
    
    Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
    Acked-by: Nick Piggin <npiggin@kernel.dk>
    
    --
    
    Changes from v1->v2: re-used max_block, as suggested by Nick Piggin.
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit be19f7af39a84fc3c8206eacd67fec980e390633
Author: Tejun Heo <tj@kernel.org>
Date:   Tue May 15 08:22:04 2012 +0200

    block: fix buffer overflow when printing partition UUIDs
    
    commit 05c69d298c96703741cac9a5cbbf6c53bd55a6e2 upstream.
    
    6d1d8050b4bc8 "block, partition: add partition_meta_info to hd_struct"
    added part_unpack_uuid() which assumes that the passed in buffer has
    enough space for sprintfing "%pU" - 37 characters including '\0'.
    
    Unfortunately, b5af921ec0233 "init: add support for root devices
    specified by partition UUID" supplied 33 bytes buffer to the function
    leading to the following panic with stackprotector enabled.
    
      Kernel panic - not syncing: stack-protector: Kernel stack corrupted in: ffffffff81b14c7e
    
      [<ffffffff815e226b>] panic+0xba/0x1c6
      [<ffffffff81b14c7e>] ? printk_all_partitions+0x259/0x26xb
      [<ffffffff810566bb>] __stack_chk_fail+0x1b/0x20
      [<ffffffff81b15c7e>] printk_all_paritions+0x259/0x26xb
      [<ffffffff81aedfe0>] mount_block_root+0x1bc/0x27f
      [<ffffffff81aee0fa>] mount_root+0x57/0x5b
      [<ffffffff81aee23b>] prepare_namespace+0x13d/0x176
      [<ffffffff8107eec0>] ? release_tgcred.isra.4+0x330/0x30
      [<ffffffff81aedd60>] kernel_init+0x155/0x15a
      [<ffffffff81087b97>] ? schedule_tail+0x27/0xb0
      [<ffffffff815f4d24>] kernel_thread_helper+0x5/0x10
      [<ffffffff81aedc0b>] ? start_kernel+0x3c5/0x3c5
      [<ffffffff815f4d20>] ? gs_change+0x13/0x13
    
    Increase the buffer size, remove the dangerous part_unpack_uuid() and
    use snprintf() directly from printk_all_partitions().
    
    Signed-off-by: Tejun Heo <tj@kernel.org>
    Reported-by: Szymon Gruszczynski <sz.gruszczynski@googlemail.com>
    Cc: Will Drewry <wad@chromium.org>
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit ce973c4010eee47734f46808ca666470e80f3034
Author: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
Date:   Fri May 11 16:36:44 2012 +0200

    bio allocation failure due to bio_get_nr_vecs()
    
    commit f908ee9463b09ddd05e1c1a0111132212dc05fac upstream.
    
    The number of bio_get_nr_vecs() is passed down via bio_alloc() to
    bvec_alloc_bs(), which fails the bio allocation if
    nr_iovecs > BIO_MAX_PAGES. For the underlying caller this causes an
    unexpected bio allocation failure.
    Limiting to queue_max_segments() is not sufficient, as max_segments
    also might be very large.
    
    bvec_alloc_bs(gfp_mask, nr_iovecs, ) => NULL when nr_iovecs  > BIO_MAX_PAGES
    bio_alloc_bioset(gfp_mask, nr_iovecs, ...)
    bio_alloc(GFP_NOIO, nvecs)
    xfs_alloc_ioend_bio()
    
    Signed-off-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 9654719bc8725cdae8dba07ca900a9bce3cc036d
Author: Chris Metcalf <cmetcalf@tilera.com>
Date:   Fri May 18 13:33:24 2012 -0400

    tilegx: enable SYSCALL_WRAPPERS support
    
    commit e6d9668e119af44ae5bcd5f1197174531458afe3 upstream.
    
    Some discussion with the glibc mailing lists revealed that this was
    necessary for 64-bit platforms with MIPS-like sign-extension rules
    for 32-bit values.  The original symptom was that passing (uid_t)-1 to
    setreuid() was failing in programs linked -pthread because of the "setxid"
    mechanism for passing setxid-type function arguments to the syscall code.
    SYSCALL_WRAPPERS handles ensuring that all syscall arguments end up with
    proper sign-extension and is thus the appropriate fix for this problem.
    
    On other platforms (s390, powerpc, sparc64, and mips) this was fixed
    in 2.6.28.6.  The general issue is tracked as CVE-2009-0029.
    
    Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>