Squashed commit of the following:

commit f2535a2d0fd689545fb26a6e5198f7cb0907dcee
Author: hei <hei@Nova-Box.(none)>
Date:   Sat Dec 22 16:02:30 2012 +0800

    ramdisk: merge to latest CM10 commit & update CWM Recovery to 6.0.23

commit c51b0deab1e8dfffd8864745cf7fc752516ed40e
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Mon Dec 17 10:56:46 2012 -0800

    Linux 3.0.57
    (cherry picked from commit 881c0a027c495dd35992346176a40d39a7666fb9)

commit af0c1d982dbb0a26378ec3a82ccd5ca2f82ca83f
Author: Anton Blanchard <anton@samba.org>
Date:   Mon Sep 3 16:48:46 2012 +0000

    powerpc: Keep thread.dscr and thread.dscr_inherit in sync

    commit 00ca0de02f80924dfff6b4f630e1dff3db005e35 upstream.

    When we update the DSCR either via emulation of mtspr(DSCR) or via
    a change to dscr_default in sysfs we don't update thread.dscr.
    We will eventually update it at context switch time but there is
    a period where thread.dscr is incorrect.

    If we fork at this point we will copy the old value of thread.dscr
    into the child. To avoid this, always keep thread.dscr in sync with
    reality.

    This issue was found with the following testcase:

    http://ozlabs.org/~anton/junkcode/dscr_inherit_test.c

    Signed-off-by: Anton Blanchard <anton@samba.org>
    Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    Signed-off-by: Haren Myneni <haren@us.ibm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    (cherry picked from commit 3882a18f5fa8a707024ac599070f2298cfc2ff39)

commit 30b7c53cedde748003caaf0cc11b28946604292d
Author: Anton Blanchard <anton@samba.org>
Date:   Mon Sep 3 16:47:56 2012 +0000

    powerpc: Update DSCR on all CPUs when writing sysfs dscr_default

    commit 1b6ca2a6fe56e7697d57348646e07df08f43b1bb upstream.

    Writing to dscr_default in sysfs doesn't actually change the DSCR -
    we rely on a context switch on each CPU to do the work. There is no
    guarantee we will get a context switch in a reasonable amount of time
    so fire off an IPI to force an immediate change.

    This issue was found with the following test case:

    http://ozlabs.org/~anton/junkcode/dscr_explicit_test.c

    Signed-off-by: Anton Blanchard <anton@samba.org>
    Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    Signed-off-by: Haren Myneni <haren@us.ibm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    (cherry picked from commit 1758e55fd05e042e873f6d54657552ee1730bb32)

commit 0abaf17d6c905ee3468a0339627fe2f4015661e6
Author: Dan Carpenter <dan.carpenter@oracle.com>
Date:   Sat Jun 9 19:10:27 2012 +0300

    ftrace: Clear bits properly in reset_iter_read()

    commit 70f77b3f7ec010ff9624c1f2e39a81babc9e2429 upstream.

    There is a typo here where '&' is used instead of '|' and it turns the
    statement into a noop.  The original code is equivalent to:

    	iter->flags &= ~((1 << 2) & (1 << 4));

    Link: http://lkml.kernel.org/r/20120609161027.GD6488@elgon.mountain

    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    (cherry picked from commit 7a09a2fff84eda4ac1bba98a61a61bd58f369bed)

commit f6677e9851ff0c77d853576a87fd8d513cd42119
Author: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Date:   Wed Oct 17 13:44:06 2012 -0700

    xhci: Extend Fresco Logic MSI quirk.

    commit bba18e33f25072ebf70fd8f7f0cdbf8cdb59a746 upstream.

    Ali reports that plugging a device into the Fresco Logic xHCI host with
    PCI device ID 1400 produces an IRQ error:

     do_IRQ: 3.176 No irq handler for vector (irq -1)

    Other early Fresco Logic host revisions don't support MSI, even though
    their PCI config space claims they do.  Extend the quirk to disabling
    MSI to this chipset revision.  Also enable the short transfer quirk,
    since it's likely this revision also has that quirk, and it should be
    harmless to enable.

    04:00.0 0c03: 1b73:1400 (rev 01) (prog-if 30 [XHCI])
            Subsystem: 1d5c:1000
            Physical Slot: 3
            Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
            Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
            Latency: 0, Cache Line Size: 64 bytes
            Interrupt: pin A routed to IRQ 51
            Region 0: Memory at d4600000 (32-bit, non-prefetchable) [size=64K]
            Capabilities: [50] Power Management version 3
                    Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot+,D3cold-)
                    Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
            Capabilities: [68] MSI: Enable+ Count=1/1 Maskable- 64bit+
                    Address: 00000000feeff00c  Data: 41b1
            Capabilities: [80] Express (v1) Endpoint, MSI 00
                    DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s <2us, L1 <32us
                            ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
                    DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
                            RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+
                            MaxPayload 128 bytes, MaxReadReq 512 bytes
                    DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr- TransPend-
                    LnkCap: Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Latency L0 unlimited, L1 unlimited
                            ClockPM- Surprise- LLActRep- BwNot-
                    LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk+
                            ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
                    LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
            Kernel driver in use: xhci_hcd

    This patch should be backported to stable kernels as old as 2.6.36, that
    contain the commit f5182b4155b9d686c5540a6822486400e34ddd98 "xhci:
    Disable MSI for some Fresco Logic hosts."

    Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
    Reported-by: A Sh <smr.ash1991@gmail.com>
    Tested-by: A Sh <smr.ash1991@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    (cherry picked from commit dadc9f9ce8a578cd4dbb59a94725480f19312ec9)

