1. 03 Jan, 2013 40 commits
    • Jeff Cook's avatar
      Bluetooth: Add support for BCM20702A0 [0b05, 17b5] · 9ca39c6d
      Jeff Cook authored
      commit 1ee3ff61 upstream.
      
      Vendor-specific ID for BCM20702A0.
      Support for bluetooth over Asus Wi-Fi GO!, included with Asus P8Z77-V
      Deluxe.
      
      T:  Bus=07 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#=  3 Spd=12  MxCh= 0
      D:  Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=0b05 ProdID=17b5 Rev=01.12
      S:  Manufacturer=Broadcom Corp
      S:  Product=BCM20702A0
      S:  SerialNumber=94DBC98AC113
      C:  #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=0mA
      I:  If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
      I:  If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
      I:  If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
      I:  If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=01 Driver=(none)
      Signed-off-by: default avatarJeff Cook <jeff@deserettechnology.com>
      Signed-off-by: default avatarGustavo Padovan <gustavo.padovan@collabora.co.uk>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      9ca39c6d
    • Marcos Chaparro's avatar
      Bluetooth: ath3k: Add support for VAIO VPCEH [0489:e027] · e030d8d5
      Marcos Chaparro authored
      commit acd94544 upstream.
      
      Added Atheros AR3011 internal bluetooth device found in Sony VAIO VPCEH to the
      devices list.
      Before this, the bluetooth module was identified as an Foxconn / Hai bluetooth
      device [0489:e027], now it claims to be an AtherosAR3011 Bluetooth
      [0cf3:3005].
      
      T:  Bus=01 Lev=02 Prnt=02 Port=04 Cnt=02 Dev#=  4 Spd=12   MxCh= 0
      D:  Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=0489 ProdID=e027 Rev= 0.01
      C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
      I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
      E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
      E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
      I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
      I:  If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
      I:  If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
      I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
      I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
      I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      Signed-off-by: default avatarMarcos Chaparro <marcos@mrkindustries.com.ar>
      Signed-off-by: default avatarGustavo Padovan <gustavo.padovan@collabora.co.uk>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      e030d8d5
    • Jaroslav Resler's avatar
      Bluetooth: Add support for BCM20702A0 [04ca, 2003] · ea321ea6
      Jaroslav Resler authored
      commit 0c1abbd1 upstream.
      
      Add another vendor specific ID for BCM20702A0.
      
      output of usb-devices:
      T:  Bus=01 Lev=02 Prnt=02 Port=03 Cnt=02 Dev#=  4 Spd=12   MxCh= 0
      D:  Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=04ca ProdID=2003 Rev= 1.12
      S:  Manufacturer=Broadcom Corp
      S:  Product=BCM20702A0
      S:  SerialNumber=446D57861623
      C:* #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=  0mA
      I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
      E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
      E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
      E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
      I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
      I:  If#= 1 Alt= 1 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
      I:  If#= 1 Alt= 2 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
      I:  If#= 1 Alt= 3 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
      I:  If#= 1 Alt= 4 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
      I:  If#= 1 Alt= 5 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
      E:  Ad=84(I) Atr=02(Bulk) MxPS=  32 Ivl=0ms
      E:  Ad=04(O) Atr=02(Bulk) MxPS=  32 Ivl=0ms
      I:* If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=01 Driver=(none)
      Signed-off-by: default avatarCho, Yu-Chen <acho@suse.com>
      Signed-off-by: default avatarGustavo Padovan <gustavo.padovan@collabora.co.uk>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      ea321ea6
    • Tejun Heo's avatar
      cgroup: remove incorrect dget/dput() pair in cgroup_create_dir() · 38819931
      Tejun Heo authored
      commit 17543163 upstream.
      
      cgroup_create_dir() does weird dancing with dentry refcnt.  On
      success, it gets and then puts it achieving nothing.  On failure, it
      puts but there isn't no matching get anywhere leading to the following
      oops if cgroup_create_file() fails for whatever reason.
      
        ------------[ cut here ]------------
        kernel BUG at /work/os/work/fs/dcache.c:552!
        invalid opcode: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
        Modules linked in:
        CPU 2
        Pid: 697, comm: mkdir Not tainted 3.7.0-rc4-work+ #3 Bochs Bochs
        RIP: 0010:[<ffffffff811d9c0c>]  [<ffffffff811d9c0c>] dput+0x1dc/0x1e0
        RSP: 0018:ffff88001a3ebef8  EFLAGS: 00010246
        RAX: 0000000000000000 RBX: ffff88000e5b1ef8 RCX: 0000000000000403
        RDX: 0000000000000303 RSI: 2000000000000000 RDI: ffff88000e5b1f58
        RBP: ffff88001a3ebf18 R08: ffffffff82c76960 R09: 0000000000000001
        R10: ffff880015022080 R11: ffd9bed70f48a041 R12: 00000000ffffffea
        R13: 0000000000000001 R14: ffff88000e5b1f58 R15: 00007fff57656d60
        FS:  00007ff05fcb3800(0000) GS:ffff88001fd00000(0000) knlGS:0000000000000000
        CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
        CR2: 00000000004046f0 CR3: 000000001315f000 CR4: 00000000000006e0
        DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
        DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
        Process mkdir (pid: 697, threadinfo ffff88001a3ea000, task ffff880015022080)
        Stack:
         ffff88001a3ebf48 00000000ffffffea 0000000000000001 0000000000000000
         ffff88001a3ebf38 ffffffff811cc889 0000000000000001 ffff88000e5b1ef8
         ffff88001a3ebf68 ffffffff811d1fc9 ffff8800198d7f18 ffff880019106ef8
        Call Trace:
         [<ffffffff811cc889>] done_path_create+0x19/0x50
         [<ffffffff811d1fc9>] sys_mkdirat+0x59/0x80
         [<ffffffff811d2009>] sys_mkdir+0x19/0x20
         [<ffffffff81be1e02>] system_call_fastpath+0x16/0x1b
        Code: 00 48 8d 90 18 01 00 00 48 89 93 c0 00 00 00 4c 89 a0 18 01 00 00 48 8b 83 a0 00 00 00 83 80 28 01 00 00 01 e8 e6 6f a0 00 eb 92 <0f> 0b 66 90 0f 1f 44 00 00 55 48 89 e5 41 57 41 56 49 89 fe 41
        RIP  [<ffffffff811d9c0c>] dput+0x1dc/0x1e0
         RSP <ffff88001a3ebef8>
        ---[ end trace 1277bcfd9561ddb0 ]---
      
      Fix it by dropping the unnecessary dget/dput() pair.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Acked-by: default avatarLi Zefan <lizefan@huawei.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      38819931
    • Kamil Iskra's avatar
      ACPI / battery: Correct battery capacity values on Thinkpads · fe0f5142
      Kamil Iskra authored
      commit 4000e626 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=41062Acked-by: default avatarHenrique de Moraes Holschuh <hmh@hmh.eng.br>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      fe0f5142
    • Dan Carpenter's avatar
      ftrace: Clear bits properly in reset_iter_read() · 2da23000
      Dan Carpenter authored
      commit 70f77b3f 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.mountainSigned-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      2da23000
    • Anton Blanchard's avatar
      powerpc: Fix CONFIG_RELOCATABLE=y CONFIG_CRASH_DUMP=n build · 30ed82e8
      Anton Blanchard authored
      commit 11ee7e99 upstream.
      
      If we build a kernel with CONFIG_RELOCATABLE=y CONFIG_CRASH_DUMP=n,
      the kernel fails when we run at a non zero offset. It turns out
      we were incorrectly wrapping some of the relocatable kernel code
      with CONFIG_CRASH_DUMP.
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      30ed82e8
    • Eric Sandeen's avatar
      ext4: init pagevec in ext4_da_block_invalidatepages · e14b8230
      Eric Sandeen authored
      commit 66bea92c upstream.
      
      ext4_da_block_invalidatepages is missing a pagevec_init(),
      which means that pvec->cold contains random garbage.
      
      This affects whether the page goes to the front or
      back of the LRU when ->cold makes it to
      free_hot_cold_page()
      Reviewed-by: default avatarLukas Czerner <lczerner@redhat.com>
      Reviewed-by: default avatarCarlos Maiolino <cmaiolino@redhat.com>
      Signed-off-by: default avatarEric Sandeen <sandeen@redhat.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      [bwh: Backported to 3.2: adjust context]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      e14b8230
    • Eric Dumazet's avatar
      rcu: Fix batch-limit size problem · 442a9939
      Eric Dumazet authored
      commit 878d7439 upstream.
      
      Commit 29c00b4a (rcu: Add event-tracing for RCU callback
      invocation) added a regression in rcu_do_batch()
      
      Under stress, RCU is supposed to allow to process all items in queue,
      instead of a batch of 10 items (blimit), but an integer overflow makes
      the effective limit being 1.  So, unless there is frequent idle periods
      (during which RCU ignores batch limits), RCU can be forced into a
      state where it cannot keep up with the callback-generation rate,
      eventually resulting in OOM.
      
      This commit therefore converts a few variables in rcu_do_batch() from
      int to long to fix this problem, along with the module parameters
      controlling the batch limits.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      [bwh: Backported to 3.2:
       - Adjust context
       - Module parameters remain hidden from sysfs]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      442a9939
    • Kevin McKinney's avatar
      Staging: bcm: Add two products and remove an existing product. · fc5884d2
      Kevin McKinney authored
      commit 4f29ef05 upstream.
      
      This patch adds two new products and modifies
      the device id table to include them. In addition,
      product of 0xbccd - BCM_USB_PRODUCT_ID_SM250 is
      removed because Beceem, ZTE, Sprint use this id
      for block devices.
      Reported-by: default avatarMuhammad Minhazul Haque <mdminhazulhaque@gmail.com>
      Signed-off-by: default avatarKevin McKinney <klmckinney1@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      [bwh: Backported to 3.2: adjust context]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      fc5884d2
    • Kevin McKinney's avatar
      Staging: bcm: Create and initialize new device id in InterfaceInit · bf78d712
      Kevin McKinney authored
      commit e66fc1fb upstream.
      
      This patch create and initalizes a new device
      id of 0x172 as reported by Rinat Camalov
      <richman1000000d@gmail.com>. In addition, a
      comment is added to the potential invalid
      existing device id.
      Reported-by: default avatarRinat Camalov <richman1000000d@gmail.com>
      Signed-off-by: default avatarKevin McKinney <klmckinney1@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      [bwh: Backported to 3.2: adjust context]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      bf78d712
    • Alexis R. Cortes's avatar
      usb: host: xhci: Stricter conditional for Z1 system models for Compliance Mode Patch · 8a79af94
      Alexis R. Cortes authored
      commit b0e4e606 upstream.
      
      This minor patch creates a more stricter conditional for the Z1 sytems for applying
      the Compliance Mode Patch, this to avoid the quirk to be applied to models that
      contain a "Z1" in their dmi product string but are different from Z1 systems.
      
      This patch should be backported to stable kernels as old as 3.2, that
      contain the commit 71c731a2 "usb: host:
      xhci: Fix Compliance Mode on SN65LVPE502CP Hardware"
      Signed-off-by: default avatarAlexis R. Cortes <alexis.cortes@ti.com>
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      8a79af94
    • Sarah Sharp's avatar
      xhci: Extend Fresco Logic MSI quirk. · ff90a661
      Sarah Sharp authored
      commit bba18e33 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 f5182b41 "xhci:
      Disable MSI for some Fresco Logic hosts."
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Reported-by: default avatarA Sh <smr.ash1991@gmail.com>
      Tested-by: default avatarA Sh <smr.ash1991@gmail.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      ff90a661
    • Julius Werner's avatar
      xhci: fix null-pointer dereference when destroying half-built segment rings · 84394041
      Julius Werner authored
      commit 68e5254a upstream.
      
      xhci_alloc_segments_for_ring() builds a list of xhci_segments and links
      the tail to head at the end (forming a ring). When it bails out for OOM
      reasons half-way through, it tries to destroy its half-built list with
      xhci_free_segments_for_ring(), even though it is not a ring yet. This
      causes a null-pointer dereference upon hitting the last element.
      
      Furthermore, one of its callers (xhci_ring_alloc()) mistakenly believes
      the output parameters to be valid upon this kind of OOM failure, and
      calls xhci_ring_free() on them. Since the (incomplete) list/ring should
      already be destroyed in that case, this would lead to a use after free.
      
      This patch fixes those issues by having xhci_alloc_segments_for_ring()
      destroy its half-built, non-circular list manually and destroying the
      invalid struct xhci_ring in xhci_ring_alloc() with a plain kfree().
      
      This patch should be backported to kernels as old as 2.6.31, that
      contains the commit 0ebbab37 "USB: xhci:
      Ring allocation and initialization."
      
      A separate patch will need to be developed for kernels older than 3.4,
      since the ring allocation code was refactored in that kernel.
      Signed-off-by: default avatarJulius Werner <jwerner@chromium.org>
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      [bwh: Backported to 3.2:
       - Adjust context
       - Since segment allocation is done directly in xhci_ring_alloc(), walk
         the list starting from ring->first_seg when freeing]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      84394041
    • Sarah Sharp's avatar
      xHCI: Fix TD Size calculation on 1.0 hosts. · 90d5eb03
      Sarah Sharp authored
      commit 4525c0a1 upstream.
      
      The xHCI 1.0 specification made a change to the TD Size field in TRBs.
      The value is now the number of packets that remain to be sent in the TD,
      not including this TRB.  The TD Size value for the last TRB in a TD must
      always be zero.
      
      The xHCI function xhci_v1_0_td_remainder() attempts to calculate this,
      but it gets it wrong.  First, it erroneously reuses the old
      xhci_td_remainder function, which will right shift the value by 10.  The
      xHCI 1.0 spec as of June 2011 says nothing about right shifting by 10.
      Second, it does not set the TD size for the last TRB in a TD to zero.
      
      Third, it uses roundup instead of DIV_ROUND_UP.  The total packet count
      is supposed to be the total number of bytes in this TD, divided by the
      max packet size, rounded up.  DIV_ROUND_UP is the right function to use
      in that case.
      
      With the old code, a TD on an endpoint with max packet size 1024 would
      be set up like so:
      TRB 1, TRB length = 600 bytes, TD size = 0
      TRB 1, TRB length = 200 bytes, TD size = 0
      TRB 1, TRB length = 100 bytes, TD size = 0
      
      With the new code, the TD would be set up like this:
      TRB 1, TRB length = 600 bytes, TD size = 1
      TRB 1, TRB length = 200 bytes, TD size = 1
      TRB 1, TRB length = 100 bytes, TD size = 0
      
      This commit should be backported to kernels as old as 3.0, that contain
      the commit 4da6e6f2 "xhci 1.0: Update TD
      size field format."
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Reported-by: default avatarChintan Mehta <chintan.mehta@sibridgetech.com>
      Reported-by: default avatarShimmer Huang <shimmering.h@gmail.com>
      Tested-by: default avatarBhavik Kothari <bhavik.kothari@sibridgetech.com>
      Tested-by: default avatarShimmer Huang <shimmering.h@gmail.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      90d5eb03
    • Sarah Sharp's avatar
      xhci: Fix conditional check in bandwidth calculation. · bd8faba0
      Sarah Sharp authored
      commit 392a07ae upstream.
      
      David reports that at drivers/usb/host/xhci.c:2257:
      
      static bool xhci_is_sync_in_ep(unsigned int ep_type)
      {
          return (ep_type == ISOC_IN_EP || ep_type != INT_IN_EP);
      }
      
      The static analyser cppcheck says
      
      [linux-3.7-rc2/drivers/usb/host/xhci.c:2257]: (style) Redundant condition: If ep_type == 5, the comparison ep_type != 7 is always true.
      
      Maybe the original programmer intention was something like
      
      static bool xhci_is_sync_in_ep(unsigned int ep_type)
      {
          return (ep_type == ISOC_IN_EP || ep_type == INT_IN_EP);
      }
      
      Fix this.
      
      This patch should be backported to stable kernels as old as 3.2, that
      contain the commit 2b698999 "xhci: USB
      3.0 BW checking."
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Reported-by: default avatarDavid Binderman <dcb314@hotmail.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      bd8faba0
    • Thomas Gleixner's avatar
      genirq: Always force thread affinity · b8bc4034
      Thomas Gleixner authored
      commit 04aa530e upstream.
      
      Sankara reported that the genirq core code fails to adjust the
      affinity of an interrupt thread in several cases:
      
       1) On request/setup_irq() the call to setup_affinity() happens before
          the new action is registered, so the new thread is not notified.
      
       2) For secondary shared interrupts nothing notifies the new thread to
          change its affinity.
      
       3) Interrupts which have the IRQ_NO_BALANCE flag set are not moving
          the thread either.
      
      Fix this by setting the thread affinity flag right on thread creation
      time. This ensures that under all circumstances the thread moves to
      the right place. Requires a check in irq_thread_check_affinity for an
      existing affinity mask (CONFIG_CPU_MASK_OFFSTACK=y)
      Reported-and-tested-by: default avatarSankara Muthukrishnan <sankara.m@gmail.com>
      Link: http://lkml.kernel.org/r/alpine.LFD.2.02.1209041738200.2754@ionosSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      b8bc4034
    • Alan Stern's avatar
      USB: EHCI: bugfix: urb->hcpriv should not be NULL · b9678188
      Alan Stern authored
      commit 2656a9ab upstream.
      
      This patch (as1632b) fixes a bug in ehci-hcd.  The USB core uses
      urb->hcpriv to determine whether or not an URB is active; host
      controller drivers are supposed to set this pointer to a non-NULL
      value when an URB is queued.  However ehci-hcd sets it to NULL for
      isochronous URBs, which defeats the check in usbcore.
      
      In itself this isn't a big deal.  But people have recently found that
      certain sequences of actions will cause the snd-usb-audio driver to
      reuse URBs without waiting for them to complete.  In the absence of
      proper checking by usbcore, the URBs get added to their endpoint list
      twice.  This leads to list corruption and a system freeze.
      
      The patch makes ehci-hcd assign a meaningful value to urb->hcpriv for
      isochronous URBs.  Improving robustness always helps.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Reported-by: default avatarArtem S. Tashkinov <t.artem@lycos.com>
      Reported-by: default avatarChristof Meerwald <cmeerw@cmeerw.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      [bwh: Backported to 3.2:
       - Adjust context
       - Also use usb_pipetype() to work out whether we should call qh_put()]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      b9678188
    • Alan Stern's avatar
      USB: fix endpoint-disabling for failed config changes · 0223d1ab
      Alan Stern authored
      commit 36caff5d upstream.
      
      This patch (as1631) fixes a bug that shows up when a config change
      fails for a device under an xHCI controller.  The controller needs to
      be told to disable the endpoints that have been enabled for the new
      config.  The existing code does this, but before storing the
      information about which endpoints were enabled!  As a result, any
      second attempt to install the new config is doomed to fail because
      xhci-hcd will refuse to enable an endpoint that is already enabled.
      
      The patch optimistically initializes the new endpoints' device
      structures before asking the device to switch to the new config.  If
      the request fails then the endpoint information is already stored, so
      we can use usb_hcd_alloc_bandwidth() to disable the endpoints with no
      trouble.  The rest of the error path is slightly more complex now; we
      have to disable the new interfaces and call put_device() rather than
      simply deallocating them.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Reported-and-tested-by: default avatarMatthias Schniedermeyer <ms@citd.de>
      CC: Sarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      [bwh: Backported to 3.2: adjust context]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      0223d1ab
    • Will Deacon's avatar
      ARM: mm: use pteval_t to represent page protection values · fa42c025
      Will Deacon authored
      commit 864aa04c upstream.
      
      When updating the page protection map after calculating the user_pgprot
      value, the base protection map is temporarily stored in an unsigned long
      type, causing truncation of the protection bits when LPAE is enabled.
      This effectively means that calls to mprotect() will corrupt the upper
      page attributes, clearing the XN bit unconditionally.
      
      This patch uses pteval_t to store the intermediate protection values,
      preserving the upper bits for 64-bit descriptors.
      Acked-by: default avatarNicolas Pitre <nico@linaro.org>
      Acked-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      fa42c025
    • Eugene Shatokhin's avatar
      ext4: fix memory leak in ext4_xattr_set_acl()'s error path · 8c1efde2
      Eugene Shatokhin authored
      commit 24ec19b0 upstream.
      
      In ext4_xattr_set_acl(), if ext4_journal_start() returns an error,
      posix_acl_release() will not be called for 'acl' which may result in a
      memory leak.
      
      This patch fixes that.
      Reviewed-by: default avatarLukas Czerner <lczerner@redhat.com>
      Signed-off-by: default avatarEugene Shatokhin <eugene.shatokhin@rosalab.ru>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      8c1efde2
    • Roland Dreier's avatar
      iscsi-target: Always send a response before terminating iSCSI connection · 9ef928b0
      Roland Dreier authored
      commit 1c5c12c6 upstream.
      
      There are some cases, for example when the initiator sends an
      out-of-bounds ErrorRecoveryLevel value, where the iSCSI target
      terminates the connection without sending back any error.  Audit the
      login path and add appropriate iscsit_tx_login_rsp() calls to make
      sure this doesn't happen.
      Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      [bwh: Backported to 3.2: adjust context]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      9ef928b0
    • Yanchuan Nian's avatar
      nfs: fix wrong object type in lockowner_slab · 74dd89a8
      Yanchuan Nian authored
      commit 3c40794b upstream.
      
      The object type in the cache of lockowner_slab is wrong, and it is
      better to fix it.
      Signed-off-by: default avatarYanchuan Nian <ycnian@gmail.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      74dd89a8
    • Sergei Shtylyov's avatar
      usb: musb: cppi_dma: export cppi_interrupt() · 72e6b965
      Sergei Shtylyov authored
      commit 8b416b0b upstream.
      
      Now that DaVinci glue layer can be modular, we must export cppi_interrupt()
      that it may call...
      Signed-off-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      72e6b965
    • Jan Beulich's avatar
      x86: hpet: Fix masking of MSI interrupts · 25920992
      Jan Beulich authored
      commit 6acf5a8c 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: default avatarJan Beulich <jbeulich@suse.com>
      Link: http://lkml.kernel.org/r/5093E09002000078000A60E6@nat28.tlf.novell.comSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      25920992
    • Sebastian Andrzej Siewior's avatar
      usb: gadget: uvc: fix error path in uvc_function_bind() · 1efa8a5a
      Sebastian Andrzej Siewior authored
      commit 0f9df939 upstream.
      
      The "video->minor = -1" assigment is done in V4L2 by
      video_register_device() so it is removed here.
      Now. uvc_function_bind() calls in error case uvc_function_unbind() for
      cleanup. The problem is that uvc_function_unbind() frees the uvc struct
      and uvc_bind_config() does as well in error case of usb_add_function().
      Removing kfree() in usb_add_function() would make the patch smaller but
      it would look odd because the new allocated memory is not cleaned up.
      However it is not guaranteed that if we call usb_add_function() we also
      get to the bind function.
      Therefore the patch extracts the conditional cleanup from
      uvc_function_unbind() applies to uvc_function_bind().
      uvc_function_unbind() now contains only the complete cleanup which is
      required once everything has been registrated.
      
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Cc: Bhupesh Sharma <bhupesh.sharma@st.com>
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      1efa8a5a
    • Sebastian Andrzej Siewior's avatar
    • Sebastian Andrzej Siewior's avatar
      usb: gadget: midi: free hs descriptors · 75387cc2
      Sebastian Andrzej Siewior authored
      commit d185039f upstream.
      
      The HS descriptors are only created if HS is supported by the UDC but we
      never free them.
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      75387cc2
    • Sebastian Andrzej Siewior's avatar
      usb: gadget: network: fix bind() error path · 3bda2981
      Sebastian Andrzej Siewior authored
      commit e79cc615 upstream.
      
      I think this is wrong since 72c973dd ("usb: gadget: add
      usb_endpoint_descriptor to struct usb_ep"). If we fail to allocate an ep
      or bail out early we shouldn't check for the descriptor which is
      assigned at ep_enable() time.
      
      Cc: Tatyana Brokhman <tlinder@codeaurora.org>
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      3bda2981
    • Alexander Graf's avatar
      KVM: PPC: 44x: fix DCR read/write · b2b7d337
      Alexander Graf authored
      commit e43a0287 upstream.
      
      When remembering the direction of a DCR transaction, we should write
      to the same variable that we interpret on later when doing vcpu_run
      again.
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      [bwh: Backported to 3.2: adjust context, indentation]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      b2b7d337
    • Rajkumar Manoharan's avatar
      ath9k_hw: Enable hw PLL power save for AR9462 · 247a0b33
      Rajkumar Manoharan authored
      commit 16802602 upstream.
      
      This reduced the power consumption to half in full and network sleep.
      
      Cc: Paul Stewart <pstew@chromium.org>
      Signed-off-by: default avatarRajkumar Manoharan <rmanohar@qca.qualcomm.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      [bwh: Backported to 3.2:
       - INIT_INI_ARRAY macro requires an explicit size argument
       - Remove the now-redundant macro PCIE_PLL_ON_CREQ_DIS_L1_2P0]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      247a0b33
    • Will Deacon's avatar
      virtio: force vring descriptors to be allocated from lowmem · 1e02c9c8
      Will Deacon authored
      commit b92b1b89 upstream.
      
      Virtio devices may attempt to add descriptors to a virtqueue from atomic
      context using GFP_ATOMIC allocation. This is problematic because such
      allocations can fall outside of the lowmem mapping, causing virt_to_phys
      to report bogus physical addresses which are subsequently passed to
      userspace via the buffers for the virtual device.
      
      This patch masks out __GFP_HIGH and __GFP_HIGHMEM from the requested
      flags when allocating descriptors for a virtqueue. If an atomic
      allocation is requested and later fails, we will return -ENOSPC which
      will be handled by the driver.
      
      Cc: Sasha Levin <levinsasha928@gmail.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      1e02c9c8
    • Will Deacon's avatar
      virtio: 9p: correctly pass physical address to userspace for high pages · 30d395b1
      Will Deacon authored
      commit b9cdc88d upstream.
      
      When using a virtio transport, the 9p net device may pass the physical
      address of a kernel buffer to userspace via a scatterlist inside a
      virtqueue. If the kernel buffer is mapped outside of the linear mapping
      (e.g. highmem), then virt_to_page will return a bogus value and we will
      populate the scatterlist with junk.
      
      This patch uses kmap_to_page when populating the page array for a kernel
      buffer.
      
      Cc: Sasha Levin <levinsasha928@gmail.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      30d395b1
    • Will Deacon's avatar
      mm: highmem: export kmap_to_page for modules · 8bc528ce
      Will Deacon authored
      commit f0263d2d upstream.
      
      Some virtio device drivers (9p) need to translate high virtual addresses
      to physical addresses, which are inserted into the virtqueue for
      processing by userspace.
      
      This patch exports the kmap_to_page symbol, so that the affected drivers
      can be compiled as modules.
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      8bc528ce
    • Ben Hutchings's avatar
      mm: add kmap_to_page() · fcb89967
      Ben Hutchings authored
      This is extracted from Mel Gorman's commit 5a178119 ('mm: add
      support for direct_IO to highmem pages') upstream.
      
      Required to backport commit b9cdc88d ('virtio: 9p: correctly pass
      physical address to userspace for high pages').
      
      Cc: Mel Gorman <mgorman@suse.de>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      fcb89967
    • Tejun Heo's avatar
      freezer: add missing mb's to freezer_count() and freezer_should_skip() · 26e5f795
      Tejun Heo authored
      commit dd67d32d upstream.
      
      A task is considered frozen enough between freezer_do_not_count() and
      freezer_count() and freezers use freezer_should_skip() to test this
      condition.  This supposedly works because freezer_count() always calls
      try_to_freezer() after clearing %PF_FREEZER_SKIP.
      
      However, there currently is nothing which guarantees that
      freezer_count() sees %true freezing() after clearing %PF_FREEZER_SKIP
      when freezing is in progress, and vice-versa.  A task can escape the
      freezing condition in effect by freezer_count() seeing !freezing() and
      freezer_should_skip() seeing %PF_FREEZER_SKIP.
      
      This patch adds smp_mb()'s to freezer_count() and
      freezer_should_skip() such that either %true freezing() is visible to
      freezer_count() or !PF_FREEZER_SKIP is visible to
      freezer_should_skip().
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Rafael J. Wysocki <rjw@sisk.pl>
      [bwh: Backported to 3.2:
       - Adjust context and indentation
       - freezer_do_not_count() and freezer_count() are no-ops for kernel tasks]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      26e5f795
    • Tejun Heo's avatar
      cgroup: cgroup_subsys->fork() should be called after the task is added to css_set · bd832099
      Tejun Heo authored
      commit 5edee61e upstream.
      
      cgroup core has a bug which violates a basic rule about event
      notifications - when a new entity needs to be added, you add that to
      the notification list first and then make the new entity conform to
      the current state.  If done in the reverse order, an event happening
      inbetween will be lost.
      
      cgroup_subsys->fork() is invoked way before the new task is added to
      the css_set.  Currently, cgroup_freezer is the only user of ->fork()
      and uses it to make new tasks conform to the current state of the
      freezer.  If FROZEN state is requested while fork is in progress
      between cgroup_fork_callbacks() and cgroup_post_fork(), the child
      could escape freezing - the cgroup isn't frozen when ->fork() is
      called and the freezer couldn't see the new task on the css_set.
      
      This patch moves cgroup_subsys->fork() invocation to
      cgroup_post_fork() after the new task is added to the css_set.
      cgroup_fork_callbacks() is removed.
      
      Because now a task may be migrated during cgroup_subsys->fork(),
      freezer_fork() is updated so that it adheres to the usual RCU locking
      and the rather pointless comment on why locking can be different there
      is removed (if it doesn't make anything simpler, why even bother?).
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Rafael J. Wysocki <rjw@sisk.pl>
      [bwh: Backported to 3.2:
       - Adjust context
       - Iterate over first CGROUP_BUILTIN_SUBSYS_COUNT elements of subsys
       - cgroup_subsys::fork takes cgroup_subsys pointer as first parameter]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      bd832099
    • Christian Borntraeger's avatar
      s390/kvm: dont announce RRBM support · 511c73bc
      Christian Borntraeger authored
      commit 87cac8f8 upstream.
      
      Newer kernels (linux-next with the transparent huge page patches)
      use rrbm if the feature is announced via feature bit 66.
      RRBM will cause intercepts, so KVM does not handle it right now,
      causing an illegal instruction in the guest.
      The  easy solution is to disable the feature bit for the guest.
      
      This fixes bugs like:
      Kernel BUG at 0000000000124c2a [verbose debug info unavailable]
      illegal operation: 0001 [#1] SMP
      Modules linked in: virtio_balloon virtio_net ipv6 autofs4
      CPU: 0 Not tainted 3.5.4 #1
      Process fmempig (pid: 659, task: 000000007b712fd0, ksp: 000000007bed3670)
      Krnl PSW : 0704d00180000000 0000000000124c2a (pmdp_clear_flush_young+0x5e/0x80)
           R:0 T:1 IO:1 EX:1 Key:0 M:1 W:0 P:0 AS:3 CC:1 PM:0 EA:3
           00000000003cc000 0000000000000004 0000000000000000 0000000079800000
           0000000000040000 0000000000000000 000000007bed3918 000000007cf40000
           0000000000000001 000003fff7f00000 000003d281a94000 000000007bed383c
           000000007bed3918 00000000005ecbf8 00000000002314a6 000000007bed36e0
       Krnl Code:>0000000000124c2a: b9810025          ogr     %r2,%r5
                 0000000000124c2e: 41343000           la      %r3,0(%r4,%r3)
                 0000000000124c32: a716fffa           brct    %r1,124c26
                 0000000000124c36: b9010022           lngr    %r2,%r2
                 0000000000124c3a: e3d0f0800004       lg      %r13,128(%r15)
                 0000000000124c40: eb22003f000c       srlg    %r2,%r2,63
      [ 2150.713198] Call Trace:
      [ 2150.713223] ([<00000000002312c4>] page_referenced_one+0x6c/0x27c)
      [ 2150.713749]  [<0000000000233812>] page_referenced+0x32a/0x410
      [...]
      
      CC: Alex Graf <agraf@suse.de>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      511c73bc
    • Shuah Khan's avatar
      powerpc: fix wii_memory_fixups() compile error on 3.0.y tree · 9697ed39
      Shuah Khan authored
      Fix wii_memory_fixups() the following compile error on 3.0.y tree with
      wii_defconfig on 3.0.y tree.
      
        CC      arch/powerpc/platforms/embedded6xx/wii.o
      arch/powerpc/platforms/embedded6xx/wii.c: In function ‘wii_memory_fixups’:
      arch/powerpc/platforms/embedded6xx/wii.c:88:2: error: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘phys_addr_t’ [-Werror=format]
      arch/powerpc/platforms/embedded6xx/wii.c:88:2: error: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘phys_addr_t’ [-Werror=format]
      arch/powerpc/platforms/embedded6xx/wii.c:90:2: error: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘phys_addr_t’ [-Werror=format]
      arch/powerpc/platforms/embedded6xx/wii.c:90:2: error: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘phys_addr_t’ [-Werror=format]
      cc1: all warnings being treated as errors
      make[2]: *** [arch/powerpc/platforms/embedded6xx/wii.o] Error 1
      make[1]: *** [arch/powerpc/platforms/embedded6xx] Error 2
      make: *** [arch/powerpc/platforms] Error 2
      Signed-off-by: default avatarShuah Khan <shuah.khan@hp.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      9697ed39
    • Mel Gorman's avatar
      tmpfs: fix shared mempolicy leak · c6dc8bee
      Mel Gorman authored
      commit 18a2f371 upstream.
      
      This fixes a regression in 3.7-rc, which has since gone into stable.
      
      Commit 00442ad0 ("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 00442ad0,
      alloc_pages_vma() has kept refcount in balance, so now no problem.
      Reported-and-tested-by: default avatarTommi Rantala <tt.rantala@gmail.com>
      Signed-off-by: default avatarMel Gorman <mgorman@suse.de>
      Signed-off-by: default avatarHugh Dickins <hughd@google.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      [bwh: Backported to 3.2: adjust context]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      c6dc8bee