1. 22 Apr, 2012 40 commits
    • Eran's avatar
      Bluetooth: Adding USB device 13d3:3375 as an Atheros AR3012. · 5747b056
      Eran authored
      commit 9498ba7a upstream.
      
      The bluetooth module in the Asus UX31/UX21 is based on Atheros AR3012
      and requires a firmware to be uploaded before it's usable.
      
      output of usb-devices for this module:
      T:  Bus=01 Lev=02 Prnt=02 Port=07 Cnt=03 Dev#=  6 Spd=12  MxCh= 0
      D:  Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=13d3 ProdID=3375 Rev=00.02
      S:  Manufacturer=Atheros Communications
      S:  Product=Bluetooth USB Host Controller
      S:  SerialNumber=Alaska Day 2006
      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
      I:  If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      Signed-off-by: default avatarEran <eran@over-here.org>
      Tested-by: default avatarMichal Labedzki <michal.labedzki@tieto.com>
      Signed-off-by: default avatarGustavo F. Padovan <padovan@profusion.mobi>
      Cc: Jonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5747b056
    • Tomoya MORINAGA's avatar
      spi-topcliff-pch: Support new device LAPIS Semiconductor ML7831 IOH · 92e100d8
      Tomoya MORINAGA authored
      commit 92b3a5c1 upstream.
      
      ML7831 is companion chip for Intel Atom E6xx series.
      Signed-off-by: default avatarTomoya MORINAGA <tomoya-linux@dsn.lapis-semi.com>
      Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
      Signed-off-by: default avatarTomoya MORINAGA <tomoya.rohm@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      92e100d8
    • Danny Kukawka's avatar
      spi-topcliff-pch: fix -Wuninitialized warning · 6123fa90
      Danny Kukawka authored
      commit de3bd7e6 upstream.
      
      Fix for:
      drivers/spi/spi-topcliff-pch.c: In function ‘pch_spi_handler_sub’:
      drivers/spi/spi-topcliff-pch.c:325:17: warning: ‘bpw_len’ may be
        used uninitialized in this function [-Wuninitialized]
      drivers/spi/spi-topcliff-pch.c:325:42: warning: ‘rx_index’ may be
        used uninitialized in this function [-Wuninitialized]
      drivers/spi/spi-topcliff-pch.c:325:42: warning: ‘tx_index’ may be
        used uninitialized in this function [-Wuninitialized]
      
      Move usage of tx_index, rx_index and bpw_len into the same
      block as where they are set to prevent uninitialized usage.
      
      v2: instead of init variables with 0 move the whole block
      
      [This patch title "warnings" makes you think "This patch is not
      for bug fix".  However, this patch surely patch for bug fix.]
      Signed-off-by: default avatarDanny Kukawka <danny.kukawka@bisect.de>
      Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
      Signed-off-by: default avatarTomoya MORINAGA <tomoya.rohm@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6123fa90
    • Tomoya MORINAGA's avatar
      pch_dma: Support new device LAPIS Semiconductor ML7831 IOH · f0d561a3
      Tomoya MORINAGA authored
      commit ca7fe2db upstream.
      
      ML7831 is companion chip for Intel Atom E6xx series.
      Signed-off-by: default avatarTomoya MORINAGA <tomoya.rohm@gmail.com>
      Signed-off-by: default avatarVinod Koul <vinod.koul@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f0d561a3
    • Dan Carpenter's avatar
      pch_gbe: memory corruption calling pch_gbe_validate_option() · f3c2f735
      Dan Carpenter authored
      commit 73f98eab upstream.
      
      pch_gbe_validate_option() modifies 32 bits of memory but we pass
      &hw->phy.autoneg_advertised which only has 16 bits and &hw->mac.fc
      which only has 8 bits.
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarTomoya MORINAGA <tomoya.rohm@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f3c2f735
    • Darren Hart's avatar
      pch_gbe: Do not abort probe on bad MAC · 40e83cb0
      Darren Hart authored
      commit 2b53d078 upstream.
      
      If the MAC is invalid or not implemented, do not abort the probe. Issue
      a warning and prevent bringing the interface up until a MAC is set manually
      (via ifconfig $IFACE hw ether $MAC).
      
      Tested on two platforms, one with a valid MAC, the other without a MAC. The real
      MAC is used if present, the interface fails to come up until the MAC is set on
      the other. They successfully get an IP over DHCP and pass a simple ping and
      login over ssh test.
      
      This is meant to allow the Inforce SYS940X development board:
      http://www.inforcecomputing.com/SYS940X_ECX.html
      (and others suffering from a missing MAC) to work with the mainline kernel.
      Without this patch, the probe will fail and the interface will not be created,
      preventing the user from configuring the MAC manually.
      
      This does not make any attempt to address a missing or invalid MAC for the
      pch_phub driver.
      Signed-off-by: default avatarDarren Hart <dvhart@linux.intel.com>
      CC: Arjan van de Ven <arjan@linux.intel.com>
      CC: Alan Cox <alan@linux.intel.com>
      CC: Tomoya MORINAGA <tomoya.rohm@gmail.com>
      CC: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
      CC: "David S. Miller" <davem@davemloft.net>
      CC: Paul Gortmaker <paul.gortmaker@windriver.com>
      CC: Jon Mason <jdmason@kudzu.us>
      CC: Mark Brown <broonie@opensource.wolfsonmicro.com>
      CC: David Laight <David.Laight@ACULAB.COM>
      CC: Joe Perches <joe@perches.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarTomoya MORINAGA <tomoya.rohm@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      40e83cb0
    • Jonghwan Choi's avatar
      security: fix compile error in commoncap.c · fd18a080
      Jonghwan Choi authored
      commit 51b79bee upstream.
      
      Add missing "personality.h"
      security/commoncap.c: In function 'cap_bprm_set_creds':
      security/commoncap.c:510: error: 'PER_CLEAR_ON_SETID' undeclared (first use in this function)
      security/commoncap.c:510: error: (Each undeclared identifier is reported only once
      security/commoncap.c:510: error: for each function it appears in.)
      Signed-off-by: default avatarJonghwan Choi <jhbird.choi@samsung.com>
      Acked-by: default avatarSerge Hallyn <serge.hallyn@canonical.com>
      Signed-off-by: default avatarJames Morris <james.l.morris@oracle.com>
      Cc: Eric Paris <eparis@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fd18a080
    • Lin Ming's avatar
      ACPICA: Fix to allow region arguments to reference other scopes · 13a307e1
      Lin Ming authored
      commit 8931d9ea upstream.
      
      Allow referenced objects to be in a different scope.
      
      http://www.acpica.org/bugzilla/show_bug.cgi?id=937
      http://marc.info/?l=linux-acpi&m=131636632718222&w=2
      
      ACPI Error: [RAMB] Namespace lookup failure, AE_NOT_FOUND (20110112/psargs-359)
      ACPI Exception: AE_NOT_FOUND, Could not execute arguments for [RAMW] (Region) (20110112/nsinit-349)
      
          Scope (_SB)
          {
              Name (RAMB, 0xDF5A1018)
              OperationRegion (\RAMW, SystemMemory, RAMB, 0x00010000)
          }
      
      For above ASL code, we need to save scope node(\_SB) to lookup
      the argument node(\_SB.RAMB).
      Reported-by: default avatarJim Green <student.northwestern@gmail.com>
      Signed-off-by: default avatarLin Ming <ming.m.lin@intel.com>
      Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>
      Cc: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      13a307e1
    • Tomoya MORINAGA's avatar
      usb: gadget: pch_udc: Reduce redundant interrupt · a37cedb6
      Tomoya MORINAGA authored
      commit 83331040 upstream.
      
      ISSUE:
      USB Suspend interrupts occur frequently.
      
      CAUSE:
      When it is called pch_udc_reconnect() in USB Suspend, it repeats reset and
      Suspend.
      
      SOLUTION:
      pch_udc_reconnect() does not enable all interrupts.  When an enumeration event
      occurred the driver enables all interrupts.
      Signed-off-by: default avatarTomoya MORINAGA <tomoya.rohm@gmail.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a37cedb6
    • Tomoya MORINAGA's avatar
      usb: gadget: pch_udc: Fix usb/gadget/pch_udc: Fix ether gadget connect/disconnect issue · ca6095e6
      Tomoya MORINAGA authored
      commit 1c575d2d upstream.
      
      ISSUE:
      After a USB cable is connect/disconnected, the system rarely freezes.
      
      CAUSE:
      Since the USB device controller cannot know to disconnect the USB cable, when
      it is used without detecting VBUS by GPIO, the UDC driver does not notify to
      USB Gadget.
      
      Since USB Gadget cannot know to disconnect, a false setting occurred when the
      USB cable is connected/disconnect repeatedly.
      Signed-off-by: default avatarTomoya MORINAGA <tomoya.rohm@gmail.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ca6095e6
    • Tomoya MORINAGA's avatar
      usb: gadget: pch_udc: Fix USB suspend issue · a201b074
      Tomoya MORINAGA authored
      commit 84566abb upstream.
      
      ISSUE:
      After USB Suspend, a system rarely freezes.
      
      CAUSE:
      When USB Suspend occurred, the driver is not notifying
      a gadget of the event.
      Signed-off-by: default avatarTomoya MORINAGA <tomoya.rohm@gmail.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a201b074
    • Tomoya MORINAGA's avatar
      usb: gadget: pch_udc: Fix wrong return value · 9fe9ba7c
      Tomoya MORINAGA authored
      commit c802672c upstream.
      
      ISSUE:
      If the return value of pch_udc_pcd_init() is False, the return value of
      this function is unsettled.
      Since pch_udc_pcd_init() always returns 0, there is not actually the issue.
      
      CAUSE:
      If pch_udc_pcd_init() is True, the variable, retval, is not set for an
      appropriate value.
      Signed-off-by: default avatarTomoya MORINAGA <tomoya.rohm@gmail.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9fe9ba7c
    • Tomoya MORINAGA's avatar
      usb: gadget: pch_udc: Fix disconnect issue · 49cb4f64
      Tomoya MORINAGA authored
      commit c50a3bff upstream.
      
      ISSUE:
      When the driver notifies a gadget of a disconnect event, a system
      rarely freezes.
      
      CAUSE:
      When the driver calls dev->driver->disconnect(), it is not calling
      spin_unlock().
      Signed-off-by: default avatarTomoya MORINAGA <tomoya.rohm@gmail.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      49cb4f64
    • Axel Lin's avatar
      gpio: Add missing spin_lock_init in gpio-pch driver · 4195441e
      Axel Lin authored
      commit d166370a upstream.
      
      This bug was introduced by commit d568a681
      "gpio-pch: add spinlock in suspend/resume processing"
      which adds a spinlock to struct pch_gpio but never init the spinlock.
      Reported-by: default avatarTomoya MORINAGA <tomoya.rohm@gmail.com>
      Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
      Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4195441e
    • Tomoya MORINAGA's avatar
      pch_gpio: Support new device LAPIS Semiconductor ML7831 IOH · 10ec1cf0
      Tomoya MORINAGA authored
      commit 868fea05 upstream.
      
      ML7831 is companion chip for Intel Atom E6xx series.
      Signed-off-by: default avatarTomoya MORINAGA <tomoya-linux@dsn.lapis-semi.com>
      Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      10ec1cf0
    • Johan Hovold's avatar
      Bluetooth: hci_core: fix NULL-pointer dereference at unregister · e83fefc5
      Johan Hovold authored
      commit 94324962 upstream.
      
      Make sure hci_dev_open returns immediately if hci_dev_unregister has
      been called.
      
      This fixes a race between hci_dev_open and hci_dev_unregister which can
      lead to a NULL-pointer dereference.
      
      Bug is 100% reproducible using hciattach and a disconnected serial port:
      
      0. # hciattach -n /dev/ttyO1 any noflow
      
      1. hci_dev_open called from hci_power_on grabs req lock
      2. hci_init_req executes but device fails to initialise (times out
         eventually)
      3. hci_dev_open is called from hci_sock_ioctl and sleeps on req lock
      4. hci_uart_tty_close calls hci_dev_unregister and sleeps on req lock in
         hci_dev_do_close
      5. hci_dev_open (1) releases req lock
      6. hci_dev_do_close grabs req lock and returns as device is not up
      7. hci_dev_unregister sleeps in destroy_workqueue
      8. hci_dev_open (3) grabs req lock, calls hci_init_req and eventually sleeps
      9. hci_dev_unregister finishes, while hci_dev_open is still running...
      
      [   79.627136] INFO: trying to register non-static key.
      [   79.632354] the code is fine but needs lockdep annotation.
      [   79.638122] turning off the locking correctness validator.
      [   79.643920] [<c00188bc>] (unwind_backtrace+0x0/0xf8) from [<c00729c4>] (__lock_acquire+0x1590/0x1ab0)
      [   79.653594] [<c00729c4>] (__lock_acquire+0x1590/0x1ab0) from [<c00733f8>] (lock_acquire+0x9c/0x128)
      [   79.663085] [<c00733f8>] (lock_acquire+0x9c/0x128) from [<c0040a88>] (run_timer_softirq+0x150/0x3ac)
      [   79.672668] [<c0040a88>] (run_timer_softirq+0x150/0x3ac) from [<c003a3b8>] (__do_softirq+0xd4/0x22c)
      [   79.682281] [<c003a3b8>] (__do_softirq+0xd4/0x22c) from [<c003a924>] (irq_exit+0x8c/0x94)
      [   79.690856] [<c003a924>] (irq_exit+0x8c/0x94) from [<c0013a50>] (handle_IRQ+0x34/0x84)
      [   79.699157] [<c0013a50>] (handle_IRQ+0x34/0x84) from [<c0008530>] (omap3_intc_handle_irq+0x48/0x4c)
      [   79.708648] [<c0008530>] (omap3_intc_handle_irq+0x48/0x4c) from [<c037499c>] (__irq_usr+0x3c/0x60)
      [   79.718048] Exception stack(0xcf281fb0 to 0xcf281ff8)
      [   79.723358] 1fa0:                                     0001e6a0 be8dab00 0001e698 00036698
      [   79.731933] 1fc0: 0002df98 0002df38 0000001f 00000000 b6f234d0 00000000 00000004 00000000
      [   79.740509] 1fe0: 0001e6f8 be8d6aa0 be8dac50 0000aab8 80000010 ffffffff
      [   79.747497] Unable to handle kernel NULL pointer dereference at virtual address 00000000
      [   79.756011] pgd = cf3b4000
      [   79.758850] [00000000] *pgd=8f0c7831, *pte=00000000, *ppte=00000000
      [   79.765502] Internal error: Oops: 80000007 [#1]
      [   79.770294] Modules linked in:
      [   79.773529] CPU: 0    Tainted: G        W     (3.3.0-rc6-00002-gb5d5c87 #421)
      [   79.781066] PC is at 0x0
      [   79.783721] LR is at run_timer_softirq+0x16c/0x3ac
      [   79.788787] pc : [<00000000>]    lr : [<c0040aa4>]    psr: 60000113
      [   79.788787] sp : cf281ee0  ip : 00000000  fp : cf280000
      [   79.800903] r10: 00000004  r9 : 00000100  r8 : b6f234d0
      [   79.806427] r7 : c0519c28  r6 : cf093488  r5 : c0561a00  r4 : 00000000
      [   79.813323] r3 : 00000000  r2 : c054eee0  r1 : 00000001  r0 : 00000000
      [   79.820190] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
      [   79.827728] Control: 10c5387d  Table: 8f3b4019  DAC: 00000015
      [   79.833801] Process gpsd (pid: 1265, stack limit = 0xcf2802e8)
      [   79.839965] Stack: (0xcf281ee0 to 0xcf282000)
      [   79.844573] 1ee0: 00000002 00000000 c0040a24 00000000 00000002 cf281f08 00200200 00000000
      [   79.853210] 1f00: 00000000 cf281f18 cf281f08 00000000 00000000 00000000 cf281f18 cf281f18
      [   79.861816] 1f20: 00000000 00000001 c056184c 00000000 00000001 b6f234d0 c0561848 00000004
      [   79.870452] 1f40: cf280000 c003a3b8 c051e79c 00000001 00000000 00000100 3fa9e7b8 0000000a
      [   79.879089] 1f60: 00000025 cf280000 00000025 00000000 00000000 b6f234d0 00000000 00000004
      [   79.887756] 1f80: 00000000 c003a924 c053ad38 c0013a50 fa200000 cf281fb0 ffffffff c0008530
      [   79.896362] 1fa0: 0001e6a0 0000aab8 80000010 c037499c 0001e6a0 be8dab00 0001e698 00036698
      [   79.904998] 1fc0: 0002df98 0002df38 0000001f 00000000 b6f234d0 00000000 00000004 00000000
      [   79.913665] 1fe0: 0001e6f8 be8d6aa0 be8dac50 0000aab8 80000010 ffffffff 00fbf700 04ffff00
      [   79.922302] [<c0040aa4>] (run_timer_softirq+0x16c/0x3ac) from [<c003a3b8>] (__do_softirq+0xd4/0x22c)
      [   79.931945] [<c003a3b8>] (__do_softirq+0xd4/0x22c) from [<c003a924>] (irq_exit+0x8c/0x94)
      [   79.940582] [<c003a924>] (irq_exit+0x8c/0x94) from [<c0013a50>] (handle_IRQ+0x34/0x84)
      [   79.948913] [<c0013a50>] (handle_IRQ+0x34/0x84) from [<c0008530>] (omap3_intc_handle_irq+0x48/0x4c)
      [   79.958404] [<c0008530>] (omap3_intc_handle_irq+0x48/0x4c) from [<c037499c>] (__irq_usr+0x3c/0x60)
      [   79.967773] Exception stack(0xcf281fb0 to 0xcf281ff8)
      [   79.973083] 1fa0:                                     0001e6a0 be8dab00 0001e698 00036698
      [   79.981658] 1fc0: 0002df98 0002df38 0000001f 00000000 b6f234d0 00000000 00000004 00000000
      [   79.990234] 1fe0: 0001e6f8 be8d6aa0 be8dac50 0000aab8 80000010 ffffffff
      [   79.997161] Code: bad PC value
      [   80.000396] ---[ end trace 6f6739840475f9ee ]---
      [   80.005279] Kernel panic - not syncing: Fatal exception in interrupt
      Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
      Acked-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e83fefc5
    • Sarah Sharp's avatar
      xhci: Fix register save/restore order. · b064ece8
      Sarah Sharp authored
      commit c7713e73 upstream.
      
      The xHCI 1.0 spec errata released on June 13, 2011, changes the ordering
      that the xHCI registers are saved and restored in.  It moves the
      interrupt pending (IMAN) and interrupt control (IMOD) registers to be
      saved and restored last.  I believe that's because the host controller
      may attempt to fetch the event ring table when interrupts are
      re-enabled.  Therefore we need to restore the event ring registers
      before we re-enable interrupts.
      
      This should be backported to kernels as old as 2.6.37, that contain the
      commit 5535b1d5 "USB: xHCI: PCI power
      management implementation"
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Tested-by: default avatarElric Fu <elricfu1@gmail.com>
      Cc: Andiry Xu <andiry.xu@amd.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b064ece8
    • Rajkumar Manoharan's avatar
      ath9k: fix max noise floor threshold · d7082288
      Rajkumar Manoharan authored
      commit 2ee0a070 upstream.
      
      Currently the maximum noise floor limit is set as too high (-60dB). The
      assumption of having a higher threshold limit is that it would help
      de-sensitize the receiver (reduce phy errors) from continuous
      interference. But when we have a bursty interference where there are
      collisions and then free air time and if the receiver is desensitized too
      much, it will miss the normal packets too. Lets make use of chips
      specific min, nom and max limits always. This patch helps to improve the
      connection stability in congested networks.
      
      Cc: Paul Stewart <pstew@google.com>
      Tested-by: default avatarGary Morain <gmorain@google.com>
      Signed-off-by: default avatarMadhan Jaganathan <madhanj@qca.qualcomm.com>
      Signed-off-by: default avatarRajkumar Manoharan <rmanohar@qca.qualcomm.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      [bwh: Backported to 3.0/3.2: adjust context]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d7082288
    • Eric Paris's avatar
      fcaps: clear the same personality flags as suid when fcaps are used · f2c309c3
      Eric Paris authored
      commit d52fc5dd upstream.
      
      If a process increases permissions using fcaps all of the dangerous
      personality flags which are cleared for suid apps should also be cleared.
      Thus programs given priviledge with fcaps will continue to have address space
      randomization enabled even if the parent tried to disable it to make it
      easier to attack.
      Signed-off-by: default avatarEric Paris <eparis@redhat.com>
      Reviewed-by: default avatarSerge Hallyn <serge.hallyn@canonical.com>
      Signed-off-by: default avatarJames Morris <james.l.morris@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f2c309c3
    • Linus Walleij's avatar
      serial: PL011: move interrupt clearing · 2d31dab4
      Linus Walleij authored
      commit c3d8b76f upstream.
      
      Commit 360f748b204275229f8398cb2f9f53955db1503b
      "serial: PL011: clear pending interrupts"
      attempts to clear interrupts by writing to a
      yet-unassigned memory address. This fixes the issue.
      
      The breaking patch is marked for stable so should be
      carried along with the other patch.
      
      Cc: Shreshtha Kumar Sahu <shreshthakumar.sahu@stericsson.com>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Nicolas Pitre <nico@fluxnic.net>
      Reported-by: default avatarViresh Kumar <viresh.kumar@st.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Tested-by: default avatarGrant Likely <grant.likely@secretlab.ca>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2d31dab4
    • Linus Walleij's avatar
      serial: PL011: clear pending interrupts · dc39a21d
      Linus Walleij authored
      commit 9b96fbac upstream.
      
      Chanho Min reported that when the boot loader transfers
      control to the kernel, there may be pending interrupts
      causing the UART to lock up in an eternal loop trying to
      pick tokens from the FIFO (since the RX interrupt flag
      indicates there are tokens) while in practice there are
      no tokens - in fact there is only a pending IRQ flag.
      
      This patch address the issue with a combination of two
      patches suggested by Russell King that clears and mask
      all interrupts at probe() and clears any pending error
      and RX interrupts at port startup time.
      
      We suspect the spurious interrupts are a side-effect of
      switching the UART from FIFO to non-FIFO mode.
      
      Cc: Shreshtha Kumar Sahu <shreshthakumar.sahu@stericsson.com>
      Reported-by: default avatarChanho Min <chanho0207@gmail.com>
      Suggested-by: default avatarRussell King <linux@arm.linux.org.uk>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Reviewed-by: default avatarJong-Sung Kim <neidhard.kim@lge.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      dc39a21d
    • Martin Schwidefsky's avatar
      fix tlb flushing for page table pages · 39e853a4
      Martin Schwidefsky authored
      commit cd94154c upstream.
      
      Git commit 36409f63 "use generic RCU
      page-table freeing code" introduced a tlb flushing bug. Partially revert
      the above git commit and go back to s390 specific page table flush code.
      
      For s390 the TLB can contain three types of entries, "normal" TLB
      page-table entries, TLB combined region-and-segment-table (CRST) entries
      and real-space entries. Linux does not use real-space entries which
      leaves normal TLB entries and CRST entries. The CRST entries are
      intermediate steps in the page-table translation called translation paths.
      For example a 4K page access in a three-level page table setup will
      create two CRST TLB entries and one page-table TLB entry. The advantage
      of that approach is that a page access next to the previous one can reuse
      the CRST entries and needs just a single read from memory to create the
      page-table TLB entry. The disadvantage is that the TLB flushing rules are
      more complicated, before any page-table may be freed the TLB needs to be
      flushed.
      
      In short: the generic RCU page-table freeing code is incorrect for the
      CRST entries, in particular the check for mm_users < 2 is troublesome.
      
      This is applicable to 3.0+ kernels.
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      39e853a4
    • Alex He's avatar
      xHCI: Correct the #define XHCI_LEGACY_DISABLE_SMI · bf1c89f0
      Alex He authored
      commit 95018a53 upstream.
      
      Re-define XHCI_LEGACY_DISABLE_SMI and used it in right way. All SMI enable
      bits will be cleared to zero and flag bits 29:31 are also cleared to zero.
      Other bits should be presvered as Table 146.
      
      This patch should be backported to kernels as old as 2.6.31.
      Signed-off-by: default avatarAlex He <alex.he@amd.com>
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bf1c89f0
    • Elric Fu's avatar
      xHCI: add XHCI_RESET_ON_RESUME quirk for VIA xHCI host · b5814b09
      Elric Fu authored
      commit 457a4f61 upstream.
      
      The suspend operation of VIA xHCI host have some issues and
      hibernate operation works fine, so The XHCI_RESET_ON_RESUME
      quirk is added for it.
      
      This patch should base on "xHCI: Don't write zeroed pointer
      to xHC registers" that is released by Sarah. Otherwise, the
      host system error will ocurr in the hibernate operation
      process.
      
      This should be backported to stable kernels as old as 2.6.37,
      that contain the commit c877b3b2
      "xhci: Add reset on resume quirk for asrock p67 host".
      Signed-off-by: default avatarElric Fu <elricfu1@gmail.com>
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b5814b09
    • Elric Fu's avatar
      USB: fix bug of device descriptor got from superspeed device · 3277b4ab
      Elric Fu authored
      commit d8aec3db upstream.
      
      When the Seagate Goflex USB3.0 device is attached to VIA xHCI
      host, sometimes the device will downgrade mode to high speed.
      By the USB analyzer, I found the device finished the link
      training process and worked at superspeed mode. But the device
      descriptor got from the device shows the device works at 2.1.
      It is very strange and seems like the device controller of
      Seagate Goflex has a little confusion.
      
      The first 8 bytes of device descriptor should be:
      12 01 00 03 00 00 00 09
      
      But the first 8 bytes of wrong device descriptor are:
      12 01 10 02 00 00 00 40
      
      The wrong device descriptor caused the initialization of mass
      storage failed. After a while, the device would be recognized
      as a high speed device and works fine.
      
      This patch will warm reset the device to fix the issue after
      finding the bcdUSB field of device descriptor isn't 0x0300
      but the speed mode of device is superspeed.
      
      This patch should be backported to kernels as old as 3.2, or ones that
      contain the commit 75d7cf72 "usbcore:
      refine warm reset logic".
      Signed-off-by: default avatarElric Fu <elricfu1@gmail.com>
      Acked-by: default avatarAndiry Xu <Andiry.Xu@amd.com>
      Acked-by: default avatarSergei Shtylyov <sshtylyov@mvista.com>
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3277b4ab
    • Sarah Sharp's avatar
      xhci: Restore event ring dequeue pointer on resume. · 4659b3d0
      Sarah Sharp authored
      commit fb3d85bc upstream.
      
      The xhci_save_registers() function saved the event ring dequeue pointer
      in the s3 register structure, but xhci_restore_registers() never
      restored it.  No other code in the xHCI successful resume path would
      ever restore it either.  Fix that.
      
      This should be backported to kernels as old as 2.6.37, that contain the
      commit 5535b1d5 "USB: xHCI: PCI power
      management implementation".
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Tested-by: default avatarElric Fu <elricfu1@gmail.com>
      Cc: Andiry Xu <andiry.xu@amd.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4659b3d0
    • Sarah Sharp's avatar
      xhci: Don't write zeroed pointers to xHC registers. · 1bcf8b0d
      Sarah Sharp authored
      commit 159e1fcc upstream.
      
      When xhci_mem_cleanup() is called, we can't be sure if the xHC is
      actually halted.  We can ask the xHC to halt by writing to the RUN bit
      in the command register, but that might timeout due to a HW hang.
      
      If the host controller is still running, we should not write zeroed
      values to the event ring dequeue pointers or base tables, the DCBAA
      pointers, or the command ring pointers.  Eric Fu reports his VIA VL800
      host accesses the event ring pointers after a failed register restore on
      resume from suspend.  The hypothesis is that the host never actually
      halted before the register write to change the event ring pointer to
      zero.
      
      Remove all writes of zeroed values to pointer registers in
      xhci_mem_cleanup().  Instead, make all callers of the function reset the
      host controller first, which will reset those registers to zero.
      xhci_mem_init() is the only caller that doesn't first halt and reset the
      host controller before calling xhci_mem_cleanup().
      
      This should be backported to kernels as old as 2.6.32.
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Tested-by: default avatarElric Fu <elricfu1@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1bcf8b0d
    • Felipe Balbi's avatar
      xhci: don't re-enable IE constantly · 3df496c5
      Felipe Balbi authored
      commit 4e833c0b upstream.
      
      While we're at that, define IMAN bitfield to aid readability.
      
      The interrupt enable bit should be set once on driver init, and we
      shouldn't need to continually re-enable it.  Commit c21599a3 introduced
      a read of the irq_pending register, and that allows us to preserve the
      state of the IE bit.  Before that commit, we were blindly writing 0x3 to
      the register.
      
      This patch should be backported to kernels as old as 2.6.36, or ones
      that contain the commit c21599a3 "USB:
      xhci: Reduce reads and writes of interrupter registers".
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3df496c5
    • Alan Stern's avatar
      USB: don't ignore suspend errors for root hubs · 933ec440
      Alan Stern authored
      commit cd4376e2 upstream.
      
      This patch (as1532) fixes a mistake in the USB suspend code.  When the
      system is going to sleep, we should ignore errors in powering down USB
      devices, because they don't really matter.  The devices will go to low
      power anyway when the entire USB bus gets suspended (except for
      SuperSpeed devices; maybe they will need special treatment later).
      
      However we should not ignore errors in suspending root hubs,
      especially if the error indicates that the suspend raced with a wakeup
      request.  Doing so might leave the bus powered on while the system was
      supposed to be asleep, or it might cause the suspend of the root hub's
      parent controller device to fail, or it might cause a wakeup request
      to be ignored.
      
      The patch fixes the problem by ignoring errors only when the device in
      question is not a root hub.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Reported-by: default avatarChen Peter <B29397@freescale.com>
      Tested-by: default avatarChen Peter <peter.chen@freescale.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      933ec440
    • Alan Stern's avatar
      USB: don't clear urb->dev in scatter-gather library · 5199257b
      Alan Stern authored
      commit bcf39853 upstream.
      
      This patch (as1517b) fixes an error in the USB scatter-gather library.
      The library code uses urb->dev to determine whether or nor an URB is
      currently active; the completion handler sets urb->dev to NULL.
      However the core unlinking routines need to use urb->dev.  Since
      unlinking always racing with completion, the completion handler must
      not clear urb->dev -- it can lead to invalid memory accesses when a
      transfer has to be cancelled.
      
      This patch fixes the problem by getting rid of the lines that clear
      urb->dev after urb has been submitted.  As a result we may end up
      trying to unlink an URB that failed in submission or that has already
      completed, so an extra check is added after each unlink to avoid
      printing an error message when this happens.  The checks are updated
      in both sg_complete() and sg_cancel(), and the second is updated to
      match the first (currently it prints out unnecessary warning messages
      if a device is unplugged while a transfer is in progress).
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Reported-and-tested-by: default avatarIllia Zaitsev <I.Zaitsev@adbglobal.com>
      CC: Ming Lei <tom.leiming@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5199257b
    • Anton Samokhvalov's avatar
      USB: sierra: add support for Sierra Wireless MC7710 · f21fc9d3
      Anton Samokhvalov authored
      commit c5d703dc upstream.
      
      Just add new device id. 3G works fine, LTE not tested.
      Signed-off-by: default avatarAnton Samokhvalov <pg83@yandex.ru>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f21fc9d3
    • Simon Arlott's avatar
      USB: ftdi_sio: fix race condition in TIOCMIWAIT, and abort of TIOCMIWAIT when the device is removed · 3ed3bfed
      Simon Arlott authored
      commit 876ae50d upstream.
      
      There are two issues here, one is that the device is generating
      spurious very fast modem status line changes somewhere:
      
      CTS becomes high then low 18µs later:
      [121226.924373] ftdi_process_packet: prev rng=0 dsr=10 dcd=0 cts=6
      [121226.924378] ftdi_process_packet: status=10 prev=00 diff=10
      [121226.924382] ftdi_process_packet: now rng=0 dsr=10 dcd=0 cts=7
      (wake_up_interruptible is called)
      [121226.924391] ftdi_process_packet: prev rng=0 dsr=10 dcd=0 cts=7
      [121226.924394] ftdi_process_packet: status=00 prev=10 diff=10
      [121226.924397] ftdi_process_packet: now rng=0 dsr=10 dcd=0 cts=8
      (wake_up_interruptible is called)
      
      This wakes up the task in TIOCMIWAIT:
      [121226.924405] ftdi_ioctl: 19451 rng=0->0 dsr=10->10 dcd=0->0 cts=6->8
      (wait from 20:51:46 returns and observes both changes)
      
      Which then calls TIOCMIWAIT again:
      20:51:46.400239 ioctl(3, TIOCMIWAIT, 0x20) = 0
      22:11:09.441818 ioctl(3, TIOCMGET, [TIOCM_DTR|TIOCM_RTS]) = 0
      22:11:09.442812 ioctl(3, TIOCMIWAIT, 0x20) = -1 EIO (Input/output error)
      (the second wake_up_interruptible takes effect and an I/O error occurs)
      
      The other issue is that TIOCMIWAIT will wait forever (unless the task is
      interrupted) if the device is removed.
      
      This change removes the -EIO return that occurs if the counts don't
      appear to have changed. Multiple counts may have been processed as
      one or the waiting task may have started waiting after recording the
      current count.
      
      It adds a bool to indicate that the device has been removed so that
      TIOCMIWAIT doesn't wait forever, and wakes up any tasks so that they can
      return -EIO.
      Signed-off-by: default avatarSimon Arlott <simon@fire.lp0.eu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3ed3bfed
    • Simon Arlott's avatar
      USB: ftdi_sio: fix status line change handling for TIOCMIWAIT and TIOCGICOUNT · 61670a0d
      Simon Arlott authored
      commit fca5430d upstream.
      
      Handling of TIOCMIWAIT was changed by commit 1d749f9a
       USB: ftdi_sio.c: Use ftdi async_icount structure for TIOCMIWAIT, as in other drivers
      
      FTDI_STATUS_B0_MASK does not indicate the changed modem status lines,
      it indicates the value of the current modem status lines. An xor is
      still required to determine which lines have changed.
      
      The count was only being incremented if the line was high. The only
      reason TIOCMIWAIT still worked was because the status packet is
      repeated every 1ms, so the count was always changing. The wakeup
      itself still ran based on the status lines changing.
      
      This change fixes handling of updates to the modem status lines and
      allows multiple processes to use TIOCMIWAIT concurrently.
      
      Tested with two processes waiting on different status lines being
      toggled independently.
      Signed-off-by: default avatarSimon Arlott <simon@fire.lp0.eu>
      Cc: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      61670a0d
    • Santiago Garcia Mantinan's avatar
      USB: option: re-add NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED to option_id array · 8de59a9f
      Santiago Garcia Mantinan authored
      commit 9ac2feb2 upstream.
      
      Re-add NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED to option_id array
      Signed-off-by: default avatarSantiago Garcia Mantinan <manty@debian.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8de59a9f
    • Johan Hovold's avatar
      USB: pl2303: fix DTR/RTS being raised on baud rate change · 582ed6e2
      Johan Hovold authored
      commit ce5c9851 upstream.
      
      DTR/RTS should only be raised when changing baudrate from B0 and not on
      any baud rate change (> B0).
      Reported-by: default avatarSøren Holm <sgh@sgh.dk>
      Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      582ed6e2
    • Johan Hovold's avatar
      USB: serial: fix race between probe and open · 5d4047fd
      Johan Hovold authored
      commit a65a6f14 upstream.
      
      Fix race between probe and open by making sure that the disconnected
      flag is not cleared until all ports have been registered.
      
      A call to tty_open while probe is running may get a reference to the
      serial structure in serial_install before its ports have been
      registered. This may lead to usb_serial_core calling driver open before
      port is fully initialised.
      
      With ftdi_sio this result in the following NULL-pointer dereference as
      the private data has not been initialised at open:
      
      [  199.698286] IP: [<f811a089>] ftdi_open+0x59/0xe0 [ftdi_sio]
      [  199.698297] *pde = 00000000
      [  199.698303] Oops: 0000 [#1] PREEMPT SMP
      [  199.698313] Modules linked in: ftdi_sio usbserial
      [  199.698323]
      [  199.698327] Pid: 1146, comm: ftdi_open Not tainted 3.2.11 #70 Dell Inc. Vostro 1520/0T816J
      [  199.698339] EIP: 0060:[<f811a089>] EFLAGS: 00010286 CPU: 0
      [  199.698344] EIP is at ftdi_open+0x59/0xe0 [ftdi_sio]
      [  199.698348] EAX: 0000003e EBX: f5067000 ECX: 00000000 EDX: 80000600
      [  199.698352] ESI: f48d8800 EDI: 00000001 EBP: f515dd54 ESP: f515dcfc
      [  199.698356]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
      [  199.698361] Process ftdi_open (pid: 1146, ti=f515c000 task=f481e040 task.ti=f515c000)
      [  199.698364] Stack:
      [  199.698368]  f811a9fe f811a9e0 f811b3ef 00000000 00000000 00001388 00000000 f4a86800
      [  199.698387]  00000002 00000000 f806e68e 00000000 f532765c f481e040 00000246 22222222
      [  199.698479]  22222222 22222222 22222222 f5067004 f5327600 f5327638 f515dd74 f806e6ab
      [  199.698496] Call Trace:
      [  199.698504]  [<f806e68e>] ? serial_activate+0x2e/0x70 [usbserial]
      [  199.698511]  [<f806e6ab>] serial_activate+0x4b/0x70 [usbserial]
      [  199.698521]  [<c126380c>] tty_port_open+0x7c/0xd0
      [  199.698527]  [<f806e660>] ? serial_set_termios+0xa0/0xa0 [usbserial]
      [  199.698534]  [<f806e76f>] serial_open+0x2f/0x70 [usbserial]
      [  199.698540]  [<c125d07c>] tty_open+0x20c/0x510
      [  199.698546]  [<c10e9eb7>] chrdev_open+0xe7/0x230
      [  199.698553]  [<c10e48f2>] __dentry_open+0x1f2/0x390
      [  199.698559]  [<c144bfec>] ? _raw_spin_unlock+0x2c/0x50
      [  199.698565]  [<c10e4b76>] nameidata_to_filp+0x66/0x80
      [  199.698570]  [<c10e9dd0>] ? cdev_put+0x20/0x20
      [  199.698576]  [<c10f3e08>] do_last+0x198/0x730
      [  199.698581]  [<c10f4440>] path_openat+0xa0/0x350
      [  199.698587]  [<c10f47d5>] do_filp_open+0x35/0x80
      [  199.698593]  [<c144bfec>] ? _raw_spin_unlock+0x2c/0x50
      [  199.698599]  [<c10ff110>] ? alloc_fd+0xc0/0x100
      [  199.698605]  [<c10f0b72>] ? getname_flags+0x72/0x120
      [  199.698611]  [<c10e4450>] do_sys_open+0xf0/0x1c0
      [  199.698617]  [<c11fcc08>] ? trace_hardirqs_on_thunk+0xc/0x10
      [  199.698623]  [<c10e458e>] sys_open+0x2e/0x40
      [  199.698628]  [<c144c990>] sysenter_do_call+0x12/0x36
      [  199.698632] Code: 85 89 00 00 00 8b 16 8b 4d c0 c1 e2 08 c7 44 24 14 88 13 00 00 81 ca 00 00 00 80 c7 44 24 10 00 00 00 00 c7 44 24 0c 00 00 00 00 <0f> b7 41 78 31 c9 89 44 24 08 c7 44 24 04 00 00 00 00 c7 04 24
      [  199.698884] EIP: [<f811a089>] ftdi_open+0x59/0xe0 [ftdi_sio] SS:ESP 0068:f515dcfc
      [  199.698893] CR2: 0000000000000078
      [  199.698925] ---[ end trace 77c43ec023940cff ]---
      Reported-and-tested-by: default avatarKen Huang <csuhgw@gmail.com>
      Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5d4047fd
    • Tomoya MORINAGA's avatar
      pch_uart: Fix MSI setting issue · 2ecec2f7
      Tomoya MORINAGA authored
      commit 867c902e upstream.
      
      The following patch (MSI setting) is not enough.
      
      commit e463595f
      Author: Alexander Stein <alexander.stein@systec-electronic.com>
      Date:   Mon Jul 4 08:58:31 2011 +0200
      
          pch_uart: Add MSI support
      Signed-off-by: default avatarAlexander Stein <alexander.stein@systec-electronic.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      
      To enable MSI mode, PCI bus-mastering must be enabled.
      This patch enables the setting.
      
      cc: Alexander Stein <alexander.stein@systec-electronic.com>
      Signed-off-by: default avatarTomoya MORINAGA <tomoya.rohm@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2ecec2f7
    • Neal Cardwell's avatar
      nohz: Fix stale jiffies update in tick_nohz_restart() · a867fed9
      Neal Cardwell authored
      commit 6f103929 upstream.
      
      Fix tick_nohz_restart() to not use a stale ktime_t "now" value when
      calling tick_do_update_jiffies64(now).
      
      If we reach this point in the loop it means that we crossed a tick
      boundary since we grabbed the "now" timestamp, so at this point "now"
      refers to a time in the old jiffy, so using the old value for "now" is
      incorrect, and is likely to give us a stale jiffies value.
      
      In particular, the first time through the loop the
      tick_do_update_jiffies64(now) call is always a no-op, since the
      caller, tick_nohz_restart_sched_tick(), will have already called
      tick_do_update_jiffies64(now) with that "now" value.
      
      Note that tick_nohz_stop_sched_tick() already uses the correct
      approach: when we notice we cross a jiffy boundary, grab a new
      timestamp with ktime_get(), and *then* update jiffies.
      Signed-off-by: default avatarNeal Cardwell <ncardwell@google.com>
      Cc: Ben Segall <bsegall@google.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Link: http://lkml.kernel.org/r/1332875377-23014-1-git-send-email-ncardwell@google.comSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a867fed9
    • Wang YanQing's avatar
      video:uvesafb: Fix oops that uvesafb try to execute NX-protected page · 27d6262d
      Wang YanQing authored
      commit b78f29ca upstream.
      
      This patch fix the oops below that catched in my machine
      
      [   81.560602] uvesafb: NVIDIA Corporation, GT216 Board - 0696a290, Chip Rev   , OEM: NVIDIA, VBE v3.0
      [   81.609384] uvesafb: protected mode interface info at c000:d350
      [   81.609388] uvesafb: pmi: set display start = c00cd3b3, set palette = c00cd40e
      [   81.609390] uvesafb: pmi: ports = 3b4 3b5 3ba 3c0 3c1 3c4 3c5 3c6 3c7 3c8 3c9 3cc 3ce 3cf 3d0 3d1 3d2 3d3 3d4 3d5 3da
      [   81.614558] uvesafb: VBIOS/hardware doesn't support DDC transfers
      [   81.614562] uvesafb: no monitor limits have been set, default refresh rate will be used
      [   81.614994] uvesafb: scrolling: ypan using protected mode interface, yres_virtual=4915
      [   81.744147] kernel tried to execute NX-protected page - exploit attempt? (uid: 0)
      [   81.744153] BUG: unable to handle kernel paging request at c00cd3b3
      [   81.744159] IP: [<c00cd3b3>] 0xc00cd3b2
      [   81.744167] *pdpt = 00000000016d6001 *pde = 0000000001c7b067 *pte = 80000000000cd163
      [   81.744171] Oops: 0011 [#1] SMP
      [   81.744174] Modules linked in: uvesafb(+) cfbcopyarea cfbimgblt cfbfillrect
      [   81.744178]
      [   81.744181] Pid: 3497, comm: modprobe Not tainted 3.3.0-rc4NX+ #71 Acer            Aspire 4741                    /Aspire 4741
      [   81.744185] EIP: 0060:[<c00cd3b3>] EFLAGS: 00010246 CPU: 0
      [   81.744187] EIP is at 0xc00cd3b3
      [   81.744189] EAX: 00004f07 EBX: 00000000 ECX: 00000000 EDX: 00000000
      [   81.744191] ESI: f763f000 EDI: f763f6e8 EBP: f57f3a0c ESP: f57f3a00
      [   81.744192]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
      [   81.744195] Process modprobe (pid: 3497, ti=f57f2000 task=f748c600 task.ti=f57f2000)
      [   81.744196] Stack:
      [   81.744197]  f82512c5 f759341c 00000000 f57f3a30 c124a9bc 00000001 00000001 000001e0
      [   81.744202]  f8251280 f763f000 f7593400 00000000 f57f3a40 c12598dd f5c0c000 00000000
      [   81.744206]  f57f3b10 c1255efe c125a21a 00000006 f763f09c 00000000 c1c6cb60 f7593400
      [   81.744210] Call Trace:
      [   81.744215]  [<f82512c5>] ? uvesafb_pan_display+0x45/0x60 [uvesafb]
      [   81.744222]  [<c124a9bc>] fb_pan_display+0x10c/0x160
      [   81.744226]  [<f8251280>] ? uvesafb_vbe_find_mode+0x180/0x180 [uvesafb]
      [   81.744230]  [<c12598dd>] bit_update_start+0x1d/0x50
      [   81.744232]  [<c1255efe>] fbcon_switch+0x39e/0x550
      [   81.744235]  [<c125a21a>] ? bit_cursor+0x4ea/0x560
      [   81.744240]  [<c129b6cb>] redraw_screen+0x12b/0x220
      [   81.744245]  [<c128843b>] ? tty_do_resize+0x3b/0xc0
      [   81.744247]  [<c129ef42>] vc_do_resize+0x3d2/0x3e0
      [   81.744250]  [<c129efb4>] vc_resize+0x14/0x20
      [   81.744253]  [<c12586bd>] fbcon_init+0x29d/0x500
      [   81.744255]  [<c12984c4>] ? set_inverse_trans_unicode+0xe4/0x110
      [   81.744258]  [<c129b378>] visual_init+0xb8/0x150
      [   81.744261]  [<c129c16c>] bind_con_driver+0x16c/0x360
      [   81.744264]  [<c129b47e>] ? register_con_driver+0x6e/0x190
      [   81.744267]  [<c129c3a1>] take_over_console+0x41/0x50
      [   81.744269]  [<c1257b7a>] fbcon_takeover+0x6a/0xd0
      [   81.744272]  [<c12594b8>] fbcon_event_notify+0x758/0x790
      [   81.744277]  [<c10929e2>] notifier_call_chain+0x42/0xb0
      [   81.744280]  [<c1092d30>] __blocking_notifier_call_chain+0x60/0x90
      [   81.744283]  [<c1092d7a>] blocking_notifier_call_chain+0x1a/0x20
      [   81.744285]  [<c124a5a1>] fb_notifier_call_chain+0x11/0x20
      [   81.744288]  [<c124b759>] register_framebuffer+0x1d9/0x2b0
      [   81.744293]  [<c1061c73>] ? ioremap_wc+0x33/0x40
      [   81.744298]  [<f82537c6>] uvesafb_probe+0xaba/0xc40 [uvesafb]
      [   81.744302]  [<c12bb81f>] platform_drv_probe+0xf/0x20
      [   81.744306]  [<c12ba558>] driver_probe_device+0x68/0x170
      [   81.744309]  [<c12ba731>] __device_attach+0x41/0x50
      [   81.744313]  [<c12b9088>] bus_for_each_drv+0x48/0x70
      [   81.744316]  [<c12ba7f3>] device_attach+0x83/0xa0
      [   81.744319]  [<c12ba6f0>] ? __driver_attach+0x90/0x90
      [   81.744321]  [<c12b991f>] bus_probe_device+0x6f/0x90
      [   81.744324]  [<c12b8a45>] device_add+0x5e5/0x680
      [   81.744329]  [<c122a1a3>] ? kvasprintf+0x43/0x60
      [   81.744332]  [<c121e6e4>] ? kobject_set_name_vargs+0x64/0x70
      [   81.744335]  [<c121e6e4>] ? kobject_set_name_vargs+0x64/0x70
      [   81.744339]  [<c12bbe9f>] platform_device_add+0xff/0x1b0
      [   81.744343]  [<f8252906>] uvesafb_init+0x50/0x9b [uvesafb]
      [   81.744346]  [<c100111f>] do_one_initcall+0x2f/0x170
      [   81.744350]  [<f82528b6>] ? uvesafb_is_valid_mode+0x66/0x66 [uvesafb]
      [   81.744355]  [<c10c6994>] sys_init_module+0xf4/0x1410
      [   81.744359]  [<c1157fc0>] ? vfsmount_lock_local_unlock_cpu+0x30/0x30
      [   81.744363]  [<c144cb10>] sysenter_do_call+0x12/0x36
      [   81.744365] Code: f5 00 00 00 32 f6 66 8b da 66 d1 e3 66 ba d4 03 8a e3 b0 1c 66 ef b0 1e 66 ef 8a e7 b0 1d 66 ef b0 1f 66 ef e8 fa 00 00 00 61 c3 <60> e8 c8 00 00 00 66 8b f3 66 8b da 66 ba d4 03 b0 0c 8a e5 66
      [   81.744388] EIP: [<c00cd3b3>] 0xc00cd3b3 SS:ESP 0068:f57f3a00
      [   81.744391] CR2: 00000000c00cd3b3
      [   81.744393] ---[ end trace 18b2c87c925b54d6 ]---
      Signed-off-by: default avatarWang YanQing <udknight@gmail.com>
      Cc: Michal Januszewski <spock@gentoo.org>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: default avatarFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      27d6262d
    • David Miller's avatar
      perf hists: Catch and handle out-of-date hist entry maps. · eda1d99a
      David Miller authored
      commit 63fa471d upstream.
      
      When a process exec()'s, all the maps are retired, but we keep the hist
      entries around which hold references to those outdated maps.
      
      If the same library gets mapped in for which we have hist entries, a new
      map will be created.  But when we take a perf entry hit within that map,
      we'll find the existing hist entry with the older map.
      
      This causes symbol translations to be done incorrectly.  For example,
      the perf entry processing will lookup the correct uptodate map entry and
      use that to calculate the symbol and DSO relative address.  But later
      when we update the histogram we'll translate the address using the
      outdated map file instead leading to conditions such as out-of-range
      offsets in symbol__inc_addr_samples().
      
      Therefore, update the map of the hist_entry dynamically at lookup/
      creation time.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Link: http://lkml.kernel.org/r/20120327.031418.1220315351537060808.davem@davemloft.netSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      eda1d99a