commit e4cf89b44677ebb532354d711a666cf26bfcab22
Author: Alan Stern <stern@rowland.harvard.edu>
Date:   Mon Nov 26 12:36:21 2012 -0500

    USB: OHCI: workaround for hardware bug: retired TDs not added to the Done Queue

    commit 50ce5c0683aa83eb161624ea89daa5a9eee0c2ce upstream.

    This patch (as1636) is a partial workaround for a hardware bug
    affecting OHCI controllers by NVIDIA at least, maybe others too.  When
    the controller retires a Transfer Descriptor, it is supposed to add
    the TD onto the Done Queue.  But sometimes this doesn't happen, with
    the result that ohci-hcd never realizes the corresponding transfer has
    finished.  Symptoms can vary; a typical result is that USB audio stops
    working after a while.

    The patch works around the problem by recognizing that TDs are always
    processed in order.  Therefore, if a later TD is found on the Done
    Queue than all the earlier TDs for the same endpoint must be finished
    as well.

    Unfortunately this won't solve the problem in cases where the missing
    TD is the last one in the endpoint's queue.  A complete fix would
    require a signficant amount of change to the driver.

    Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
    Tested-by: Oliver Neukum <oneukum@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    (cherry picked from commit e22045df6987c7d8edf69aa4fcee4720ee317158)

commit ff54b3d4bbf491567c24b93b8d4bd1f5c17b8d70
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Tue Dec 4 23:30:19 2012 +0100

    ACPI / video: ignore BIOS initial backlight value for HP Folio 13-2000

    commit 129ff8f8d58297b04f47b5d6fad81aa2d08404e1 upstream.

    Or else the laptop will boot with a dimmed screen.

    References: https://bugzilla.kernel.org/show_bug.cgi?id=51141
    Tested-by: Stefan Nagy <public@stefan-nagy.at>
    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    (cherry picked from commit ffedea0f00a4b38c3ce0913b22b742443ab2b03d)

commit baa24ee115ef325b646e837a94c0f5f6274d2597
Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Date:   Fri Nov 30 13:05:05 2012 +0100

    ACPI / PNP: Do not crash due to stale pointer use during system resume

    commit a6b5e88c0e42093b9057856f35770966c8c591e3 upstream.

    During resume from system suspend the 'data' field of
    struct pnp_dev in pnpacpi_set_resources() may be a stale pointer,
    due to removal of the associated ACPI device node object in the
    previous suspend-resume cycle.  This happens, for example, if a
    dockable machine is booted in the docking station and then suspended
    and resumed and suspended again.  If that happens,
    pnpacpi_build_resource_template() called from pnpacpi_set_resources()
    attempts to use that pointer and crashes.

    However, pnpacpi_set_resources() actually checks the device's ACPI
    handle, attempts to find the ACPI device node object attached to it
    and returns an error code if that fails, so in fact it knows what the
    correct value of dev->data should be.  Use this observation to update
    dev->data with the correct value if necessary and dump a call trace
    if that's the case (once).

    We still need to fix the root cause of this issue, but preventing
    systems from crashing because of it is an improvement too.

    Reported-and-tested-by: Zdenek Kabelac <zdenek.kabelac@gmail.com>
    References: https://bugzilla.kernel.org/show_bug.cgi?id=51071
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    (cherry picked from commit cb2bf59bccbdb431ac3020e0ef31489d77b510b5)

commit 0f558b003d169c7ccec77ed356910726c7ce9e99
Author: Kamil Iskra <kamil@iskra.name>
Date:   Fri Nov 16 22:28:58 2012 +0100

    ACPI / battery: Correct battery capacity values on Thinkpads

    commit 4000e626156935dfb626321ce09cae2c833eabbb upstream.

    Add a quirk to correctly report battery capacity on 2010 and 2011
    Lenovo Thinkpad models.

    The affected models that I tested (x201, t410, t410s, and x220)
    exhibit a problem where, when battery capacity reporting unit is mAh,
    the values being reported are wrong.  Pre-2010 and 2012 models appear
    to always report in mWh and are thus unaffected.  Also, in mid-2012
    Lenovo issued a BIOS update for the 2011 models that fixes the issue
    (tested on x220 with a post-1.29 BIOS).  No such update is available
    for the 2010 models, so those still need this patch.

    Problem description: for some reason, the affected Thinkpads switch
    the reporting unit between mAh and mWh; generally, mAh is used when a
    laptop is plugged in and mWh when it's unplugged, although a
    suspend/resume or rmmod/modprobe is needed for the switch to take
    effect.  The values reported in mAh are *always* wrong.  This does
    not appear to be a kernel regression; I believe that the values were
    never reported correctly.  I tested back to kernel 2.6.34, with
    multiple machines and BIOS versions.

    Simply plugging a laptop into mains before turning it on is enough to
    reproduce the problem.  Here's a sample /proc/acpi/battery/BAT0/info
    from Thinkpad x220 (before a BIOS update) with a 4-cell battery:

    present:                 yes
    design capacity:         2886 mAh
    last full capacity:      2909 mAh
    battery technology:      rechargeable
    design voltage:          14800 mV
    design capacity warning: 145 mAh
    design capacity low:     13 mAh
    cycle count:              0
    capacity granularity 1:  1 mAh
    capacity granularity 2:  1 mAh
    model number:            42T4899
    serial number:           21064
    battery type:            LION
    OEM info:                SANYO

    Once the laptop switches the unit to mWh (unplug from mains, suspend,
    resume), the output changes to:

    present:                 yes
    design capacity:         28860 mWh
    last full capacity:      29090 mWh
    battery technology:      rechargeable
    design voltage:          14800 mV
    design capacity warning: 1454 mWh
    design capacity low:     200 mWh
    cycle count:              0
    capacity granularity 1:  1 mWh
    capacity granularity 2:  1 mWh
    model number:            42T4899
    serial number:           21064
    battery type:            LION
    OEM info:                SANYO

    Can you see how the values for "design capacity", etc., differ by a
    factor of 10 instead of 14.8 (the design voltage of this battery)?
    On the battery itself it says: 14.8V, 1.95Ah, 29Wh, so clearly the
    values reported in mWh are correct and the ones in mAh are not.

    My guess is that this problem has been around ever since those
    machines were released, but because the most common Thinkpad
    batteries are rated at 10.8V, the error (8%) is small enough that it
    simply hasn't been noticed or at least nobody could be bothered to
    look into it.

    My patch works around the problem by adjusting the incorrectly
    reported mAh values by "10000 / design_voltage".  The patch also has
    code to figure out if it should be activated or not.  It only
    activates on Lenovo Thinkpads, only when the unit is mAh, and, as an
    extra precaution, only when the battery capacity reported through
    ACPI does not match what is reported through DMI (I've never
    encountered a machine where the first two conditions would be true
    but the last would not, but better safe than sorry).

    I've been using this patch for close to a year on several systems
    without any problems.

    References: https://bugzilla.kernel.org/show_bug.cgi?id=41062
    Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    (cherry picked from commit fd013d71a5bcb2b96275ac4664f73afa00992b88)

