1. 03 Aug, 2015 17 commits
    • Peter Zijlstra's avatar
      locking/static_keys: Add selftest · 1987c947
      Peter Zijlstra authored
      Add a little selftest that validates all combinations.
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      1987c947
    • Peter Zijlstra's avatar
      locking/static_keys: Add a new static_key interface · 11276d53
      Peter Zijlstra authored
      There are various problems and short-comings with the current
      static_key interface:
      
       - static_key_{true,false}() read like a branch depending on the key
         value, instead of the actual likely/unlikely branch depending on
         init value.
      
       - static_key_{true,false}() are, as stated above, tied to the
         static_key init values STATIC_KEY_INIT_{TRUE,FALSE}.
      
       - we're limited to the 2 (out of 4) possible options that compile to
         a default NOP because that's what our arch_static_branch() assembly
         emits.
      
      So provide a new static_key interface:
      
        DEFINE_STATIC_KEY_TRUE(name);
        DEFINE_STATIC_KEY_FALSE(name);
      
      Which define a key of different types with an initial true/false
      value.
      
      Then allow:
      
         static_branch_likely()
         static_branch_unlikely()
      
      to take a key of either type and emit the right instruction for the
      case.
      
      This means adding a second arch_static_branch_jump() assembly helper
      which emits a JMP per default.
      
      In order to determine the right instruction for the right state,
      encode the branch type in the LSB of jump_entry::key.
      
      This is the final step in removing the naming confusion that has led to
      a stream of avoidable bugs such as:
      
        a833581e ("x86, perf: Fix static_key bug in load_mm_cr4()")
      
      ... but it also allows new static key combinations that will give us
      performance enhancements in the subsequent patches.
      
      Tested-by: Rabin Vincent <rabin@rab.in> # arm
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Acked-by: Michael Ellerman <mpe@ellerman.id.au> # ppc
      Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com> # s390
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      11276d53
    • Peter Zijlstra's avatar
      locking/static_keys: Rework update logic · 706249c2
      Peter Zijlstra authored
      Instead of spreading the branch_default logic all over the place,
      concentrate it into the one jump_label_type() function.
      
      This does mean we need to actually increment/decrement the enabled
      count _before_ calling the update path, otherwise jump_label_type()
      will not see the right state.
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      706249c2
    • Peter Zijlstra's avatar
      locking/static_keys: Add static_key_{en,dis}able() helpers · e33886b3
      Peter Zijlstra authored
      Add two helpers to make it easier to treat the refcount as boolean.
      Suggested-by: default avatarJason Baron <jasonbaron0@gmail.com>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      e33886b3
    • Peter Zijlstra's avatar
      jump_label: Add jump_entry_key() helper · 7dcfd915
      Peter Zijlstra authored
      Avoid some casting with a helper, also prepares the way for
      overloading the LSB of jump_entry::key.
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      7dcfd915
    • Peter Zijlstra's avatar
      jump_label, locking/static_keys: Rename JUMP_LABEL_TYPE_* and related helpers... · a1efb01f
      Peter Zijlstra authored
      jump_label, locking/static_keys: Rename JUMP_LABEL_TYPE_* and related helpers to the static_key* pattern
      
      Rename the JUMP_LABEL_TYPE_* macros to be JUMP_TYPE_* and move the
      inline helpers into kernel/jump_label.c, since that's the only place
      they're ever used.
      
      Also rename the helpers where it's all about static keys.
      
      This is the second step in removing the naming confusion that has led to
      a stream of avoidable bugs such as:
      
        a833581e ("x86, perf: Fix static_key bug in load_mm_cr4()")
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      a1efb01f
    • Peter Zijlstra's avatar
      jump_label: Rename JUMP_LABEL_{EN,DIS}ABLE to JUMP_LABEL_{JMP,NOP} · 76b235c6
      Peter Zijlstra authored
      Since we've already stepped away from ENABLE is a JMP and DISABLE is a
      NOP with the branch_default bits, and are going to make it even worse,
      rename it to make it all clearer.
      
      This way we don't mix multiple levels of logic attributes, but have a
      plain 'physical' name for what the current instruction patching status
      of a jump label is.
      
      This is a first step in removing the naming confusion that has led to
      a stream of avoidable bugs such as:
      
        a833581e ("x86, perf: Fix static_key bug in load_mm_cr4()")
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      [ Beefed up the changelog. ]
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      76b235c6
    • Ingo Molnar's avatar
      Merge branch 'x86/asm' into locking/core · f320ead7
      Ingo Molnar authored
      Upcoming changes to static keys is interacting/conflicting with the following
      pending TSC commits in tip:x86/asm:
      
        4ea1636b x86/asm/tsc: Rename native_read_tsc() to rdtsc()
        ...
      
      So merge it into the locking tree to have a smoother resolution.
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      f320ead7
    • Andrey Konovalov's avatar
      locking, arch: use WRITE_ONCE()/READ_ONCE() in smp_store_release()/smp_load_acquire() · 76695af2
      Andrey Konovalov authored
      Replace ACCESS_ONCE() macro in smp_store_release() and smp_load_acquire()
      with WRITE_ONCE() and READ_ONCE() on x86, arm, arm64, ia64, metag, mips,
      powerpc, s390, sparc and asm-generic since ACCESS_ONCE() does not work
      reliably on non-scalar types.
      
      WRITE_ONCE() and READ_ONCE() were introduced in the following commits:
      
        230fa253 ("kernel: Provide READ_ONCE and ASSIGN_ONCE")
        43239cbe ("kernel: Change ASSIGN_ONCE(val, x) to WRITE_ONCE(x, val)")
      Signed-off-by: default avatarAndrey Konovalov <andreyknvl@google.com>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Acked-by: default avatarDavidlohr Bueso <dbueso@suse.de>
      Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
      Acked-by: default avatarRalf Baechle <ralf@linux-mips.org>
      Cc: Alexander Duyck <alexander.h.duyck@redhat.com>
      Cc: Andre Przywara <andre.przywara@arm.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Davidlohr Bueso <dave@stgolabs.net>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: linux-arch@vger.kernel.org
      Link: http://lkml.kernel.org/r/1438528264-714-1-git-send-email-andreyknvl@google.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      76695af2
    • Waiman Long's avatar
      locking/pvqspinlock: Only kick CPU at unlock time · 75d22702
      Waiman Long authored
      For an over-committed guest with more vCPUs than physical CPUs
      available, it is possible that a vCPU may be kicked twice before
      getting the lock - once before it becomes queue head and once again
      before it gets the lock. All these CPU kicking and halting (VMEXIT)
      can be expensive and slow down system performance.
      
      This patch adds a new vCPU state (vcpu_hashed) which enables the code
      to delay CPU kicking until at unlock time. Once this state is set,
      the new lock holder will set _Q_SLOW_VAL and fill in the hash table
      on behalf of the halted queue head vCPU. The original vcpu_halted
      state will be used by pv_wait_node() only to differentiate other
      queue nodes from the qeue head.
      Signed-off-by: default avatarWaiman Long <Waiman.Long@hp.com>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Douglas Hatch <doug.hatch@hp.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Scott J Norton <scott.norton@hp.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/1436647018-49734-2-git-send-email-Waiman.Long@hp.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      75d22702
    • Waiman Long's avatar
      locking/qrwlock: Reduce reader/writer to reader lock transfer latency · ffffeaf3
      Waiman Long authored
      Currently, a reader will check first to make sure that the writer mode
      byte is cleared before incrementing the reader count. That waiting is
      not really necessary. It increases the latency in the reader/writer
      to reader transition and reduces readers performance.
      
      This patch eliminates that waiting. It also has the side effect
      of reducing the chance of writer lock stealing and improving the
      fairness of the lock. Using a locking microbenchmark, a 10-threads 5M
      locking loop of mostly readers (RW ratio = 10,000:1) has the following
      performance numbers in a Haswell-EX box:
      
              Kernel          Locking Rate (Kops/s)
              ------          ---------------------
              4.1.1               15,063,081
              4.1.1+patch         17,241,552  (+14.4%)
      Signed-off-by: default avatarWaiman Long <Waiman.Long@hp.com>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Douglas Hatch <doug.hatch@hp.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Scott J Norton <scott.norton@hp.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will.deacon@arm.com>
      Link: http://lkml.kernel.org/r/1436459543-29126-2-git-send-email-Waiman.Long@hp.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      ffffeaf3
    • Will Deacon's avatar
      locking/pvqspinlock: Order pv_unhash() after cmpxchg() on unlock slowpath · 3b3fdf10
      Will Deacon authored
      When we unlock in __pv_queued_spin_unlock(), a failed cmpxchg() on the lock
      value indicates that we need to take the slow-path and unhash the
      corresponding node blocked on the lock.
      
      Since a failed cmpxchg() does not provide any memory-ordering guarantees,
      it is possible that the node data could be read before the cmpxchg() on
      weakly-ordered architectures and therefore return a stale value, leading
      to hash corruption and/or a BUG().
      
      This patch adds an smb_rmb() following the failed cmpxchg operation, so
      that the unhashing is ordered after the lock has been checked.
      Reported-by: default avatarPeter Zijlstra <peterz@infradead.org>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      [ Added more comments]
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Acked-by: default avatarWaiman Long <Waiman.Long@hp.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Paul McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Steve Capper <Steve.Capper@arm.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/20150713155830.GL2632@arm.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      3b3fdf10
    • Will Deacon's avatar
      locking/Documentation: Clarify failed cmpxchg() memory ordering semantics · ed2de9f7
      Will Deacon authored
      A failed cmpxchg does not provide any memory ordering guarantees, a
      property that is used to optimise the cmpxchg implementations on Alpha,
      PowerPC and arm64.
      
      This patch updates atomic_ops.txt and memory-barriers.txt to reflect
      this.
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Davidlohr Bueso <dave@stgolabs.net>
      Cc: Douglas Hatch <doug.hatch@hp.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Scott J Norton <scott.norton@hp.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Waiman Long <waiman.long@hp.com>
      Link: http://lkml.kernel.org/r/20150716151006.GH26390@arm.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      ed2de9f7
    • Peter Zijlstra's avatar
      locking: Clean up pvqspinlock warning · 0b792bf5
      Peter Zijlstra authored
       - Rename the on-stack variable to match the datastructure variable,
      
       - place the cmpxchg back under the comment that explains it,
      
       - clean up the WARN() statement to avoid superfluous conditionals
         and line-breaks.
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Waiman Long <Waiman.Long@hp.com>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      0b792bf5
    • Ingo Molnar's avatar
      Merge branch 'locking/urgent', tag 'v4.2-rc5' into locking/core, to pick up... · 3a7651e6
      Ingo Molnar authored
      Merge branch 'locking/urgent', tag 'v4.2-rc5' into locking/core, to pick up fixes before applying new changes
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      3a7651e6
    • Linus Torvalds's avatar
      Linux 4.2-rc5 · 74d33293
      Linus Torvalds authored
      74d33293
    • Linus Torvalds's avatar
      Merge tag 'powerpc-4.2-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · d08c3181
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
       - TCE table memory calculation fix from Alexey
       - Build fix for ans-lcd from Luis
       - Unbalanced IRQ warning fix from Alistair
      
      * tag 'powerpc-4.2-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc/eeh-powernv: Fix unbalanced IRQ warning
        macintosh/ans-lcd: fix build failure after module_init/exit relocation
        powerpc/powernv/ioda2: Fix calculation for memory allocated for TCE table
      d08c3181
  2. 02 Aug, 2015 5 commits
    • Linus Torvalds's avatar
      i915: temporary fix for DP MST docking station NULL pointer dereference · 27667f47
      Linus Torvalds authored
      Ted Ts'o reports that his Lenovo T540p ThinkPad crashes at boot if
      attached to the docking station.  This is a regression that he was able
      to bisect to commit 8c7b5ccb: "drm/i915: Use atomic helpers for
      computing changed flags:"
      
      The reason seems to be the new call to drm_atomic_helper_check_modeset()
      added to intel_modeset_compute_config(), which in turn calls
      update_connector_routing(), and somehow ends up picking a NULL crtc for
      the connector state, causing the subsequent drm_crtc_index() to OOPS.
      
      Daniel Vetter says that the fundamental issue seems to be confusion in
      the encoder selection, and this isn't the right fix, but while he chases
      down the proper fix, this at least avoids the NULL pointer dereference
      and makes Ted's docking station work again.
      Reported-bisected-and-tested-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Cc: Daniel Vetter <daniel.vetter@intel.com>
      Cc: Mani Nikula <jani.nikula@linux.intel.com>
      Cc: Dave Airlie <airlied@gmail.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      27667f47
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · d4edea40
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "A set of three fixes for the ipr driver and one fairly major one for
        memory leaks in the mq path of SCSI"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: fix memory leak with scsi-mq
        ipr: Fix invalid array indexing for HRRQ
        ipr: Fix incorrect trace indexing
        ipr: Fix locking for unit attention handling
      d4edea40
    • Linus Torvalds's avatar
      Merge tag 'armsoc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 30c7b56d
      Linus Torvalds authored
      Pull ARM SoC fixes from Olof Johansson:
       "Things are calming down nicely here w.r.t. fixes.  This batch
        includes two week's worth since I missed to send before -rc4.
      
        Nothing particularly scary to point out, smaller fixes here and there.
        Shortlog describes it pretty well"
      
      * tag 'armsoc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
        ARM: dts: keystone: fix dt bindings to use post div register for mainpll
        ARM: nomadik: disable UART0 on Nomadik boards
        ARM: dts: i.MX35: Fix can support.
        ARM: OMAP2+: hwmod: Fix _wait_target_ready() for hwmods without sysc
        ARM: dts: add CPU OPP and regulator supply property for exynos4210
        ARM: dts: Update video-phy node with syscon phandle for exynos3250
        ARM: DRA7: hwmod: fix gpmc hwmod
      30c7b56d
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · 01183609
      Linus Torvalds authored
      Pull VFS fix from Al Viro:
       "Spurious ENOTDIR fix"
      
      This should fix the problems reported by Dominique Martinet and Hugh
      Dickins.
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        link_path_walk(): be careful when failing with ENOTDIR
      01183609
    • Al Viro's avatar
      link_path_walk(): be careful when failing with ENOTDIR · 97242f99
      Al Viro authored
      In RCU mode we might end up with dentry evicted just we check
      that it's a directory.  In such case we should return ECHILD
      rather than ENOTDIR, so that pathwalk would be retries in non-RCU
      mode.
      
      Breakage had been introduced in commit b18825a7 - prior to that
      we were looking at nd->inode, which had been fetched before
      verifying that ->d_seq was still valid.  That form of check
      would only be satisfied if at some point the pathname prefix
      would indeed have resolved to a non-directory.  The fix consists
      of checking ->d_seq after we'd run into a non-directory dentry,
      and failing with ECHILD in case of mismatch.
      
      Note that all branches since 3.12 have that problem...
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      97242f99
  3. 01 Aug, 2015 6 commits
    • Linus Torvalds's avatar
      Merge tag 'dmaengine-fix-4.2-rc5' of git://git.infradead.org/users/vkoul/slave-dma · 3f6d9e08
      Linus Torvalds authored
      Pull dmaengine fixes from Vinod Koul:
       "We had a regression due to reuse of descriptor so we have reverted
        that.
      
        The rest are driver fixes:
      
         - at_hdmac and at_xdmac for residue, trannfer width, and channel config
         - pl330 final fix for dma fails and overflow issue
         - xgene resouce map fix
         - mv_xor big endian op fix"
      
      * tag 'dmaengine-fix-4.2-rc5' of git://git.infradead.org/users/vkoul/slave-dma:
        Revert "dmaengine: virt-dma: don't always free descriptor upon completion"
        dmaengine: mv_xor: fix big endian operation in register mode
        dmaengine: xgene-dma: Fix the resource map to handle overlapping
        dmaengine: at_xdmac: fix transfer data width in at_xdmac_prep_slave_sg()
        dmaengine: at_hdmac: fix residue computation
        dmaengine: at_xdmac: fix bug about channel configuration
        dmaengine: pl330: Really fix choppy sound because of wrong residue calculation
        dmaengine: pl330: Fix overflow when reporting residue in memcpy
      3f6d9e08
    • Linus Torvalds's avatar
      Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 3270c8ea
      Linus Torvalds authored
      Pull irq fixlets from Thomas Gleixner:
       "Just two updates to the maintainers file"
      
      * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        MAINTAINERS: Appoint Jiang and Marc as irqdomain maintainers
        MAINTAINERS: Appoint Marc Zyngier as irqchips co-maintainer
      3270c8ea
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 51d2e09b
      Linus Torvalds authored
      Pull x86 fixes from Ingo Molnar:
       "Fallout from the recent NMI fixes: make x86 LDT handling more robust.
      
        Also some EFI fixes"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/ldt: Make modify_ldt synchronous
        x86/xen: Probe target addresses in set_aliased_prot() before the hypercall
        x86/irq: Use the caller provided polarity setting in mp_check_pin_attr()
        efi: Check for NULL efi kernel parameters
        x86/efi: Use all 64 bit of efi_memmap in setup_e820()
      51d2e09b
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 7c764cec
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Must teardown SR-IOV before unregistering netdev in igb driver, from
          Alex Williamson.
      
       2) Fix ipv6 route unreachable crash in IPVS, from Alex Gartrell.
      
       3) Default route selection in ipv4 should take the prefix length, table
          ID, and TOS into account, from Julian Anastasov.
      
       4) sch_plug must have a reset method in order to purge all buffered
          packets when the qdisc is reset, likewise for sch_choke, from WANG
          Cong.
      
       5) Fix deadlock and races in slave_changelink/br_setport in bridging.
          From Nikolay Aleksandrov.
      
       6) mlx4 bug fixes (wrong index in port even propagation to VFs,
          overzealous BUG_ON assertion, etc.) from Ido Shamay, Jack
          Morgenstein, and Or Gerlitz.
      
       7) Turn off klog message about SCTP userspace interface compat that
          makes no sense at all, from Daniel Borkmann.
      
       8) Fix unbounded restarts of inet frag eviction process, causing NMI
          watchdog soft lockup messages, from Florian Westphal.
      
       9) Suspend/resume fixes for r8152 from Hayes Wang.
      
      10) Fix busy loop when MSG_WAITALL|MSG_PEEK is used in TCP recv, from
          Sabrina Dubroca.
      
      11) Fix performance regression when removing a lot of routes from the
          ipv4 routing tables, from Alexander Duyck.
      
      12) Fix device leak in AF_PACKET, from Lars Westerhoff.
      
      13) AF_PACKET also has a header length comparison bug due to signedness,
          from Alexander Drozdov.
      
      14) Fix bug in EBPF tail call generation on x86, from Daniel Borkmann.
      
      15) Memory leaks, TSO stats, watchdog timeout and other fixes to
          thunderx driver from Sunil Goutham and Thanneeru Srinivasulu.
      
      16) act_bpf can leak memory when replacing programs, from Daniel
          Borkmann.
      
      17) WOL packet fixes in gianfar driver, from Claudiu Manoil.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (79 commits)
        stmmac: fix missing MODULE_LICENSE in stmmac_platform
        gianfar: Enable device wakeup when appropriate
        gianfar: Fix suspend/resume for wol magic packet
        gianfar: Fix warning when CONFIG_PM off
        act_pedit: check binding before calling tcf_hash_release()
        net: sk_clone_lock() should only do get_net() if the parent is not a kernel socket
        net: sched: fix refcount imbalance in actions
        r8152: reset device when tx timeout
        r8152: add pre_reset and post_reset
        qlcnic: Fix corruption while copying
        act_bpf: fix memory leaks when replacing bpf programs
        net: thunderx: Fix for crash while BGX teardown
        net: thunderx: Add PCI driver shutdown routine
        net: thunderx: Fix crash when changing rss with mutliple traffic flows
        net: thunderx: Set watchdog timeout value
        net: thunderx: Wakeup TXQ only if CQE_TX are processed
        net: thunderx: Suppress alloc_pages() failure warnings
        net: thunderx: Fix TSO packet statistic
        net: thunderx: Fix memory leak when changing queue count
        net: thunderx: Fix RQ_DROP miscalculation
        ...
      7c764cec
    • Linus Torvalds's avatar
      Merge branch 'for-linus-4.2' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs · acea568f
      Linus Torvalds authored
      Pull btrfs fixes from Chris Mason:
       "Filipe fixed up a hard to trigger ENOSPC regression from our merge
        window pull, and we have a few other smaller fixes"
      
      * 'for-linus-4.2' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
        Btrfs: fix quick exhaustion of the system array in the superblock
        btrfs: its btrfs_err() instead of btrfs_error()
        btrfs: Avoid NULL pointer dereference of free_extent_buffer when read_tree_block() fail
        btrfs: Fix lockdep warning of btrfs_run_delayed_iputs()
      acea568f
    • Linus Torvalds's avatar
      Merge tag 'sound-4.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · c6fd4fc7
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "This became a relative big update as it includes the collected ASoC
        fixes.  There are a few fixes in ASoC core side, mostly for DAPM and
        the new topology API.  The rest are various ASoC driver-specific
        fixes, as well as the usual HD-audio and USB-audio quirks"
      
      * tag 'sound-4.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (29 commits)
        ALSA: hda - Fix MacBook Pro 5,2 quirk
        ALSA: hda - Fix race between PM ops and HDA init/probe
        ALSA: usb-audio: add dB range mapping for some devices
        ALSA: hda - Apply a fixup to Dell Vostro 5480
        ALSA: hda - Add pin quirk for the headset mic jack detection on Dell laptop
        ALSA: hda - Apply fixup for another Toshiba Satellite S50D
        ALSA: fireworks: add support for AudioFire2 quirk
        ALSA: hda - Fix the headset mic that will not work on Dell desktop machine
        ALSA: hda - fix cs4210_spdif_automute()
        ASoC: pcm1681: Fix setting de-emphasis sampling rate selection
        ASoC: ssm4567: Keep TDM_BCLKS in ssm4567_set_dai_fmt
        ASoC: sgtl5000: Fix up define for SGTL5000_SMALL_POP
        ASoC: dapm: Don't add prefix to widget stream name
        ASoC: rt5645: Check if codec is initialized in workqueue handler
        ASoC: Intel: Get correct usage_count value to load firmware
        ASoC: topology: Fix to add dapm mixer info
        ASoC: zx: spdif: Fix devm_ioremap_resource return value check
        ASoC: zx: i2s: Fix devm_ioremap_resource return value check
        ASoC: mediatek: Use platform_of_node for machine drivers
        ASoC: Free card DAPM context on snd_soc_instantiate_card() error path
        ...
      c6fd4fc7
  4. 31 Jul, 2015 12 commits
    • Joachim Eastwood's avatar
      stmmac: fix missing MODULE_LICENSE in stmmac_platform · ea111545
      Joachim Eastwood authored
      Commit 50649ab1 ("stmmac: drop driver from stmmac platform code")
      was a bit overzealous in removing code and dropped the MODULE_*
      macro's that are still needed since stmmac_platform can be a module.
      Fix this by putting the macro's remvoed in 50649ab1 back.
      
      This fixes the following errors when used as a module:
        stmmac_platform: module license 'unspecified' taints kernel.
        Disabling lock debugging due to kernel taint
        stmmac_platform: Unknown symbol devm_kmalloc (err 0)
        stmmac_platform: Unknown symbol stmmac_suspend (err 0)
        stmmac_platform: Unknown symbol platform_get_irq_byname (err 0)
        stmmac_platform: Unknown symbol stmmac_dvr_remove (err 0)
        stmmac_platform: Unknown symbol platform_get_resource (err 0)
        stmmac_platform: Unknown symbol of_get_phy_mode (err 0)
        stmmac_platform: Unknown symbol of_property_read_u32_array (err 0)
        stmmac_platform: Unknown symbol of_alias_get_id (err 0)
        stmmac_platform: Unknown symbol stmmac_resume (err 0)
        stmmac_platform: Unknown symbol stmmac_dvr_probe (err 0)
      
      Fixes: 50649ab1 ("stmmac: drop driver from stmmac platform code")
      Reported-by: default avatarIgor Gnatenko <i.gnatenko.brain@gmail.com>
      Signed-off-by: default avatarJoachim Eastwood <manabian@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ea111545
    • David S. Miller's avatar
      Merge branch 'gianfar-wol-fixes' · ef1f4364
      David S. Miller authored
      Claudiu Manoil says:
      
      ====================
      gianfar: wol magic packet fixes
      
      These changes were already validated as part of FSL SDK.
      Patch 2 fixes occasional wake-on magic packet failures during
      traffic, probably due to incorrect traffic stop/ device halt
      sequence and incorrect usage of txlock.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ef1f4364
    • Claudiu Manoil's avatar
      gianfar: Enable device wakeup when appropriate · b0734b6d
      Claudiu Manoil authored
      The wol_en flag is 0 by default anyway, and we have the
      following inconsistency: a MAGIC packet wol capable eth
      interface is registered as a wake-up source but unable
      to wake-up the system as wol_en is 0 (wake-on flag set to 'd').
      Calling set_wakeup_enable() at netdev open is just redundant
      because wol_en is 0 by default.
      Let only ethtool call set_wakeup_enable() for now.
      
      The bflock is obviously obsoleted, its utility has been corroded
      over time.  The bitfield flags used today in gianfar are accessed
      only on the init/ config path, with no real possibility of
      concurrency - nothing that would justify smth. like bflock.
      Signed-off-by: default avatarClaudiu Manoil <claudiu.manoil@freescale.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b0734b6d
    • Claudiu Manoil's avatar
      gianfar: Fix suspend/resume for wol magic packet · 614b4242
      Claudiu Manoil authored
      If we disable NAPI in the first place we can mask the device's
      interrupts (and halt it) without fearing that imask may be
      concurrently accessed from interrupt context, so there's
      no need to do local_irq_save() around gfar_halt_nodisable().
      lock_rx_qs()/unlock_tx_qs() are just obsoleted and potentially
      buggy routines.  The txlock is currently used in the driver only
      to manage TX congestion, it has nothing to do with halting the
      device.  With these changes, the TX processing is stopped before
      gfar_halt().
      
      Compact gfar_halt() is used instead of gfar_halt_nodisable(),
      as it disables Rx/TX DMA h/w blocks and the Rx/TX h/w queues.
      gfar_start() re-enables all these blocks on resume.  Enabling
      the magic-packet mode remains the same, note that the RX block
      is re-enabled just before entering sleep mode.
      
      Add IRQF_NO_SUSPEND flag for the error interrupt line, to signal
      that the interrupt line must remain active during sleep in order
      to wake the system by magic packet (MAG) reception interrupt.
      (On some systems the MAG interrupt did trigger w/o this flag
      as well, but on others it didn't.)
      
      Without these fixes, when suspended during fair Tx traffic the
      interface occasionally failed to be woken up by magic packet.
      Signed-off-by: default avatarClaudiu Manoil <claudiu.manoil@freescale.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      614b4242
    • Claudiu Manoil's avatar
      gianfar: Fix warning when CONFIG_PM off · 84868305
      Claudiu Manoil authored
      CC      drivers/net/ethernet/freescale/gianfar.o
      drivers/net/ethernet/freescale/gianfar.c:568:13: warning: 'lock_tx_qs'
      defined but not used [-Wunused-function]
       static void lock_tx_qs(struct gfar_private *priv)
                   ^
      drivers/net/ethernet/freescale/gianfar.c:576:13: warning: 'unlock_tx_qs'
      defined but not used [-Wunused-function]
       static void unlock_tx_qs(struct gfar_private *priv)
                   ^
      Reported-by: default avatarScott Wood <scottwood@freescale.com>
      Signed-off-by: default avatarClaudiu Manoil <claudiu.manoil@freescale.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      84868305
    • WANG Cong's avatar
      act_pedit: check binding before calling tcf_hash_release() · 5175f710
      WANG Cong authored
      When we share an action within a filter, the bind refcnt
      should increase, therefore we should not call tcf_hash_release().
      
      Fixes: 1a29321e ("net_sched: act: Dont increment refcnt on replace")
      Cc: Jamal Hadi Salim <jhs@mojatatu.com>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: default avatarCong Wang <cwang@twopensource.com>
      Acked-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5175f710
    • Murali Karicheri's avatar
      ARM: dts: keystone: fix dt bindings to use post div register for mainpll · c1bfa985
      Murali Karicheri authored
      All of the keystone devices have a separate register to hold post
      divider value for main pll clock. Currently the fixed-postdiv
      value used for k2hk/l/e SoCs works by sheer luck as u-boot happens to
      use a value of 2 for this. Now that we have fixed this in the pll
      clock driver change the dt bindings for the same.
      Signed-off-by: default avatarMurali Karicheri <m-karicheri2@ti.com>
      Acked-by: default avatarSantosh Shilimkar <ssantosh@kernel.org>
      Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
      c1bfa985
    • Linus Torvalds's avatar
      Merge tag 'iommu-fixes-v4.2-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu · 5e49e0be
      Linus Torvalds authored
      Pull IOMMU fixes from Joerg Roedel:
       "These fixes are all for the AMD IOMMU driver:
      
         - A regression with HSA caused by the conversion of the driver to
           default domains.  The fixes make sure that an HSA device can still
           be attached to an IOMMUv2 domain and that these domains also allow
           non-IOMMUv2 capable devices.
      
         - Fix iommu=pt mode which did not work because the dma_ops where set
           to nommu_ops, which breaks devices that can only do 32bit DMA.
      
         - Fix an issue with non-PCI devices not working, because there are no
           dma_ops for them.  This issue was discovered recently as new AMD
           x86 platforms have non-PCI devices too"
      
      * tag 'iommu-fixes-v4.2-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
        iommu/amd: Allow non-ATS devices in IOMMUv2 domains
        iommu/amd: Set global dma_ops if swiotlb is disabled
        iommu/amd: Use swiotlb in passthrough mode
        iommu/amd: Allow non-IOMMUv2 devices in IOMMUv2 domains
        iommu/amd: Use iommu core for passthrough mode
        iommu/amd: Use iommu_attach_group()
      5e49e0be
    • Linus Torvalds's avatar
      Merge tag 'drm-intel-fixes-2015-07-31' of git://anongit.freedesktop.org/drm-intel · 23ff9e19
      Linus Torvalds authored
      Pull drm intel fixes from Daniel Vetter:
       "I delayed my -fixes pull a bit hoping that I could include a fix for
        the dp mst stuff but looks a bit more nasty than that.  So just 3
        other regression fixes, one 4.2 other two cc: stable"
      
      * tag 'drm-intel-fixes-2015-07-31' of git://anongit.freedesktop.org/drm-intel:
        drm/i915: Declare the swizzling unknown for L-shaped configurations
        drm/i915: Mark PIN_USER binding as GLOBAL_BIND without the aliasing ppgtt
        drm/i915: Replace WARN inside I915_READ64_2x32 with retry loop
      23ff9e19
    • Linus Torvalds's avatar
      Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux · fd56d1d6
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "This has a bunch of nouveau fixes, as Ben has been hibernating and has
        lots of small fixes for lots of bugs across nouveau.
      
        Radeon has one major fix for hdmi/dp audio regression that is larger
        than Alex would like, but seems to fix up a fair few bugs, along with
        some misc fixes.
      
        And a few msm fixes, one of which is also a bit large.
      
        But nothing in here seems insane or crazy for this stage, just more
        than I'd like"
      
      * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: (33 commits)
        drm/msm/mdp5: release SMB (shared memory blocks) in various cases
        drm/msm: change to uninterruptible wait in atomic commit
        drm/msm: mdp4: Fix drm_framebuffer dereference crash
        drm/msm: fix msm_gem_prime_get_sg_table()
        drm/amdgpu: add new parameter to seperate map and unmap
        drm/amdgpu: hdp_flush is not needed for inside IB
        drm/amdgpu: different emit_ib for gfx and compute
        drm/amdgpu: information leak in amdgpu_info_ioctl()
        drm/amdgpu: clean up init sequence for failures
        drm/radeon/combios: add some validation of lvds values
        drm/radeon: rework audio modeset to handle non-audio hdmi features
        drm/radeon: rework audio detect (v4)
        drm/amdgpu: Drop drm/ prefix for including drm.h in amdgpu_drm.h
        drm/radeon: Drop drm/ prefix for including drm.h in radeon_drm.h
        drm/nouveau/nouveau/ttm: fix tiled system memory with Maxwell
        drm/nouveau/kms/nv50-: guard against enabling cursor on disabled heads
        drm/nouveau/fbcon/g80: reduce PUSH_SPACE alloc, fire ring on accel init
        drm/nouveau/fbcon/gf100-: reduce RING_SPACE allocation
        drm/nouveau/fbcon/nv11-: correctly account for ring space usage
        drm/nouveau/bios: add proper support for opcode 0x59
        ...
      fd56d1d6
    • Jun Nie's avatar
      Revert "dmaengine: virt-dma: don't always free descriptor upon completion" · 8c8fe97b
      Jun Nie authored
      This reverts commit b9855f03.
      The patch break existing DMA usage case. For example, audio SOC
      dmaengine never release channel and cause virt-dma to cache too
      much memory in descriptor to exhaust system memory.
      Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
      8c8fe97b
    • Thomas Petazzoni's avatar
      dmaengine: mv_xor: fix big endian operation in register mode · 0ec9ebc7
      Thomas Petazzoni authored
      Commit 6f166312 ("dmaengine: mv_xor: add support for a38x command
      in descriptor mode") introduced the support for a feature that
      appeared in Armada 38x: specifying the operation to be performed in a
      per-descriptor basis rather than globally per channel.
      
      However, when doing so, it changed the function mv_chan_set_mode() to
      use:
      
        if (IS_ENABLED(__BIG_ENDIAN))
      
      instead of:
      
        #if defined(__BIG_ENDIAN)
      
      While IS_ENABLED() is perfectly fine for CONFIG_* symbols, it is not
      for other symbols such as __BIG_ENDIAN that is provided directly by
      the compiler. Consequently, the commit broke support for big-endian,
      as the XOR_DESCRIPTOR_SWAP flag was not set in the XOR channel
      configuration register.
      
      The primarily visible effect was some nasty warnings and failures
      appearing during the self-test of the XOR unit:
      
      [    1.197368] mv_xor d0060900.xor: error on chan 0. intr cause 0x00000082
      [    1.197393] mv_xor d0060900.xor: config       0x00008440
      [    1.197410] mv_xor d0060900.xor: activation   0x00000000
      [    1.197427] mv_xor d0060900.xor: intr cause   0x00000082
      [    1.197443] mv_xor d0060900.xor: intr mask    0x000003f7
      [    1.197460] mv_xor d0060900.xor: error cause  0x00000000
      [    1.197477] mv_xor d0060900.xor: error addr   0x00000000
      [    1.197491] ------------[ cut here ]------------
      [    1.197513] WARNING: CPU: 0 PID: 1 at ../drivers/dma/mv_xor.c:664 mv_xor_interrupt_handler+0x14c/0x170()
      
      See also:
      
        http://storage.kernelci.org/next/next-20150617/arm-mvebu_v7_defconfig+CONFIG_CPU_BIG_ENDIAN=y/lab-khilman/boot-armada-xp-openblocks-ax3-4.txtSigned-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Fixes: 6f166312 ("dmaengine: mv_xor: add support for a38x command in descriptor mode")
      Reviewed-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
      Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
      0ec9ebc7