1. 17 Jun, 2014 40 commits
    • Thomas Gleixner's avatar
      futex: Always cleanup owner tid in unlock_pi · 68ef685c
      Thomas Gleixner authored
      commit 13fbca4c upstream.
      
      If the owner died bit is set at futex_unlock_pi, we currently do not
      cleanup the user space futex.  So the owner TID of the current owner
      (the unlocker) persists.  That's observable inconsistant state,
      especially when the ownership of the pi state got transferred.
      
      Clean it up unconditionally.
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Will Drewry <wad@chromium.org>
      Cc: Darren Hart <dvhart@linux.intel.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      68ef685c
    • Thomas Gleixner's avatar
      futex: Validate atomic acquisition in futex_lock_pi_atomic() · 42f2b1ac
      Thomas Gleixner authored
      commit b3eaa9fc upstream.
      
      We need to protect the atomic acquisition in the kernel against rogue
      user space which sets the user space futex to 0, so the kernel side
      acquisition succeeds while there is existing state in the kernel
      associated to the real owner.
      
      Verify whether the futex has waiters associated with kernel state.  If
      it has, return -EINVAL.  The state is corrupted already, so no point in
      cleaning it up.  Subsequent calls will fail as well.  Not our problem.
      
      [ tglx: Use futex_top_waiter() and explain why we do not need to try
        	restoring the already corrupted user space state. ]
      Signed-off-by: default avatarDarren Hart <dvhart@linux.intel.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Will Drewry <wad@chromium.org>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      42f2b1ac
    • Thomas Gleixner's avatar
      futex-prevent-requeue-pi-on-same-futex.patch futex: Forbid uaddr == uaddr2 in... · 55fabc28
      Thomas Gleixner authored
      futex-prevent-requeue-pi-on-same-futex.patch futex: Forbid uaddr == uaddr2 in futex_requeue(..., requeue_pi=1)
      
      commit e9c243a5 upstream.
      
      If uaddr == uaddr2, then we have broken the rule of only requeueing from
      a non-pi futex to a pi futex with this call.  If we attempt this, then
      dangling pointers may be left for rt_waiter resulting in an exploitable
      condition.
      
      This change brings futex_requeue() in line with futex_wait_requeue_pi()
      which performs the same check as per commit 6f7b0a2a ("futex: Forbid
      uaddr == uaddr2 in futex_wait_requeue_pi()")
      
      [ tglx: Compare the resulting keys as well, as uaddrs might be
        	different depending on the mapping ]
      
      Fixes CVE-2014-3153.
      
      Reported-by: Pinkie Pie
      Signed-off-by: default avatarWill Drewry <wad@chromium.org>
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: default avatarDarren Hart <dvhart@linux.intel.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      55fabc28
    • Sebastian Ott's avatar
      percpu-refcount: fix usage of this_cpu_ops · d103b9d5
      Sebastian Ott authored
      commit 0c36b390 upstream.
      
      The percpu-refcount infrastructure uses the underscore variants of
      this_cpu_ops in order to modify percpu reference counters.
      (e.g. __this_cpu_inc()).
      
      However the underscore variants do not atomically update the percpu
      variable, instead they may be implemented using read-modify-write
      semantics (more than one instruction).  Therefore it is only safe to
      use the underscore variant if the context is always the same (process,
      softirq, or hardirq). Otherwise it is possible to lose updates.
      
      This problem is something that Sebastian has seen within the aio
      subsystem which uses percpu refcounters both in process and softirq
      context leading to reference counts that never dropped to zeroes; even
      though the number of "get" and "put" calls matched.
      
      Fix this by using the non-underscore this_cpu_ops variant which
      provides correct per cpu atomic semantics and fixes the corrupted
      reference counts.
      
      Cc: Kent Overstreet <kmo@daterainc.com>
      Reported-by: default avatarSebastian Ott <sebott@linux.vnet.ibm.com>
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      References: http://lkml.kernel.org/g/alpine.LFD.2.11.1406041540520.21183@denkbrettSigned-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      d103b9d5
    • Roland Dreier's avatar
      iscsi-target: Fix wrong buffer / buffer overrun in iscsi_change_param_value() · caea43f2
      Roland Dreier authored
      commit 79d59d08 upstream.
      
      In non-leading connection login, iscsi_login_non_zero_tsih_s1() calls
      iscsi_change_param_value() with the buffer it uses to hold the login
      PDU, not a temporary buffer.  This leads to the login header getting
      corrupted and login failing for non-leading connections in MC/S.
      
      Fix this by adding a wrapper iscsi_change_param_sprintf() that handles
      the temporary buffer itself to avoid confusion.  Also handle sending a
      reject in case of failure in the wrapper, which lets the calling code
      get quite a bit smaller and easier to read.
      
      Finally, bump the size of the temporary buffer from 32 to 64 bytes to be
      safe, since "MaxRecvDataSegmentLength=" by itself is 25 bytes; with a
      trailing NUL, a value >= 1M will lead to a buffer overrun.  (This isn't
      the default but we don't need to run right at the ragged edge here)
      Reported-by: default avatarSantosh Kulkarni <santosh.kulkarni@calsoftinc.com>
      Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      [ kamal: backport to 3.13-stable: omit inapplicable bit from
        iscsi_login_zero_tsih_s2 ]
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      caea43f2
    • Nicholas Bellinger's avatar
      iser-target: Add missing target_put_sess_cmd for ImmedateData failure · e4696650
      Nicholas Bellinger authored
      commit 6cc44a6f upstream.
      
      This patch addresses a bug where an early exception for SCSI WRITE
      with ImmediateData=Yes was missing the target_put_sess_cmd() call
      to drop the extra se_cmd->cmd_kref reference obtained during the
      normal iscsit_setup_scsi_cmd() codepath execution.
      
      This bug was manifesting itself during session shutdown within
      isert_cq_rx_comp_err() where target_wait_for_sess_cmds() would
      end up waiting indefinately for the last se_cmd->cmd_kref put to
      occur for the failed SCSI WRITE + ImmediateData descriptors.
      
      This fix follows what traditional iscsi-target code already does
      for the same failure case within iscsit_get_immediate_data().
      Reported-by: default avatarSagi Grimberg <sagig@dev.mellanox.co.il>
      Cc: Sagi Grimberg <sagig@dev.mellanox.co.il>
      Cc: Or Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      e4696650
    • Takashi Iwai's avatar
      ALSA: hda/realtek - Fix COEF widget NID for ALC260 replacer fixup · a395fc12
      Takashi Iwai authored
      commit 192a98e2 upstream.
      
      The conversion to a fixup table for Replacer model with ALC260 in
      commit 20f7d928 took the wrong widget NID for COEF setups.  Namely,
      NID 0x1a should have been used instead of NID 0x20, which is the
      common node for all Realtek codecs but ALC260.
      
      Fixes: 20f7d928 ('ALSA: hda/realtek - Replace ALC260 model=replacer with the auto-parser')
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      a395fc12
    • Ronan Marquet's avatar
      ALSA: hda/realtek - Correction of fixup codes for PB V7900 laptop · dd11e808
      Ronan Marquet authored
      commit e30cf2d2 upstream.
      
      Correcion of wrong fixup entries add in commit ca8f0424 to replace
      static model quirk for PB V7900 laptop (will model).
      
      [note: the removal of ALC260_FIXUP_HP_PIN_0F chain is also needed as a
       part of the fix; otherwise the pin is set up wrongly as a headphone,
       and user-space (PulseAudio) may be wrongly trying to detect the jack
       state -- tiwai]
      
      Fixes: ca8f0424 ('ALSA: hda/realtek - Add the fixup codes for ALC260 model=will')
      Signed-off-by: default avatarRonan Marquet <ronan.marquet@orange.fr>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      dd11e808
    • Christian König's avatar
      drm/radeon: use the CP DMA on CIK · 60d9c087
      Christian König authored
      commit 91b0275c upstream.
      
      The SDMA sometimes doesn't seem to work reliable.
      Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      60d9c087
    • Alex Deucher's avatar
      drm/radeon/dpm: resume fixes for some systems · 8a4f8b94
      Alex Deucher authored
      commit 3640da2f upstream.
      
      Setting the power state prior to restoring the display
      hardware leads to blank screens on some systems.  Drop
      the power state set from dpm resume.  The power state
      will get set as part of the mode set sequence.  Also
      add an explicit power state set after mode set resume
      to cover PX and headless systems.
      
      bug:
      https://bugzilla.kernel.org/show_bug.cgi?id=76761Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      [ kamal: backport to 3.13-stable: context ]
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      8a4f8b94
    • Takashi Iwai's avatar
      ALSA: hda/analog - Fix silent output on ASUS A8JN · 7d942a78
      Takashi Iwai authored
      commit 598e3061 upstream.
      
      ASUS A8JN with AD1986A codec seems following the normal EAPD in the
      normal order (0 = off, 1 = on) unlike other machines with AD1986A.
      Apply the workaround used for Toshiba laptop that showed the same
      problem.
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=75041Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      7d942a78
    • NeilBrown's avatar
      md: always set MD_RECOVERY_INTR when interrupting a reshape thread. · 516b5bba
      NeilBrown authored
      commit 2ac295a5 upstream.
      
      Commit 8313b8e5
         md: fix problem when adding device to read-only array with bitmap.
      
      added a called to md_reap_sync_thread() which cause a reshape thread
      to be interrupted (in particular, it could cause md_thread() to never even
      call md_do_sync()).
      However it didn't set MD_RECOVERY_INTR so ->finish_reshape() would not
      know that the reshape didn't complete.
      
      This only happens when mddev->ro is set and normally reshape threads
      don't run in that situation.  But raid5 and raid10 can start a reshape
      thread during "run" is the array is in the middle of a reshape.
      They do this even if ->ro is set.
      
      So it is best to set MD_RECOVERY_INTR before abortingg the
      sync thread, just in case.
      
      Though it rare for this to trigger a problem it can cause data corruption
      because the reshape isn't finished properly.
      So it is suitable for any stable which the offending commit was applied to.
      (3.2 or later)
      
      Fixes: 8313b8e5Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      516b5bba
    • Mathias Nyman's avatar
      xhci: delete endpoints from bandwidth list before freeing whole device · 1e207c7d
      Mathias Nyman authored
      commit 5dc2808c upstream.
      
      Lists of endpoints are stored for bandwidth calculation for roothub ports.
      Make sure we remove all endpoints from the list before the whole device,
      containing its endpoints list_head stuctures, is freed.
      
      This used to be done in the wrong order in xhci_mem_cleanup(),
      and triggered an oops in resume from S4 (hibernate).
      Tested-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      1e207c7d
    • NeilBrown's avatar
      md: always set MD_RECOVERY_INTR when aborting a reshape or other "resync". · 1a388f0a
      NeilBrown authored
      commit 3991b31e upstream.
      
      If mddev->ro is set, md_to_sync will (correctly) abort.
      However in that case MD_RECOVERY_INTR isn't set.
      
      If a RESHAPE had been requested, then ->finish_reshape() will be
      called and it will think the reshape was successful even though
      nothing happened.
      
      Normally a resync will not be requested if ->ro is set, but if an
      array is stopped while a reshape is on-going, then when the array is
      started, the reshape will be restarted.  If the array is also set
      read-only at this point, the reshape will instantly appear to success,
      resulting in data corruption.
      
      Consequently, this patch is suitable for any -stable kernel.
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      1a388f0a
    • Greg Kroah-Hartman's avatar
      USB: cdc-wdm: properly include types.h · aa5d8c69
      Greg Kroah-Hartman authored
      commit 7ac3764f upstream.
      
      The file include/uapi/linux/usb/cdc-wdm.h uses a __u16 so it needs to
      include types.h as well to make the build system happy.
      
      Fixes: 3edce1cf ("USB: cdc-wdm: implement IOCTL_WDM_MAX_COMMAND")
      Cc: Bjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      aa5d8c69
    • Alexej Starschenko's avatar
      USB: serial: option: add support for Novatel E371 PCIe card · d3c895b7
      Alexej Starschenko authored
      commit 8a61ba3a upstream.
      
      Adds product ID for the Novatel E371 PCI Express Mini Card.
      
      $ lsusb
      Bus 001 Device 024: ID 1410:9011 Novatel Wireless
      
      $ usb-devices
      T:  Bus=01 Lev=01 Prnt=01 Port=03 Cnt=01 Dev#= 24 Spd=480 MxCh= 0
      D:  Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=1410 ProdID=9011 Rev=00.03
      S:  Manufacturer=Novatel Wireless, Inc.
      S:  Product=Novatel Wireless HSPA
      S:  SerialNumber=012773002115811
      C:  #Ifs= 6 Cfg#= 1 Atr=e0 MxPwr=500mA
      I:  If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
      I:  If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
      I:  If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
      I:  If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
      I:  If#= 6 Alt= 0 #EPs= 1 Cls=02(commc) Sub=06 Prot=00 Driver=cdc_ether
      I:  If#= 7 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether
      
      Tested with kernel 3.2.0.
      Signed-off-by: default avatarAlexej Starschenko <starschenko@gmail.com>
      Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      d3c895b7
    • George McCollister's avatar
      USB: ftdi_sio: add NovaTech OrionLXm product ID · bf3729d7
      George McCollister authored
      commit d0839d75 upstream.
      
      The NovaTech OrionLXm uses an onboard FTDI serial converter for JTAG and
      console access.
      
      Here is the lsusb output:
      Bus 004 Device 123: ID 0403:7c90 Future Technology Devices
      International, Ltd
      Signed-off-by: default avatarGeorge McCollister <george.mccollister@gmail.com>
      Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      bf3729d7
    • Johan Hovold's avatar
      USB: io_ti: fix firmware download on big-endian machines (part 2) · 311b9920
      Johan Hovold authored
      commit c03890ff upstream.
      
      A recent patch that purported to fix firmware download on big-endian
      machines failed to add the corresponding sparse annotation to the
      i2c-header. This was reported by the kbuild test robot.
      
      Adding the appropriate annotation revealed another endianess bug related
      to the i2c-header Size-field in a code path that is exercised when the
      firmware is actually being downloaded (and not just verified and left
      untouched unless older than the firmware at hand).
      
      This patch adds the required sparse annotation to the i2c-header and
      makes sure that the Size-field is sent in little-endian byte order
      during firmware download also on big-endian machines.
      
      Note that this patch is only compile-tested, but that there is no
      functional change for little-endian systems.
      Reported-by: default avatarkbuild test robot <fengguang.wu@intel.com>
      Cc: Ludovic Drolez <ldrolez@debian.org>
      Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      311b9920
    • Oliver Hartkopp's avatar
      can: only rename enabled led triggers when changing the netdev name · d1ed8e48
      Oliver Hartkopp authored
      commit 45fb4f8d upstream.
      
      Commit a1ef7bd9 ("can: rename LED trigger name on netdev renames") renames
      the led trigger names according to the changed netdevice name.
      
      As not every CAN driver supports and initializes the led triggers, checking for
      the CAN private datastructure with safe_candev_priv() in the notifier chain is
      not enough.
      
      This patch adds a check when CONFIG_CAN_LEDS is enabled and the driver does not
      support led triggers.
      
      For stable 3.9+
      
      Cc: Fabio Baltieri <fabio.baltieri@gmail.com>
      Signed-off-by: default avatarOliver Hartkopp <socketcan@hartkopp.net>
      Acked-by: default avatarKurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      d1ed8e48
    • Alan Stern's avatar
      USB: Avoid runtime suspend loops for HCDs that can't handle suspend/resume · f4addd70
      Alan Stern authored
      commit 8ef42ddd upstream.
      
      Not all host controller drivers have bus-suspend and bus-resume
      methods.  When one doesn't, it will cause problems if runtime PM is
      enabled in the kernel.  The PM core will attempt to suspend the
      controller's root hub, the suspend will fail because there is no
      bus-suspend routine, and a -EBUSY error code will be returned to the
      PM core.  This will cause the suspend attempt to be repeated shortly
      thereafter, in a never-ending loop.
      
      Part of the problem is that the original error code -ENOENT gets
      changed to -EBUSY in usb_runtime_suspend(), on the grounds that the PM
      core will interpret -ENOENT as meaning that the root hub has gotten
      into a runtime-PM error state.  While this change is appropriate for
      real USB devices, it's not such a good idea for a root hub.  In fact,
      considering the root hub to be in a runtime-PM error state would not
      be far from the truth.  Therefore this patch updates
      usb_runtime_suspend() so that it adjusts error codes only for
      non-root-hub devices.
      
      Furthermore, the patch attempts to prevent the problem from occurring
      in the first place by not enabling runtime PM by default for root hubs
      whose host controller driver doesn't have bus_suspend and bus_resume
      methods.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Reported-by: default avatarWill Deacon <will.deacon@arm.com>
      Tested-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      f4addd70
    • Ben Hutchings's avatar
      Staging: speakup: Move pasting into a work item · 39740c6f
      Ben Hutchings authored
      commit d7500135 upstream.
      
      Input is handled in softirq context, but when pasting we may
      need to sleep.  speakup_paste_selection() currently tries to
      bodge this by busy-waiting if in_atomic(), but that doesn't
      help because the ldisc may also sleep.
      
      For bonus breakage, speakup_paste_selection() changes the
      state of current, even though it's not running in process
      context.
      
      Move it into a work item and make sure to cancel it on exit.
      
      References: https://bugs.debian.org/735202
      References: https://bugs.debian.org/744015Reported-by: default avatarPaul Gevers <elbrus@debian.org>
      Reported-and-tested-by: default avatarJarek Czekalski <jarekczek@poczta.onet.pl>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      39740c6f
    • Emmanuel Grumbach's avatar
      iwlwifi: mvm: fix setting channel in monitor mode · 1413ca2b
      Emmanuel Grumbach authored
      commit 1c4abec0 upstream.
      
      There was a deadlock in monitor mode when we were setting the
      channel if the channel was not 1.
      
      ======================================================
      [ INFO: possible circular locking dependency detected ]
      3.14.3 #4 Not tainted
      -------------------------------------------------------
      iw/3323 is trying to acquire lock:
       (&local->chanctx_mtx){+.+.+.}, at: [<ffffffffa062e2f2>] ieee80211_vif_release_channel+0x42/0xb0 [mac80211]
      
      but task is already holding lock:
       (&local->iflist_mtx){+.+...}, at: [<ffffffffa0609e0a>] ieee80211_set_monitor_channel+0x5a/0x1b0 [mac80211]
      
      which lock already depends on the new lock.
      
      the existing dependency chain (in reverse order) is:
      
      -> #2 (&local->iflist_mtx){+.+...}:
             [<ffffffff810d95bb>] __lock_acquire+0xb3b/0x13b0
             [<ffffffff810d9ee0>] lock_acquire+0xb0/0x1f0
             [<ffffffff817eb9c8>] mutex_lock_nested+0x78/0x4f0
             [<ffffffffa06225cf>] ieee80211_iterate_active_interfaces+0x2f/0x60 [mac80211]
             [<ffffffffa0518189>] iwl_mvm_recalc_multicast+0x49/0xa0 [iwlmvm]
             [<ffffffffa051822e>] iwl_mvm_configure_filter+0x4e/0x70 [iwlmvm]
             [<ffffffffa05e6d43>] ieee80211_configure_filter+0x153/0x5f0 [mac80211]
             [<ffffffffa05e71f5>] ieee80211_reconfig_filter+0x15/0x20 [mac80211]
             [snip]
      
      -> #1 (&mvm->mutex){+.+.+.}:
             [<ffffffff810d95bb>] __lock_acquire+0xb3b/0x13b0
             [<ffffffff810d9ee0>] lock_acquire+0xb0/0x1f0
             [<ffffffff817eb9c8>] mutex_lock_nested+0x78/0x4f0
             [<ffffffffa0517246>] iwl_mvm_add_chanctx+0x56/0xe0 [iwlmvm]
             [<ffffffffa062ca1e>] ieee80211_new_chanctx+0x13e/0x410 [mac80211]
             [<ffffffffa062d953>] ieee80211_vif_use_channel+0x1c3/0x5a0 [mac80211]
             [<ffffffffa06035ab>] ieee80211_add_virtual_monitor+0x1ab/0x6b0 [mac80211]
             [<ffffffffa06052ea>] ieee80211_do_open+0xe6a/0x15a0 [mac80211]
             [<ffffffffa0605a79>] ieee80211_open+0x59/0x60 [mac80211]
             [snip]
      
      -> #0 (&local->chanctx_mtx){+.+.+.}:
             [<ffffffff810d6cb7>] check_prevs_add+0x977/0x980
             [<ffffffff810d95bb>] __lock_acquire+0xb3b/0x13b0
             [<ffffffff810d9ee0>] lock_acquire+0xb0/0x1f0
             [<ffffffff817eb9c8>] mutex_lock_nested+0x78/0x4f0
             [<ffffffffa062e2f2>] ieee80211_vif_release_channel+0x42/0xb0 [mac80211]
             [<ffffffffa0609ec3>] ieee80211_set_monitor_channel+0x113/0x1b0 [mac80211]
             [<ffffffffa058fb37>] cfg80211_set_monitor_channel+0x77/0x2b0 [cfg80211]
             [<ffffffffa056e0b2>] __nl80211_set_channel+0x122/0x140 [cfg80211]
             [<ffffffffa0581374>] nl80211_set_wiphy+0x284/0xaf0 [cfg80211]
             [snip]
      
      other info that might help us debug this:
      
      Chain exists of:
        &local->chanctx_mtx --> &mvm->mutex --> &local->iflist_mtx
      
       Possible unsafe locking scenario:
      
             CPU0                    CPU1
             ----                    ----
        lock(&local->iflist_mtx);
                                     lock(&mvm->mutex);
                                     lock(&local->iflist_mtx);
        lock(&local->chanctx_mtx);
      
       *** DEADLOCK ***
      
      This deadlock actually occurs:
      INFO: task iw:3323 blocked for more than 120 seconds.
            Not tainted 3.14.3 #4
      "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
      iw              D ffff8800c8afcd80  4192  3323   3322 0x00000000
       ffff880078fdb7e0 0000000000000046 ffff8800c8afcd80 ffff880078fdbfd8
       00000000001d5540 00000000001d5540 ffff8801141b0000 ffff8800c8afcd80
       ffff880078ff9e38 ffff880078ff9e38 ffff880078ff9e40 0000000000000246
      Call Trace:
       [<ffffffff817ea841>] schedule_preempt_disabled+0x31/0x80
       [<ffffffff817ebaed>] mutex_lock_nested+0x19d/0x4f0
       [<ffffffffa06225cf>] ? ieee80211_iterate_active_interfaces+0x2f/0x60 [mac80211]
       [<ffffffffa06225cf>] ? ieee80211_iterate_active_interfaces+0x2f/0x60 [mac80211]
       [<ffffffffa052a680>] ? iwl_mvm_power_mac_update_mode+0xc0/0xc0 [iwlmvm]
       [<ffffffffa06225cf>] ieee80211_iterate_active_interfaces+0x2f/0x60 [mac80211]
       [<ffffffffa0529357>] _iwl_mvm_power_update_binding+0x27/0x80 [iwlmvm]
       [<ffffffffa0516eb1>] iwl_mvm_unassign_vif_chanctx+0x81/0xc0 [iwlmvm]
       [<ffffffffa062d3ff>] __ieee80211_vif_release_channel+0xdf/0x470 [mac80211]
       [<ffffffffa062e2fa>] ieee80211_vif_release_channel+0x4a/0xb0 [mac80211]
       [<ffffffffa0609ec3>] ieee80211_set_monitor_channel+0x113/0x1b0 [mac80211]
       [<ffffffffa058fb37>] cfg80211_set_monitor_channel+0x77/0x2b0 [cfg80211]
       [<ffffffffa056e0b2>] __nl80211_set_channel+0x122/0x140 [cfg80211]
       [<ffffffffa0581374>] nl80211_set_wiphy+0x284/0xaf0 [cfg80211]
      
      This fixes https://bugzilla.kernel.org/show_bug.cgi?id=75541Reviewed-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      [ kamal: backport to 3.13: omit iwl_mvm_recalc_multicast change (not impl.) ]
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      1413ca2b
    • Marek Olšák's avatar
      drm/radeon: don't allow RADEON_GEM_DOMAIN_CPU for command submission · b8cf9dd8
      Marek Olšák authored
      commit ec65da38 upstream.
      
      It hangs the hardware.
      Signed-off-by: default avatarMarek Olšák <marek.olsak@amd.com>
      Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      b8cf9dd8
    • Christian König's avatar
    • Thomas Gleixner's avatar
      rtmutex: Fix deadlock detector for real · f599cbdf
      Thomas Gleixner authored
      commit 397335f0 upstream.
      
      The current deadlock detection logic does not work reliably due to the
      following early exit path:
      
      	/*
      	 * Drop out, when the task has no waiters. Note,
      	 * top_waiter can be NULL, when we are in the deboosting
      	 * mode!
      	 */
      	if (top_waiter && (!task_has_pi_waiters(task) ||
      			   top_waiter != task_top_pi_waiter(task)))
      		goto out_unlock_pi;
      
      So this not only exits when the task has no waiters, it also exits
      unconditionally when the current waiter is not the top priority waiter
      of the task.
      
      So in a nested locking scenario, it might abort the lock chain walk
      and therefor miss a potential deadlock.
      
      Simple fix: Continue the chain walk, when deadlock detection is
      enabled.
      
      We also avoid the whole enqueue, if we detect the deadlock right away
      (A-A). It's an optimization, but also prevents that another waiter who
      comes in after the detection and before the task has undone the damage
      observes the situation and detects the deadlock and returns
      -EDEADLOCK, which is wrong as the other task is not in a deadlock
      situation.
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Reviewed-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
      Link: http://lkml.kernel.org/r/20140522031949.725272460@linutronix.deSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      f599cbdf
    • Srivatsa S. Bhat's avatar
      powerpc, kexec: Fix "Processor X is stuck" issue during kexec from ST mode · c2435d8f
      Srivatsa S. Bhat authored
      commit 011e4b02 upstream.
      
      If we try to perform a kexec when the machine is in ST (Single-Threaded) mode
      (ppc64_cpu --smt=off), the kexec operation doesn't succeed properly, and we
      get the following messages during boot:
      
      [    0.089866] POWER8 performance monitor hardware support registered
      [    0.089985] power8-pmu: PMAO restore workaround active.
      [    5.095419] Processor 1 is stuck.
      [   10.097933] Processor 2 is stuck.
      [   15.100480] Processor 3 is stuck.
      [   20.102982] Processor 4 is stuck.
      [   25.105489] Processor 5 is stuck.
      [   30.108005] Processor 6 is stuck.
      [   35.110518] Processor 7 is stuck.
      [   40.113369] Processor 9 is stuck.
      [   45.115879] Processor 10 is stuck.
      [   50.118389] Processor 11 is stuck.
      [   55.120904] Processor 12 is stuck.
      [   60.123425] Processor 13 is stuck.
      [   65.125970] Processor 14 is stuck.
      [   70.128495] Processor 15 is stuck.
      [   75.131316] Processor 17 is stuck.
      
      Note that only the sibling threads are stuck, while the primary threads (0, 8,
      16 etc) boot just fine. Looking closer at the previous step of kexec, we observe
      that kexec tries to wakeup (bring online) the sibling threads of all the cores,
      before performing kexec:
      
      [ 9464.131231] Starting new kernel
      [ 9464.148507] kexec: Waking offline cpu 1.
      [ 9464.148552] kexec: Waking offline cpu 2.
      [ 9464.148600] kexec: Waking offline cpu 3.
      [ 9464.148636] kexec: Waking offline cpu 4.
      [ 9464.148671] kexec: Waking offline cpu 5.
      [ 9464.148708] kexec: Waking offline cpu 6.
      [ 9464.148743] kexec: Waking offline cpu 7.
      [ 9464.148779] kexec: Waking offline cpu 9.
      [ 9464.148815] kexec: Waking offline cpu 10.
      [ 9464.148851] kexec: Waking offline cpu 11.
      [ 9464.148887] kexec: Waking offline cpu 12.
      [ 9464.148922] kexec: Waking offline cpu 13.
      [ 9464.148958] kexec: Waking offline cpu 14.
      [ 9464.148994] kexec: Waking offline cpu 15.
      [ 9464.149030] kexec: Waking offline cpu 17.
      
      Instrumenting this piece of code revealed that the cpu_up() operation actually
      fails with -EBUSY. Thus, only the primary threads of all the cores are online
      during kexec, and hence this is a sure-shot receipe for disaster, as explained
      in commit e8e5c215 (powerpc/kexec: Fix orphaned offline CPUs across kexec),
      as well as in the comment above wake_offline_cpus().
      
      It turns out that cpu_up() was returning -EBUSY because the variable
      'cpu_hotplug_disabled' was set to 1; and this disabling of CPU hotplug was done
      by migrate_to_reboot_cpu() inside kernel_kexec().
      
      Now, migrate_to_reboot_cpu() was originally written with the assumption that
      any further code will not need to perform CPU hotplug, since we are anyway in
      the reboot path. However, kexec is clearly not such a case, since we depend on
      onlining CPUs, atleast on powerpc.
      
      So re-enable cpu-hotplug after returning from migrate_to_reboot_cpu() in the
      kexec path, to fix this regression in kexec on powerpc.
      
      Also, wrap the cpu_up() in powerpc kexec code within a WARN_ON(), so that we
      can catch such issues more easily in the future.
      
      Fixes: c97102ba (kexec: migrate to reboot cpu)
      Signed-off-by: default avatarSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      c2435d8f
    • Guenter Roeck's avatar
      powerpc: Fix 64 bit builds with binutils 2.24 · 5eb2be0d
      Guenter Roeck authored
      commit 7998eb3d upstream.
      
      With binutils 2.24, various 64 bit builds fail with relocation errors
      such as
      
      arch/powerpc/kernel/built-in.o: In function `exc_debug_crit_book3e':
      	(.text+0x165ee): relocation truncated to fit: R_PPC64_ADDR16_HI
      	against symbol `interrupt_base_book3e' defined in .text section
      	in arch/powerpc/kernel/built-in.o
      arch/powerpc/kernel/built-in.o: In function `exc_debug_crit_book3e':
      	(.text+0x16602): relocation truncated to fit: R_PPC64_ADDR16_HI
      	against symbol `interrupt_end_book3e' defined in .text section
      	in arch/powerpc/kernel/built-in.o
      
      The assembler maintainer says:
      
       I changed the ABI, something that had to be done but unfortunately
       happens to break the booke kernel code.  When building up a 64-bit
       value with lis, ori, shl, oris, ori or similar sequences, you now
       should use @high and @higha in place of @h and @ha.  @h and @ha
       (and their associated relocs R_PPC64_ADDR16_HI and R_PPC64_ADDR16_HA)
       now report overflow if the value is out of 32-bit signed range.
       ie. @h and @ha assume you're building a 32-bit value. This is needed
       to report out-of-range -mcmodel=medium toc pointer offsets in @toc@h
       and @toc@ha expressions, and for consistency I did the same for all
       other @h and @ha relocs.
      
      Replacing @h with @high in one strategic location fixes the relocation
      errors. This has to be done conditionally since the assembler either
      supports @h or @high but not both.
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      5eb2be0d
    • Ming Lei's avatar
      virtio_blk: fix race between start and stop queue · 90a72749
      Ming Lei authored
      commit aa0818c6 upstream.
      
      When there isn't enough vring descriptor for adding to vq,
      blk-mq will be put as stopped state until some of pending
      descriptors are completed & freed.
      
      Unfortunately, the vq's interrupt may come just before
      blk-mq's BLK_MQ_S_STOPPED flag is set, so the blk-mq will
      still be kept as stopped even though lots of descriptors
      are completed and freed in the interrupt handler. The worst
      case is that all pending descriptors are freed in the
      interrupt handler, and the queue is kept as stopped forever.
      
      This patch fixes the problem by starting/stopping blk-mq
      with holding vq_lock.
      
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: default avatarMing Lei <tom.leiming@gmail.com>
      Signed-off-by: default avatarJens Axboe <axboe@fb.com>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      90a72749
    • Rusty Russell's avatar
      virtio_blk: don't crash, report error if virtqueue is broken. · 4d197b0e
      Rusty Russell authored
      commit 5261b85e upstream.
      
      A bad implementation of virtio might cause us to mark the virtqueue
      broken: we'll dev_err() in that case, and the device is useless, but
      let's not BUG_ON().
      
      ENOMEM or ENOSPC implies the ring is full, and we should try again
      later (-ENOMEM is documented to happen, but doesn't, as we fall
      through to ENOSPC).
      
      EIO means it's broken.
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      4d197b0e
    • Heinz Mauelshagen's avatar
      dm cache: always split discards on cache block boundaries · 4278960d
      Heinz Mauelshagen authored
      commit f1daa838 upstream.
      
      The DM cache target cannot cope with discards that span multiple cache
      blocks, so each discard bio that spans more than one cache block must
      get split by the DM core.
      Signed-off-by: default avatarHeinz Mauelshagen <heinzm@redhat.com>
      Acked-by: default avatarJoe Thornber <ejt@redhat.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      4278960d
    • Chris Wilson's avatar
      drm/i915: Only copy back the modified fields to userspace from execbuffer · 9dc81d5a
      Chris Wilson authored
      commit 9aab8bff upstream.
      
      We only want to modifiy a single field in the userspace view of the
      execbuffer command buffer, so explicitly change that rather than copy
      everything back again.
      
      This serves two purposes:
      
      1. The single fields are much cheaper to copy (constant size so the
      copy uses special case code) and much smaller than the whole array.
      
      2. We modify the array for internal use that need to be masked from
      the user.
      
      Note: We need this backported since without it the next bugfix will
      blow up when userspace recycles batchbuffers and relocations.
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      9dc81d5a
    • Hans de Goede's avatar
      Input: synaptics - T540p - unify with other LEN0034 models · e59ce5b5
      Hans de Goede authored
      commit 6d396ede upstream.
      
      The T540p has a touchpad with pnp-id LEN0034, all the models with this
      pnp-id have the same min/max values, except the T540p where the values are
      slightly off. Fix them to be identical.
      
      This is a preparation patch for simplifying the quirk table.
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      e59ce5b5
    • Rabin Vincent's avatar
      ARM: 8064/1: fix v7-M signal return · d7e2eb19
      Rabin Vincent authored
      commit 483a6c9d upstream.
      
      According to the ARM ARM, the behaviour is UNPREDICTABLE if the PC read
      from the exception return stack is not half word aligned.  See the
      pseudo code for ExceptionReturn() and PopStack().
      
      The signal handler's address has the bit 0 set, and setup_return()
      directly writes this to regs->ARM_pc.  Current hardware happens to
      discard this bit, but QEMU's emulation doesn't and this makes processes
      crash.  Mask out bit 0 before the exception return in order to get
      predictable behaviour.
      
      Fixes: 19c4d593 ("ARM: ARMv7-M: Add support for exception handling")
      Acked-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Signed-off-by: default avatarRabin Vincent <rabin@rab.in>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      d7e2eb19
    • Andrey Ryabinin's avatar
      ARM: 8051/1: put_user: fix possible data corruption in put_user · d7bd4d11
      Andrey Ryabinin authored
      commit 537094b6 upstream.
      
      According to arm procedure call standart r2 register is call-cloberred.
      So after the result of x expression was put into r2 any following
      function call in p may overwrite r2. To fix this, the result of p
      expression must be saved to the temporary variable before the
      assigment x expression to __r2.
      Signed-off-by: default avatarAndrey Ryabinin <a.ryabinin@samsung.com>
      Reviewed-by: default avatarNicolas Pitre <nico@linaro.org>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      d7bd4d11
    • Takashi Iwai's avatar
      ALSA: hda - Fix onboard audio on Intel H97/Z97 chipsets · c5c601ca
      Takashi Iwai authored
      commit 77f07800 upstream.
      
      The recent Intel H97/Z97 chipsets need the similar setups like other
      Intel chipsets for snooping, etc.  Especially without snooping, the
      audio playback stutters or gets corrupted.  This fix patch just adds
      the corresponding PCI ID entry with the proper flags.
      Reported-and-tested-by: default avatarArthur Borsboom <arthurborsboom@gmail.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      c5c601ca
    • Emil Goode's avatar
      ARM: imx: fix error handling in ipu device registration · b904cd52
      Emil Goode authored
      commit d1d70e5d upstream.
      
      If we fail to allocate struct platform_device pdev we
      dereference it after the goto label err.
      
      This bug was found using coccinelle.
      
      Fixes: afa77ef3 (ARM: mx3: dynamically allocate "ipu-core" devices)
      Signed-off-by: default avatarEmil Goode <emilgoode@gmail.com>
      Acked-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Signed-off-by: default avatarShawn Guo <shawn.guo@freescale.com>
      Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      b904cd52
    • Lucas Stach's avatar
      cpufreq: cpu0: drop wrong devm usage · ddde2add
      Lucas Stach authored
      commit e3beb0ac upstream.
      
      This driver is using devres managed calls incorrectly, giving the cpu0
      device as first parameter instead of the cpufreq platform device.
      This results in resources not being freed if the cpufreq platform device
      is unbound, for example if probing has to be deferred for a missing
      regulator.
      Signed-off-by: default avatarLucas Stach <l.stach@pengutronix.de>
      Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      ddde2add
    • Bibek Basu's avatar
      cpufreq: remove race while accessing cur_policy · 4e5439ed
      Bibek Basu authored
      commit c5450db8 upstream.
      
      While accessing cur_policy during executing events
      CPUFREQ_GOV_START, CPUFREQ_GOV_STOP, CPUFREQ_GOV_LIMITS,
      same mutex lock is not taken, dbs_data->mutex, which leads
      to race and data corruption while running continious suspend
      resume test. This is seen with ondemand governor with suspend
      resume test using rtcwake.
      
       Unable to handle kernel NULL pointer dereference at virtual address 00000028
       pgd = ed610000
       [00000028] *pgd=adf11831, *pte=00000000, *ppte=00000000
       Internal error: Oops: 17 [#1] PREEMPT SMP ARM
       Modules linked in: nvhost_vi
       CPU: 1 PID: 3243 Comm: rtcwake Not tainted 3.10.24-gf5cf9e5 #1
       task: ee708040 ti: ed61c000 task.ti: ed61c000
       PC is at cpufreq_governor_dbs+0x400/0x634
       LR is at cpufreq_governor_dbs+0x3f8/0x634
       pc : [<c05652b8>] lr : [<c05652b0>] psr: 600f0013
       sp : ed61dcb0 ip : 000493e0 fp : c1cc14f0
       r10: 00000000 r9 : 00000000 r8 : 00000000
       r7 : eb725280 r6 : c1cc1560 r5 : eb575200 r4 : ebad7740
       r3 : ee708040 r2 : ed61dca8 r1 : 001ebd24 r0 : 00000000
       Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
       Control: 10c5387d Table: ad61006a DAC: 00000015
       [<c05652b8>] (cpufreq_governor_dbs+0x400/0x634) from [<c055f700>] (__cpufreq_governor+0x98/0x1b4)
       [<c055f700>] (__cpufreq_governor+0x98/0x1b4) from [<c0560770>] (__cpufreq_set_policy+0x250/0x320)
       [<c0560770>] (__cpufreq_set_policy+0x250/0x320) from [<c0561dcc>] (cpufreq_update_policy+0xcc/0x168)
       [<c0561dcc>] (cpufreq_update_policy+0xcc/0x168) from [<c0561ed0>] (cpu_freq_notify+0x68/0xdc)
       [<c0561ed0>] (cpu_freq_notify+0x68/0xdc) from [<c008eff8>] (notifier_call_chain+0x4c/0x8c)
       [<c008eff8>] (notifier_call_chain+0x4c/0x8c) from [<c008f3d4>] (__blocking_notifier_call_chain+0x50/0x68)
       [<c008f3d4>] (__blocking_notifier_call_chain+0x50/0x68) from [<c008f40c>] (blocking_notifier_call_chain+0x20/0x28)
       [<c008f40c>] (blocking_notifier_call_chain+0x20/0x28) from [<c00aac6c>] (pm_qos_update_bounded_target+0xd8/0x310)
       [<c00aac6c>] (pm_qos_update_bounded_target+0xd8/0x310) from [<c00ab3b0>] (__pm_qos_update_request+0x64/0x70)
       [<c00ab3b0>] (__pm_qos_update_request+0x64/0x70) from [<c004b4b8>] (tegra_pm_notify+0x114/0x134)
       [<c004b4b8>] (tegra_pm_notify+0x114/0x134) from [<c008eff8>] (notifier_call_chain+0x4c/0x8c)
       [<c008eff8>] (notifier_call_chain+0x4c/0x8c) from [<c008f3d4>] (__blocking_notifier_call_chain+0x50/0x68)
       [<c008f3d4>] (__blocking_notifier_call_chain+0x50/0x68) from [<c008f40c>] (blocking_notifier_call_chain+0x20/0x28)
       [<c008f40c>] (blocking_notifier_call_chain+0x20/0x28) from [<c00ac228>] (pm_notifier_call_chain+0x1c/0x34)
       [<c00ac228>] (pm_notifier_call_chain+0x1c/0x34) from [<c00ad38c>] (enter_state+0xec/0x128)
       [<c00ad38c>] (enter_state+0xec/0x128) from [<c00ad400>] (pm_suspend+0x38/0xa4)
       [<c00ad400>] (pm_suspend+0x38/0xa4) from [<c00ac114>] (state_store+0x70/0xc0)
       [<c00ac114>] (state_store+0x70/0xc0) from [<c027b1e8>] (kobj_attr_store+0x14/0x20)
       [<c027b1e8>] (kobj_attr_store+0x14/0x20) from [<c019cd9c>] (sysfs_write_file+0x104/0x184)
       [<c019cd9c>] (sysfs_write_file+0x104/0x184) from [<c0143038>] (vfs_write+0xd0/0x19c)
       [<c0143038>] (vfs_write+0xd0/0x19c) from [<c0143414>] (SyS_write+0x4c/0x78)
       [<c0143414>] (SyS_write+0x4c/0x78) from [<c000f080>] (ret_fast_syscall+0x0/0x30)
       Code: e1a00006 eb084346 e59b0020 e5951024 (e5903028)
       ---[ end trace 0488523c8f6b0f9d ]---
      Signed-off-by: default avatarBibek Basu <bbasu@nvidia.com>
      Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      4e5439ed
    • Santosh Shilimkar's avatar
      ARM: OMAP4: Fix the boot regression with CPU_IDLE enabled · 986ab717
      Santosh Shilimkar authored
      commit 4b353a70 upstream.
      
      On OMAP4 panda board, there have been several bug reports about boot
      hang and lock-ups with CPU_IDLE enabled. The root cause of the issue
      is missing interrupts while in idle state. Commit cb7094e8 {cpuidle / omap4 :
      use CPUIDLE_FLAG_TIMER_STOP flag} moved the broadcast notifiers to common
      code for right reasons but on OMAP4 which suffers from a nasty ROM code
      bug with GIC, commit ff999b8a {ARM: OMAP4460: Workaround for ROM bug ..},
      we loose interrupts which leads to issues like lock-up, hangs etc.
      
      Patch reverts commit cb7094 {cpuidle / omap4 : use CPUIDLE_FLAG_TIMER_STOP
      flag} and 54769d65 {cpuidle: OMAP4: remove timer broadcast initialization} to
      avoid the issue. With this change, OMAP4 panda boards, the mentioned
      issues are getting fixed. We no longer loose interrupts which was the cause
      of the regression.
      
      Fixes: cb7094e8 (cpuidle / omap4 : use CPUIDLE_FLAG_TIMER_STOP flag)
      Fixes: ff999b8a (cpuidle: OMAP4: remove timer broadcast initialization)
      Cc: Roger Quadros <rogerq@ti.com>
      Cc: Kevin Hilman <khilman@linaro.org>
      Cc: Tony Lindgren <tony@atomide.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Reported-tested-by: default avatarRoger Quadros <rogerq@ti.com>
      Reported-tested-by: default avatarKevin Hilman <khilman@linaro.org>
      Tested-by: default avatarTony Lindgren <tony@atomide.com>
      Signed-off-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      986ab717
    • Thomas Gleixner's avatar
      futex: Prevent attaching to kernel threads · 43244ace
      Thomas Gleixner authored
      commit f0d71b3d upstream.
      
      We happily allow userspace to declare a random kernel thread to be the
      owner of a user space PI futex.
      
      Found while analysing the fallout of Dave Jones syscall fuzzer.
      
      We also should validate the thread group for private futexes and find
      some fast way to validate whether the "alleged" owner has RW access on
      the file which backs the SHM, but that's a separate issue.
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Dave Jones <davej@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Darren Hart <darren@dvhart.com>
      Cc: Davidlohr Bueso <davidlohr@hp.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Clark Williams <williams@redhat.com>
      Cc: Paul McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
      Cc: Roland McGrath <roland@hack.frob.com>
      Cc: Carlos ODonell <carlos@redhat.com>
      Cc: Jakub Jelinek <jakub@redhat.com>
      Cc: Michael Kerrisk <mtk.manpages@gmail.com>
      Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
      Link: http://lkml.kernel.org/r/20140512201701.194824402@linutronix.deSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      43244ace