commit 4bae335adada2c7f966354116ac837c6a41e4bed
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Wed Nov 28 10:19:16 2012 -0800

    USB: mark uas driver as BROKEN

    commit fb37ef98015f864d22be223a0e0d93547cd1d4ef upstream.

    As reported https://bugzilla.kernel.org/show_bug.cgi?id=51031, the UAS
    driver causes problems and has been asked to be not built into any of
    the major distributions.  To prevent users from running into problems
    with it, and for distros that were not notified, just mark the whole
    thing as broken.

    Acked-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    (cherry picked from commit 092082a9f2c251b41e8af361177b35b1080545cf)

commit ef2212532f54f5ef7ec3bc5cf076941e75c87232
Author: Markus Becker <mab@comnets.uni-bremen.de>
Date:   Thu Nov 22 09:41:23 2012 +0100

    USB: cp210x: add Virtenio Preon32 device id

    commit 356fe44f4b8ece867bdb9876b1854d7adbef9de2 upstream.

    Signed-off-by: Markus Becker <mab@comnets.uni-bremen.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    (cherry picked from commit f1ac9731feae15bb3ca5a1cf8d90a718a71264fe)

commit b7e02ff5bec9370163a8d822a14cbc8e6458f8bd
Author: Peter Korsgaard <jacmet@sunsite.dk>
Date:   Thu Nov 22 16:30:46 2012 +0100

    usb: ftdi_sio: fixup BeagleBone A5+ quirk

    commit 1a88d5eee2ef2ad1d3c4e32043e9c4c5347d4fc1 upstream.

    BeagleBone A5+ devices ended up getting shipped with the
    'BeagleBone/XDS100V2' product string, and not XDS100 like it
    was agreed, so adjust the quirk to match.

    For details, see the thread on the beagle list:

    https://groups.google.com/forum/#!msg/beagleboard/zrFPew9_Wvo/ibWr1-eE8JwJ

    Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    (cherry picked from commit d57cab55e04ba2ee33d8e211d4057e90a34cd291)

commit 111e55bfe7800eba02e506902c7eafd22d5f742f
Author: Martin Teichmann <lkb.teichmann@gmail.com>
Date:   Wed Nov 21 16:45:07 2012 +0100

    USB: ftdi_sio: Add support for Newport AGILIS motor drivers

    commit d7e14b375b40c04cd735b115713043b69a2c68ac upstream.

    The Newport AGILIS model AG-UC8 compact piezo motor controller
    (http://search.newport.com/?q=*&x2=sku&q2=AG-UC8)
    is yet another device using an FTDI USB-to-serial chip. It works
    fine with the ftdi_sio driver when adding

      options ftdi-sio product=0x3000 vendor=0x104d

    to modprobe.d. udevadm reports "Newport" as the manufacturer,
    and "Agilis" as the product name.

    Signed-off-by: Martin Teichmann <lkb.teichmann@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    (cherry picked from commit 3ffab0bf0dbcccc4909c92e937a50a6caccca3d8)

commit cbbc68fdacf94102ab46aa5aa3a399c4a262bfe9
Author: Bjørn Mork <bjorn@mork.no>
Date:   Sun Nov 25 17:05:10 2012 +0100

    USB: option: blacklist network interface on Huawei E173

    commit f36446cf9bbebaa03a80d95cfeeafbaf68218249 upstream.

    The Huawei E173 will normally appear as 12d1:1436 in Linux.  But
    the modem has another mode with different device ID and a slightly
    different set of descriptors. This is the mode used by Windows like
    this:

      3Modem:      USB\VID_12D1&PID_140C&MI_00\6&3A1D2012&0&0000
      Networkcard: USB\VID_12D1&PID_140C&MI_01\6&3A1D2012&0&0001
      Appli.Inter: USB\VID_12D1&PID_140C&MI_02\6&3A1D2012&0&0002
      PC UI Inter: USB\VID_12D1&PID_140C&MI_03\6&3A1D2012&0&0003

    All interfaces have the same ff/ff/ff class codes in this mode.
    Blacklisting the network interface to allow it to be picked up by
    the network driver.

    Reported-by: Thomas Schäfer <tschaefer@t-online.de>
    Signed-off-by: Bjørn Mork <bjorn@mork.no>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    (cherry picked from commit ea337d3990dd7111d70a6e960a7ee4dd361c4a20)

commit a38895f11bc3cd5b6d51425714d290d2032d65e7
Author: li.rui27@zte.com.cn <li.rui27@zte.com.cn>
Date:   Tue Nov 20 14:31:47 2012 +0800

    USB: add new zte 3g-dongle's pid to option.c

    commit 31b6a1048b7292efff8b5b53ae3d9d29adde385e upstream.

    Signed-off-by: Rui li <li.rui27@zte.com.cn>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    (cherry picked from commit 1d28af1c4bf8fed8acfd93fbd93ec5e5fc42197b)

commit 4632df77d204818acba38cfd9e4f0730d67ea9eb
Author: Jan Beulich <JBeulich@suse.com>
Date:   Fri Nov 2 14:02:40 2012 +0000

    x86: hpet: Fix masking of MSI interrupts

    commit 6acf5a8c931da9d26c8dd77d784daaf07fa2bff0 upstream.

    HPET_TN_FSB is not a proper mask bit; it merely toggles between MSI and
    legacy interrupt delivery. The proper mask bit is HPET_TN_ENABLE, so
    use both bits when (un)masking the interrupt.

    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Link: http://lkml.kernel.org/r/5093E09002000078000A60E6@nat28.tlf.novell.com
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    (cherry picked from commit 29a4f067f96ca79c1090e09c1bb83f3c167b43ac)

commit 483a64611e18ecdc81983d8b42f2f6a469079602
Author: Mel Gorman <mgorman@suse.de>
Date:   Wed Dec 5 14:01:41 2012 -0800

    tmpfs: fix shared mempolicy leak

    commit 18a2f371f5edf41810f6469cb9be39931ef9deb9 upstream.

    This fixes a regression in 3.7-rc, which has since gone into stable.

    Commit 00442ad04a5e ("mempolicy: fix a memory corruption by refcount
    imbalance in alloc_pages_vma()") changed get_vma_policy() to raise the
    refcount on a shmem shared mempolicy; whereas shmem_alloc_page() went
    on expecting alloc_page_vma() to drop the refcount it had acquired.
    This deserves a rework: but for now fix the leak in shmem_alloc_page().

    Hugh: shmem_swapin() did not need a fix, but surely it's clearer to use
    the same refcounting there as in shmem_alloc_page(), delete its onstack
    mempolicy, and the strange mpol_cond_copy() and __mpol_cond_copy() -
    those were invented to let swapin_readahead() make an unknown number of
    calls to alloc_pages_vma() with one mempolicy; but since 00442ad04a5e,
    alloc_pages_vma() has kept refcount in balance, so now no problem.

    Reported-and-tested-by: Tommi Rantala <tt.rantala@gmail.com>
    Signed-off-by: Mel Gorman <mgorman@suse.de>
    Signed-off-by: Hugh Dickins <hughd@google.com>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    (cherry picked from commit 15487eba1006de0db3c8d9f78ef16700a4d0a217)

commit ebbf197cc5b4a72a0f40105f915d7e42bad475b8
Author: Dan Carpenter <dan.carpenter@oracle.com>
Date:   Mon Dec 3 22:05:12 2012 +0300

    telephony: ijx: buffer overflow in ixj_write_cid()

    [Not needed in 3.8 or newer as this driver is removed there. - gregkh]

    We get this from user space and nothing has been done to ensure that
    these strings are NUL terminated.

    Reported-by: Chen Gang <gang.chen@asianux.com>
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    (cherry picked from commit d2e08635c22a9222f606062b42a7ad656f6a8584)

commit 7d91d1286e2bf51c8fe82c97d7ee5eb3e838caba
Author: Boris Ostrovsky <boris.ostrovsky@amd.com>
Date:   Wed Dec 5 06:12:42 2012 -0500

    x86,AMD: Power driver support for AMD's family 16h processors

    commit 22e32f4f57778ebc6e17812fa3008361c05d64f9 upstream.

    Add family 16h PCI ID to AMD's power driver to allow it report
    power consumption on these processors.

    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com>
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    (cherry picked from commit cde5ccfd7fff61f9b652dc7b42a40168e3e45f93)

commit 354a9e21faf11c1cd7951886782590dd35667f91
Author: Marek Szyprowski <m.szyprowski@samsung.com>
Date:   Wed Nov 7 15:37:07 2012 +0100

    mm: dmapool: use provided gfp flags for all dma_alloc_coherent() calls

    commit 387870f2d6d679746020fa8e25ef786ff338dc98 upstream.

    dmapool always calls dma_alloc_coherent() with GFP_ATOMIC flag,
    regardless the flags provided by the caller. This causes excessive
    pruning of emergency memory pools without any good reason. Additionaly,
    on ARM architecture any driver which is using dmapools will sooner or
    later  trigger the following error:
    "ERROR: 256 KiB atomic DMA coherent pool is too small!
    Please increase it with coherent_pool= kernel parameter!".
    Increasing the coherent pool size usually doesn't help much and only
    delays such error, because all GFP_ATOMIC DMA allocations are always
    served from the special, very limited memory pool.

    This patch changes the dmapool code to correctly use gfp flags provided
    by the dmapool caller.

    Reported-by: Soeren Moch <smoch@web.de>
    Reported-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
    Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
    Tested-by: Andrew Lunn <andrew@lunn.ch>
    Tested-by: Soeren Moch <smoch@web.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    (cherry picked from commit b9f21c252726e320c3878d9206571e2178cafd10)

commit 67a78500da79b4a0fe81055b9d81bff3c622f989
Author: Tejun Heo <tj@kernel.org>
Date:   Tue Dec 4 07:40:39 2012 -0800

    workqueue: convert BUG_ON()s in __queue_delayed_work() to WARN_ON_ONCE()s

    commit fc4b514f2727f74a4587c31db87e0e93465518c3 upstream.

    8852aac25e ("workqueue: mod_delayed_work_on() shouldn't queue timer on
    0 delay") unexpectedly uncovered a very nasty abuse of delayed_work in
    megaraid - it allocated work_struct, casted it to delayed_work and
    then pass that into queue_delayed_work().

    Previously, this was okay because 0 @delay short-circuited to
    queue_work() before doing anything with delayed_work.  8852aac25e
    moved 0 @delay test into __queue_delayed_work() after sanity check on
    delayed_work making megaraid trigger BUG_ON().

    Although megaraid is already fixed by c1d390d8e6 ("megaraid: fix
    BUG_ON() from incorrect use of delayed work"), this patch converts
    BUG_ON()s in __queue_delayed_work() to WARN_ON_ONCE()s so that such
    abusers, if there are more, trigger warning but don't crash the
    machine.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Cc: Xiaotian Feng <xtfeng@gmail.com>
    Signed-off-by: Shuah Khan <shuah.khan@hp.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    (cherry picked from commit 3ff0aeceb49aca3f99c37189e949bf43bfd393a0)

commit ce6da8658f0294d5afba372820a9679c38c96972
Author: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date:   Mon Sep 26 19:37:57 2011 +0000

    powerpc/ptrace: Fix build with gcc 4.6

    commit e69b742a6793dc5bf16f6eedca534d4bc10d68b2 upstream.

    gcc (rightfully) complains that we are accessing beyond the
    end of the fpr array (we do, to access the fpscr).

    The only sane thing to do (whether anything in that code can be
    called remotely sane is debatable) is to special case fpscr and
    handle it as a separate statement.

    I initially tried to do it it by making the array access conditional
    to index < PT_FPSCR and using a 3rd else leg but for some reason gcc
    was unable to understand it and still spewed the warning.

    So I ended up with something a tad more intricated but it seems to
    build on 32-bit and on 64-bit with and without VSX.

    Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    Signed-off-by: Michael Neuling <mikey@neuling.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    (cherry picked from commit f2a1abc8cfa0220a550c5a54440a5e97ef025899)

commit dc571b1853447bb6e2bd500f745a05adf402e285
Author: Paul Walmsley <paul@pwsan.com>
Date:   Tue Oct 23 20:32:59 2012 +0100

    ARM: 7566/1: vfp: fix save and restore when running on pre-VFPv3 and CONFIG_VFPv3 set

    commit 39141ddfb63a664f26d3f42f64ee386e879b492c upstream.

    After commit 846a136881b8f73c1f74250bf6acfaa309cab1f2 ("ARM: vfp: fix
    saving d16-d31 vfp registers on v6+ kernels"), the OMAP 2430SDP board
    started crashing during boot with omap2plus_defconfig:

    [    3.875122] mmcblk0: mmc0:e624 SD04G 3.69 GiB
    [    3.915954]  mmcblk0: p1
    [    4.086639] Internal error: Oops - undefined instruction: 0 [#1] SMP ARM
    [    4.093719] Modules linked in:
    [    4.096954] CPU: 0    Not tainted  (3.6.0-02232-g759e00b #570)
    [    4.103149] PC is at vfp_reload_hw+0x1c/0x44
    [    4.107666] LR is at __und_usr_fault_32+0x0/0x8

    It turns out that the context save/restore fix unmasked a latent bug
    in commit 5aaf254409f8d58229107b59507a8235b715a960 ("ARM: 6203/1: Make
    VFPv3 usable on ARMv6").  When CONFIG_VFPv3 is set, but the kernel is
    booted on a pre-VFPv3 core, the code attempts to save and restore the
    d16-d31 VFP registers.  These are only present on non-D16 VFPv3+, so
    this results in an undefined instruction exception.  The code didn't
    crash before commit 846a136 because the save and restore code was
    only touching d0-d15, present on all VFP.

    Fix by implementing a request from Russell King to add a new HWCAP
    flag that affirmatively indicates the presence of the d16-d31
    registers:

       http://marc.info/?l=linux-arm-kernel&m=135013547905283&w=2

    and some feedback from Måns to clarify the name of the HWCAP flag.

    Signed-off-by: Paul Walmsley <paul@pwsan.com>
    Cc: Tony Lindgren <tony@atomide.com>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Dave Martin <dave.martin@linaro.org>
    Cc: Måns Rullgård <mans.rullgard@linaro.org>
    Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
    Cc: Ben Hutchings <ben@decadent.org.uk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    (cherry picked from commit 15a83cc22d40240f1f551b4c2092f7f246bdbfce)

    Conflicts:

    	arch/arm/include/asm/hwcap.h

commit c7b7d73b4893513a47cc141305c8e5a7eb577822
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Mon Dec 10 10:45:23 2012 -0800

    Linux 3.0.56
    (cherry picked from commit 4eb15b7fe7ad2a055f79eb1056a0c2d3317ff6f0)

commit cfc4d74bacc281ace2ac22bfd5b9d5ec02160bda
Author: Jan Kara <jack@suse.cz>
Date:   Fri Jun 15 12:52:46 2012 +0200

    scsi: Silence unnecessary warnings about ioctl to partition

    commit 6d9359280753d2955f86d6411047516a9431eb51 upstream.

    Sometimes, warnings about ioctls to partition happen often enough that they
    form majority of the warnings in the kernel log and users complain. In some
    cases warnings are about ioctls such as SG_IO so it's not good to get rid of
    the warnings completely as they can ease debugging of userspace problems
    when ioctl is refused.

    Since I have seen warnings from lots of commands, including some proprietary
    userspace applications, I don't think disallowing the ioctls for processes
    with CAP_SYS_RAWIO will happen in the near future if ever. So lets just
    stop warning for processes with CAP_SYS_RAWIO for which ioctl is allowed.

    Acked-by: Paolo Bonzini <pbonzini@redhat.com>
    CC: James Bottomley <JBottomley@parallels.com>
    CC: linux-scsi@vger.kernel.org
    Signed-off-by: Jan Kara <jack@suse.cz>
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    Cc: Satoru Takeuchi <satoru.takeuchi@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    (cherry picked from commit 90123275293f831d36dfd1fcfc78afa6c3563f0b)

commit 306054a6fa251a5486bafb40ab3317055173ab87
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Oct 18 21:07:01 2012 +0100

    drm/i915: Add no-lvds quirk for Supermicro X7SPA-H

    commit c31407a3672aaebb4acddf90944a114fa5c8af7b upstream.

    Reported-and-tested-by: Francois Tigeot <ftigeot@wolfpond.org>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55375
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    (cherry picked from commit 95b471a707674130b996f4733e1a9ec983b11924)

commit 0a8234bad61791ed69dff9dd773d46421155127a
Author: Calvin Walton <calvin.walton@kepstin.ca>
Date:   Fri Aug 24 07:56:31 2012 -0400

    i915: Quirk no_lvds on Gigabyte GA-D525TUD ITX motherboard

    commit a51d4ed01e5bb39d2cf36a12f9976ab08872c192 upstream.

    This board is incorrectly detected as having an LVDS connector,
    resulting in the VGA output (the only available output on the board)
    showing the console only in the top-left 1024x768 pixels, and an extra
    LVDS connector appearing in X.

    It's a desktop Mini-ITX board using an Atom D525 CPU with an NM10
    chipset.

    I've had this board for about a year, but this is the first time I
    noticed the issue because I've been running it headless for most of its
    life.

    Signed-off-by: Calvin Walton <calvin.walton@kepstin.ca>
    Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    (cherry picked from commit 4d574d2d820404722fd822c0bca6dcbd55cf4f9a)

commit bff209fce0a4e75485cc7d9fa1e07641fd26539f
Author: Alan Cox <alan@linux.intel.com>
Date:   Fri Oct 26 01:05:56 2012 +0200

    ACPI: missing break

    commit 879dca019dc43a1622edca3e7dde644b14b5acc5 upstream.

    We handle NOTIFY_THROTTLING so don't then fall through to unsupported event.

    Signed-off-by: Alan Cox <alan@linux.intel.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    (cherry picked from commit b0ce22dd5b5136048080fa14572178bbe9cb5aba)

commit fc3551a3b082687fcadf146cbf0a444651050120
Author: Michal Kubecek <mkubecek@suse.cz>
Date:   Tue Dec 4 11:09:13 2012 +0100

    route: release dst_entry.hh_cache when handling redirects

    Stable-3.0 commit 42ab5316 (ipv4: fix redirect handling) was
    backport of mainline commit 9cc20b26 from 3.2-rc3 where hh
    member of struct dst_entry was already gone.

    However, in 3.0 we still have it and we have to clean it as
    well, otherwise it keeps pointing to the cleaned up (and
    unusable) hh_cache entry and packets cannot be sent out.

    Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
    Cc: Eric Dumazet <eric.dumazet@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    (cherry picked from commit bc436ddffc68d8c9e3e2e69e3253445af85c0881)

commit 706abd164770855c0972ee1c140c856d35d6aa3e
Author: Mike Galbraith <efault@gmx.de>
Date:   Mon Dec 3 06:25:25 2012 +0100

    Revert "sched, autogroup: Stop going ahead if autogroup is disabled"

    commit fd8ef11730f1d03d5d6555aa53126e9e34f52f12 upstream.

    This reverts commit 800d4d30c8f20bd728e5741a3b77c4859a613f7c.

    Between commits 8323f26ce342 ("sched: Fix race in task_group()") and
    800d4d30c8f2 ("sched, autogroup: Stop going ahead if autogroup is
    disabled"), autogroup is a wreck.

    With both applied, all you have to do to crash a box is disable
    autogroup during boot up, then reboot..  boom, NULL pointer dereference
    due to commit 800d4d30c8f2 not allowing autogroup to move things, and
    commit 8323f26ce342 making that the only way to switch runqueues:

      BUG: unable to handle kernel NULL pointer dereference at           (null)
      IP: [<ffffffff81063ac0>] effective_load.isra.43+0x50/0x90
      Pid: 7047, comm: systemd-user-se Not tainted 3.6.8-smp #7 MEDIONPC MS-7502/MS-7502
      RIP: effective_load.isra.43+0x50/0x90
      Process systemd-user-se (pid: 7047, threadinfo ffff880221dde000, task ffff88022618b3a0)
      Call Trace:
        select_task_rq_fair+0x255/0x780
        try_to_wake_up+0x156/0x2c0
        wake_up_state+0xb/0x10
        signal_wake_up+0x28/0x40
        complete_signal+0x1d6/0x250
        __send_signal+0x170/0x310
        send_signal+0x40/0x80
        do_send_sig_info+0x47/0x90
        group_send_sig_info+0x4a/0x70
        kill_pid_info+0x3a/0x60
        sys_kill+0x97/0x1a0
        ? vfs_read+0x120/0x160
        ? sys_read+0x45/0x90
        system_call_fastpath+0x16/0x1b
      Code: 49 0f af 41 50 31 d2 49 f7 f0 48 83 f8 01 48 0f 46 c6 48 2b 07 48 8b bf 40 01 00 00 48 85 ff 74 3a 45 31 c0 48 8b 8f 50 01 00 00 <48> 8b 11 4c 8b 89 80 00 00 00 49 89 d2 48 01 d0 45 8b 59 58 4c
      RIP  [<ffffffff81063ac0>] effective_load.isra.43+0x50/0x90
       RSP <ffff880221ddfbd8>
      CR2: 0000000000000000

    Signed-off-by: Mike Galbraith <efault@gmx.de>
    Acked-by: Ingo Molnar <mingo@kernel.org>
    Cc: Yong Zhang <yong.zhang0@gmail.com>
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    (cherry picked from commit e86b690c9659a03d8a6bb7ded18894718ab64360)

commit 86bea78ab190e889008bac0ae6dfc3468b28efdd
Author: Mike Galbraith <mgalbraith@suse.de>
Date:   Wed Nov 28 07:17:18 2012 +0100

    workqueue: exit rescuer_thread() as TASK_RUNNING

    commit 412d32e6c98527078779e5b515823b2810e40324 upstream.

    A rescue thread exiting TASK_INTERRUPTIBLE can lead to a task scheduling
    off, never to be seen again.  In the case where this occurred, an exiting
    thread hit reiserfs homebrew conditional resched while holding a mutex,
    bringing the box to its knees.

    PID: 18105  TASK: ffff8807fd412180  CPU: 5   COMMAND: "kdmflush"
     #0 [ffff8808157e7670] schedule at ffffffff8143f489
     #1 [ffff8808157e77b8] reiserfs_get_block at ffffffffa038ab2d [reiserfs]
     #2 [ffff8808157e79a8] __block_write_begin at ffffffff8117fb14
     #3 [ffff8808157e7a98] reiserfs_write_begin at ffffffffa0388695 [reiserfs]
     #4 [ffff8808157e7ad8] generic_perform_write at ffffffff810ee9e2
     #5 [ffff8808157e7b58] generic_file_buffered_write at ffffffff810eeb41
     #6 [ffff8808157e7ba8] __generic_file_aio_write at ffffffff810f1a3a
     #7 [ffff8808157e7c58] generic_file_aio_write at ffffffff810f1c88
     #8 [ffff8808157e7cc8] do_sync_write at ffffffff8114f850
     #9 [ffff8808157e7dd8] do_acct_process at ffffffff810a268f
        [exception RIP: kernel_thread_helper]
        RIP: ffffffff8144a5c0  RSP: ffff8808157e7f58  RFLAGS: 00000202
        RAX: 0000000000000000  RBX: 0000000000000000  RCX: 0000000000000000
        RDX: 0000000000000000  RSI: ffffffff8107af60  RDI: ffff8803ee491d18
        RBP: 0000000000000000   R8: 0000000000000000   R9: 0000000000000000
        R10: 0000000000000000  R11: 0000000000000000  R12: 0000000000000000
        R13: 0000000000000000  R14: 0000000000000000  R15: 0000000000000000
        ORIG_RAX: ffffffffffffffff  CS: 0010  SS: 0018

    Signed-off-by: Mike Galbraith <mgalbraith@suse.de>
    Signed-off-by: Tejun Heo <tj@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    (cherry picked from commit cc3c85dfa1a7e8d32c6e625176269f9dff88447d)

commit ba71fe954e6d2ba6399f35bcab996950c1233c8d
Author: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Date:   Thu Nov 29 13:54:34 2012 -0800

    mm: soft offline: split thp at the beginning of soft_offline_page()

    commit 783657a7dc20e5c0efbc9a09a9dd38e238a723da upstream.

    When we try to soft-offline a thp tail page, put_page() is called on the
    tail page unthinkingly and VM_BUG_ON is triggered in put_compound_page().

    This patch splits thp before going into the main body of soft-offlining.

    Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
    Cc: Andi Kleen <andi@firstfloor.org>
    Cc: Tony Luck <tony.luck@intel.com>
    Cc: Andi Kleen <andi.kleen@intel.com>
    Cc: Wu Fengguang <fengguang.wu@intel.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    (cherry picked from commit 11bcecc86d062fc22dcdf2c296b447bd21f25e8c)

commit 772b0c5f294fbba86d13730d86b5d393419684d4
Author: Jianguo Wu <wujianguo@huawei.com>
Date:   Thu Nov 29 13:54:21 2012 -0800

    mm/vmemmap: fix wrong use of virt_to_page

    commit ae64ffcac35de0db628ba9631edf8ff34c5cd7ac upstream.

    I enable CONFIG_DEBUG_VIRTUAL and CONFIG_SPARSEMEM_VMEMMAP, when doing
    memory hotremove, there is a kernel BUG at arch/x86/mm/physaddr.c:20.

    It is caused by free_section_usemap()->virt_to_page(), virt_to_page() is
    only used for kernel direct mapping address, but sparse-vmemmap uses
    vmemmap address, so it is going wrong here.

      ------------[ cut here ]------------
      kernel BUG at arch/x86/mm/physaddr.c:20!
      invalid opcode: 0000 [#1] SMP
      Modules linked in: acpihp_drv acpihp_slot edd cpufreq_conservative cpufreq_userspace cpufreq_powersave acpi_cpufreq mperf fuse vfat fat loop dm_mod coretemp kvm crc32c_intel ipv6 ixgbe igb iTCO_wdt i7core_edac edac_core pcspkr iTCO_vendor_support ioatdma microcode joydev sr_mod i2c_i801 dca lpc_ich mfd_core mdio tpm_tis i2c_core hid_generic tpm cdrom sg tpm_bios rtc_cmos button ext3 jbd mbcache usbhid hid uhci_hcd ehci_hcd usbcore usb_common sd_mod crc_t10dif processor thermal_sys hwmon scsi_dh_alua scsi_dh_hp_sw scsi_dh_rdac scsi_dh_emc scsi_dh ata_generic ata_piix libata megaraid_sas scsi_mod
      CPU 39
      Pid: 6454, comm: sh Not tainted 3.7.0-rc1-acpihp-final+ #45 QCI QSSC-S4R/QSSC-S4R
      RIP: 0010:[<ffffffff8103c908>]  [<ffffffff8103c908>] __phys_addr+0x88/0x90
      RSP: 0018:ffff8804440d7c08  EFLAGS: 00010006
      RAX: 0000000000000006 RBX: ffffea0012000000 RCX: 000000000000002c
      ...

    Signed-off-by: Jianguo Wu <wujianguo@huawei.com>
    Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
    Reviewd-by: Wen Congyang <wency@cn.fujitsu.com>
    Acked-by: Johannes Weiner <hannes@cmpxchg.org>
    Reviewed-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
    Reviewed-by: Michal Hocko <mhocko@suse.cz>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    (cherry picked from commit 8bec6507e7073b4573e29d4990b4eebd3aa32abf)

commit 54c23aece3a153b8aab6f71979ae5029f5a9c9c4
Author: Russell King - ARM Linux <linux@arm.linux.org.uk>
Date:   Sun Nov 18 16:39:32 2012 +0000

    Dove: Fix irq_to_pmu()

    commit d356cf5a74afa32b40decca3c9dd88bc3cd63eb5 upstream.

    PMU interrupts start at IRQ_DOVE_PMU_START, not IRQ_DOVE_PMU_START + 1.
    Fix the condition.  (It may have been less likely to occur had the code
    been written "if (irq >= IRQ_DOVE_PMU_START" which imho is the easier
    to understand notation, and matches the normal way of thinking about
    these things.)

    Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
    Signed-off-by: Jason Cooper <jason@lakedaemon.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    (cherry picked from commit 6d62cb399dbff7dbb354c3b4eae534ee0c0e5dc0)

commit 33e65c7111b4ca0bde017309ab98e3284efbcadf
Author: Russell King - ARM Linux <linux@arm.linux.org.uk>
Date:   Sun Nov 18 16:29:44 2012 +0000

    Dove: Attempt to fix PMU/RTC interrupts

    commit 5d3df935426271016b895aecaa247101b4bfa35e upstream.

    Fix the acknowledgement of PMU interrupts on Dove: some Dove hardware
    has not been sensibly designed so that interrupts can be handled in a
    race free manner.  The PMU is one such instance.

    The pending (aka 'cause') register is a bunch of RW bits, meaning that
    these bits can be both cleared and set by software (confirmed on the
    Armada-510 on the cubox.)

    Hardware sets the appropriate bit when an interrupt is asserted, and
    software is required to clear the bits which are to be processed.  If
    we write ~(1 << bit), then we end up asserting every other interrupt
    except the one we're processing.  So, we need to do a read-modify-write
    cycle to clear the asserted bit.

    However, any interrupts which occur in the middle of this cycle will
    also be written back as zero, which will also clear the new interrupts.

    The upshot of this is: there is _no_ way to safely clear down interrupts
    in this register (and other similarly behaving interrupt pending
    registers on this device.)  The patch below at least stops us creating
    new interrupts.

    Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
    Signed-off-by: Jason Cooper <jason@lakedaemon.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    (cherry picked from commit 31a2aa119dd0b760b0931e6dfa0847a697d6d7d6)

commit 7391dac2ed839562733d77c0aec5cc4c33c6db2b
Author: hei <hei@Nova-Box.(none)>
Date:   Sat Dec 22 15:31:41 2012 +0800

    configs: some updates

commit 1f66cf6a41104e56d2097cb27d8ab7b98c874fd6
Author: hei <hei@Nova-Box.(none)>
Date:   Sun Dec 9 21:09:15 2012 +0800

    Cleanup

commit 18a8dbdcff6903dda97c14b22aa028ab22c588e8
Author: hei <hei@Nova-Box.(none)>
Date:   Thu Dec 20 14:44:12 2012 +0800

    Add missing codes

    Conflicts:

    	include/linux/cpufreq.h

commit 578957d09cd6e15842701d3920f361d922dccbcf
Author: hei <hei@Nova-Box.(none)>
Date:   Sun Dec 9 21:05:05 2012 +0800

    Add Lagfree & Wheatley Governor

commit 272428f29300e6b81746176ebfda22e6fbfd0409
Author: hei <hei@Nova-Box.(none)>
Date:   Sun Dec 9 20:57:27 2012 +0800

    Add Badass Governor

commit efa6728886052956c6ec03485c4676a27d065fd2
Author: hei <hei@Nova-Box.(none)>
Date:   Fri Dec 7 21:23:21 2012 +0800

    block/deadline: tweaked for better performance on android
    Signed-off-by: faux123 <reioux@gmail.com>

commit 4999af294109e0dffd5dde621a9321245ec2802d
Author: hei <hei@Nova-Box.(none)>
Date:   Fri Dec 7 21:20:44 2012 +0800

    iosched: prevent aliased requests from starving other I/O

commit 5be3c796b3368c90202cc5e79f55d37e83e176a4
Author: hei <hei@Nova-Box.(none)>
Date:   Fri Dec 7 21:07:14 2012 +0800

    Tweaked Ondemand & Conservative Governor

commit b18b4420a29a3b32c4d62684c6c453b27ef17773
Author: hei <hei@Nova-Box.(none)>
Date:   Fri Dec 7 21:10:02 2012 +0800

    Asynchronous I/O latency to a solid-state disk greatly increased

commit d7eb5a163b8fa78fd309297a8a83eb8caf937d6a
Author: hei <hei@Nova-Box.(none)>
Date:   Wed Dec 5 21:21:16 2012 +0800

    Implementation of SNAPPY for zram kernel 3.0.y

commit 73d3305f462a72861def6e4cddf489d95eb82ae1
Author: hei <hei@Nova-Box.(none)>
Date:   Wed Dec 5 21:17:17 2012 +0800

    Google Snappy Compression/Decompression Support

commit 88b9ccf28581c8ecade82adf783b46975b69085f
Author: Ezekeel <notezekeel@googlemail.com>
Date:   Thu Jan 5 01:20:49 2012 +0100

    Added optimized CRC32 algorithm.

commit 3d818a06002512ddcdbe95901c092cb4cf654001
Author: hei <hei@Nova-Box.(none)>
Date:   Sat Dec 22 15:18:49 2012 +0800

    configs: enable Arm CPU Topology and Sched_MC

commit 0e93391ce429c1ba8db14357c99ba14d800c6ab2
Author: Vincent Guittot <vincent.guittot@linaro.org>
Date:   Mon Feb 6 15:47:03 2012 +0100

    ARM: cpu topology: add debugfs

commit f2e2ef304579be522a616fb365255f511a732787
Author: Vincent Guittot <vincent.guittot@linaro.org>
Date:   Tue Jan 10 18:35:51 2012 +0100

    ARM: cpu topology: Add asym topology flag for using cpu0 1st

    Modify the CPU sched_domain flags in powersave mode for using the cpu0 in ched_mc powersave mode

    Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>

commit 7d1641d52f84c92bc0d1ae03401afab55f7955b4
Author: Vincent Guittot <vincent.guittot@linaro.org>
Date:   Mon Feb 6 15:46:03 2012 +0100

    ARM: topology: Add a topology update notification

commit b2364e5e8cb3403cda383fc26591ae7c1a8f93d0
Author: Vincent Guittot <vincent.guittot@linaro.org>
Date:   Tue Jan 10 18:15:57 2012 +0100

    ARM: topology: Add a cpu_power function

commit 26cdc4b1b5dc569942cc8b2b1da93ddf4ca97ebf
Author: Vincent Guittot <vincent.guittot@linaro.org>
Date:   Mon Feb 6 15:45:01 2012 +0100

    ARM: topology: Update topology according to current sched_mc mode

commit 2fe156c085ce6e351d2f4b5650dc0367c939e72b
Author: Vincent Guittot <vincent.guittot@linaro.org>
Date:   Mon Feb 6 15:43:36 2012 +0100

    ARM: topology: save cpu id of each core

commit 32b9ca5a6717d72886e0fed1da2bb58dfdedef57
Author: Vincent Guittot <vincent.guittot@linaro.org>
Date:   Tue Nov 29 15:50:20 2011 +0100

    ARM: 7182/1: ARM cpu topology: fix warning

    kernel/sched.c:7354:2: warning: initialization from incompatible pointer type

    Align cpu_coregroup_mask prototype interface with sched_domain_mask_f typedef
    use int cpu instead of unsigned int cpu

    Cc: <stable@vger.kernel.org>
    Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
    Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

commit 52def0fdba3e620256321859337581c085532c6d
Author: Vincent Guittot <vincent.guittot@linaro.org>
Date:   Mon Aug 8 13:21:59 2011 +0100

    ARM: 7011/1: Add ARM cpu topology definition

    The affinity between ARM processors is defined in the MPIDR register.
    We can identify which processors are in the same cluster,
    and which ones have performance interdependency. We can define the
    cpu topology of ARM platform, that is then used by sched_mc and sched_smt.

    The default state of sched_mc and sched_smt config is disable.
    When enabled, the behavior of the scheduler can be modified with
    sched_mc_power_savings and sched_smt_power_savings sysfs interfaces.

    Changes since v4 :
    *  Remove unnecessary parentheses and blank lines

    Changes since v3 :
    * Update the format of printk message
    * Remove blank line

    Changes since v2 :
    * Update the commit message and some comments

    Changes since v1 :
    * Update the commit message
    * Add read_cpuid_mpidr in arch/arm/include/asm/cputype.h
    * Modify header of arch/arm/kernel/topology.c
    * Modify tests and manipulation of MPIDR's bitfields
    * Modify the place and dependancy of the config
    * Modify Noop functions

    Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
    Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org>
    Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

    Conflicts:

    	arch/arm/kernel/smp.c