1. 23 Jan, 2016 10 commits
    • Ross Zwisler's avatar
      dax: never rely on bh.b_dev being set by get_block() · eab95db6
      Ross Zwisler authored
      Previously in DAX we assumed that calls to get_block() would set
      bh.b_bdev, and we would then use that value even in error cases for
      debugging.  This caused a NULL pointer dereference in __dax_dbg() which
      was fixed by a previous commit, but that commit only changed the one
      place where we were hitting an error.
      
      Instead, update dax.c so that we always initialize bh.b_bdev as best we
      can based on the information that DAX has.  get_block() may or may not
      update to a new value, but this at least lets us get something helpful
      from bh.b_bdev for error messages and not have to worry about whether it
      was set by get_block() or not.
      Signed-off-by: default avatarRoss Zwisler <ross.zwisler@linux.intel.com>
      Reported-by: default avatarJan Kara <jack@suse.cz>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      eab95db6
    • Ross Zwisler's avatar
      xfs: call dax_pfn_mkwrite() for DAX fsync/msync · 5eb88dca
      Ross Zwisler authored
      To properly support the new DAX fsync/msync infrastructure filesystems
      need to call dax_pfn_mkwrite() so that DAX can track when user pages are
      dirtied.
      Signed-off-by: default avatarRoss Zwisler <ross.zwisler@linux.intel.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: "J. Bruce Fields" <bfields@fieldses.org>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: Andreas Dilger <adilger.kernel@dilger.ca>
      Cc: Dave Chinner <david@fromorbit.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jan Kara <jack@suse.com>
      Cc: Jeff Layton <jlayton@poochiereds.net>
      Cc: Matthew Wilcox <willy@linux.intel.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Matthew Wilcox <matthew.r.wilcox@intel.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      5eb88dca
    • Ross Zwisler's avatar
      ext4: call dax_pfn_mkwrite() for DAX fsync/msync · d5be7a03
      Ross Zwisler authored
      To properly support the new DAX fsync/msync infrastructure filesystems
      need to call dax_pfn_mkwrite() so that DAX can track when user pages are
      dirtied.
      Signed-off-by: default avatarRoss Zwisler <ross.zwisler@linux.intel.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: "J. Bruce Fields" <bfields@fieldses.org>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: Andreas Dilger <adilger.kernel@dilger.ca>
      Cc: Dave Chinner <david@fromorbit.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jan Kara <jack@suse.com>
      Cc: Jeff Layton <jlayton@poochiereds.net>
      Cc: Matthew Wilcox <willy@linux.intel.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Matthew Wilcox <matthew.r.wilcox@intel.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d5be7a03
    • Ross Zwisler's avatar
      ext2: call dax_pfn_mkwrite() for DAX fsync/msync · 80b4adca
      Ross Zwisler authored
      To properly support the new DAX fsync/msync infrastructure filesystems
      need to call dax_pfn_mkwrite() so that DAX can track when user pages are
      dirtied.
      Signed-off-by: default avatarRoss Zwisler <ross.zwisler@linux.intel.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: "J. Bruce Fields" <bfields@fieldses.org>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: Andreas Dilger <adilger.kernel@dilger.ca>
      Cc: Dave Chinner <david@fromorbit.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jan Kara <jack@suse.com>
      Cc: Jeff Layton <jlayton@poochiereds.net>
      Cc: Matthew Wilcox <willy@linux.intel.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Matthew Wilcox <matthew.r.wilcox@intel.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      80b4adca
    • Ross Zwisler's avatar
      dax: add support for fsync/sync · 9973c98e
      Ross Zwisler authored
      To properly handle fsync/msync in an efficient way DAX needs to track
      dirty pages so it is able to flush them durably to media on demand.
      
      The tracking of dirty pages is done via the radix tree in struct
      address_space.  This radix tree is already used by the page writeback
      infrastructure for tracking dirty pages associated with an open file,
      and it already has support for exceptional (non struct page*) entries.
      We build upon these features to add exceptional entries to the radix
      tree for DAX dirty PMD or PTE pages at fault time.
      
      [dan.j.williams@intel.com: fix dax_pmd_dbg build warning]
      Signed-off-by: default avatarRoss Zwisler <ross.zwisler@linux.intel.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: "J. Bruce Fields" <bfields@fieldses.org>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: Andreas Dilger <adilger.kernel@dilger.ca>
      Cc: Dave Chinner <david@fromorbit.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jan Kara <jack@suse.com>
      Cc: Jeff Layton <jlayton@poochiereds.net>
      Cc: Matthew Wilcox <willy@linux.intel.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Matthew Wilcox <matthew.r.wilcox@intel.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      9973c98e
    • Ross Zwisler's avatar
      mm: add find_get_entries_tag() · 7e7f7749
      Ross Zwisler authored
      Add find_get_entries_tag() to the family of functions that include
      find_get_entries(), find_get_pages() and find_get_pages_tag().  This is
      needed for DAX dirty page handling because we need a list of both page
      offsets and radix tree entries ('indices' and 'entries' in this
      function) that are marked with the PAGECACHE_TAG_TOWRITE tag.
      Signed-off-by: default avatarRoss Zwisler <ross.zwisler@linux.intel.com>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: "J. Bruce Fields" <bfields@fieldses.org>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: Andreas Dilger <adilger.kernel@dilger.ca>
      Cc: Dave Chinner <david@fromorbit.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jeff Layton <jlayton@poochiereds.net>
      Cc: Matthew Wilcox <willy@linux.intel.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Matthew Wilcox <matthew.r.wilcox@intel.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      7e7f7749
    • Ross Zwisler's avatar
      dax: support dirty DAX entries in radix tree · f9fe48be
      Ross Zwisler authored
      Add support for tracking dirty DAX entries in the struct address_space
      radix tree.  This tree is already used for dirty page writeback, and it
      already supports the use of exceptional (non struct page*) entries.
      
      In order to properly track dirty DAX pages we will insert new
      exceptional entries into the radix tree that represent dirty DAX PTE or
      PMD pages.  These exceptional entries will also contain the writeback
      addresses for the PTE or PMD faults that we can use at fsync/msync time.
      
      There are currently two types of exceptional entries (shmem and shadow)
      that can be placed into the radix tree, and this adds a third.  We rely
      on the fact that only one type of exceptional entry can be found in a
      given radix tree based on its usage.  This happens for free with DAX vs
      shmem but we explicitly prevent shadow entries from being added to radix
      trees for DAX mappings.
      
      The only shadow entries that would be generated for DAX radix trees
      would be to track zero page mappings that were created for holes.  These
      pages would receive minimal benefit from having shadow entries, and the
      choice to have only one type of exceptional entry in a given radix tree
      makes the logic simpler both in clear_exceptional_entry() and in the
      rest of DAX.
      Signed-off-by: default avatarRoss Zwisler <ross.zwisler@linux.intel.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: "J. Bruce Fields" <bfields@fieldses.org>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: Andreas Dilger <adilger.kernel@dilger.ca>
      Cc: Dave Chinner <david@fromorbit.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jan Kara <jack@suse.com>
      Cc: Jeff Layton <jlayton@poochiereds.net>
      Cc: Matthew Wilcox <willy@linux.intel.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Matthew Wilcox <matthew.r.wilcox@intel.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Hugh Dickins <hughd@google.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f9fe48be
    • Ross Zwisler's avatar
      pmem: add wb_cache_pmem() to the PMEM API · 3f4a2670
      Ross Zwisler authored
      __arch_wb_cache_pmem() was already an internal implementation detail of
      the x86 PMEM API, but this functionality needs to be exported as part of
      the general PMEM API to handle the fsync/msync case for DAX mmaps.
      
      One thing worth noting is that we really do want this to be part of the
      PMEM API as opposed to a stand-alone function like clflush_cache_range()
      because of ordering restrictions.  By having wb_cache_pmem() as part of
      the PMEM API we can leave it unordered, call it multiple times to write
      back large amounts of memory, and then order the multiple calls with a
      single wmb_pmem().
      Signed-off-by: default avatarRoss Zwisler <ross.zwisler@linux.intel.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: "J. Bruce Fields" <bfields@fieldses.org>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: Andreas Dilger <adilger.kernel@dilger.ca>
      Cc: Dave Chinner <david@fromorbit.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jan Kara <jack@suse.com>
      Cc: Jeff Layton <jlayton@poochiereds.net>
      Cc: Matthew Wilcox <willy@linux.intel.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Matthew Wilcox <matthew.r.wilcox@intel.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      3f4a2670
    • Ross Zwisler's avatar
      dax: fix conversion of holes to PMDs · de14b9cb
      Ross Zwisler authored
      When we get a DAX PMD fault for a write it is possible that there could
      be some number of 4k zero pages already present for the same range that
      were inserted to service reads from a hole.  These 4k zero pages need to
      be unmapped from the VMAs and removed from the struct address_space
      radix tree before the real DAX PMD entry can be inserted.
      
      For PTE faults this same use case also exists and is handled by a
      combination of unmap_mapping_range() to unmap the VMAs and
      delete_from_page_cache() to remove the page from the address_space radix
      tree.
      
      For PMD faults we do have a call to unmap_mapping_range() (protected by
      a buffer_new() check), but nothing clears out the radix tree entry.  The
      buffer_new() check is also incorrect as the current ext4 and XFS
      filesystem code will never return a buffer_head with BH_New set, even
      when allocating new blocks over a hole.  Instead the filesystem will
      zero the blocks manually and return a buffer_head with only BH_Mapped
      set.
      
      Fix this situation by removing the buffer_new() check and adding a call
      to truncate_inode_pages_range() to clear out the radix tree entries
      before we insert the DAX PMD.
      Signed-off-by: default avatarRoss Zwisler <ross.zwisler@linux.intel.com>
      Reported-by: default avatarDan Williams <dan.j.williams@intel.com>
      Tested-by: default avatarDan Williams <dan.j.williams@intel.com>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: "J. Bruce Fields" <bfields@fieldses.org>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: Andreas Dilger <adilger.kernel@dilger.ca>
      Cc: Dave Chinner <david@fromorbit.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jeff Layton <jlayton@poochiereds.net>
      Cc: Matthew Wilcox <willy@linux.intel.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Matthew Wilcox <matthew.r.wilcox@intel.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      de14b9cb
    • Ross Zwisler's avatar
      dax: fix NULL pointer dereference in __dax_dbg() · d4bbe706
      Ross Zwisler authored
      In __dax_pmd_fault() we currently assume that get_block() will always
      set bh.b_bdev and we unconditionally dereference it in __dax_dbg().
      
      This assumption isn't always true - when called for reads of holes
      ext4_dax_mmap_get_block() returns a buffer head where bh->b_bdev is
      never set.  I hit this BUG while testing the DAX PMD fault path.
      
      Instead, initialize bh.b_bdev before passing bh into get_block().  It is
      possible that the filesystem's get_block() will update bh.b_bdev, and
      this is fine - we just want to initialize bh.b_bdev to something
      reasonable so that the calls to __dax_dbg() work and print something
      useful.
      Signed-off-by: default avatarRoss Zwisler <ross.zwisler@linux.intel.com>
      Reported-by: default avatarDan Williams <dan.j.williams@intel.com>
      Cc: Jan Kara <jack@suse.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d4bbe706
  2. 22 Jan, 2016 14 commits
    • Linus Torvalds's avatar
      Merge branch 'for-linus-4.5' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs · 2101ae42
      Linus Torvalds authored
      Pull more btrfs updates from Chris Mason:
       "These are mostly fixes that we've been testing, but also we grabbed
        and tested a few small cleanups that had been on the list for a while.
      
        Zhao Lei's patchset also fixes some early ENOSPC buglets"
      
      * 'for-linus-4.5' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs: (21 commits)
        btrfs: raid56: Use raid_write_end_io for scrub
        btrfs: Remove unnecessary ClearPageUptodate for raid56
        btrfs: use rbio->nr_pages to reduce calculation
        btrfs: Use unified stripe_page's index calculation
        btrfs: Fix calculation of rbio->dbitmap's size calculation
        btrfs: Fix no_space in write and rm loop
        btrfs: merge functions for wait snapshot creation
        btrfs: delete unused argument in btrfs_copy_from_user
        btrfs: Use direct way to determine raid56 write/recover mode
        btrfs: Small cleanup for get index_srcdev loop
        btrfs: Enhance chunk validation check
        btrfs: Enhance super validation check
        Btrfs: fix deadlock running delayed iputs at transaction commit time
        Btrfs: fix typo in log message when starting a balance
        btrfs: remove duplicate const specifier
        btrfs: initialize the seq counter in struct btrfs_device
        Btrfs: clean up an error code in btrfs_init_space_info()
        btrfs: fix iterator with update error in backref.c
        Btrfs: fix output of compression message in btrfs_parse_options()
        Btrfs: Initialize btrfs_root->highest_objectid when loading tree root and subvolume roots
        ...
      2101ae42
    • Linus Torvalds's avatar
      Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 · 391f2a16
      Linus Torvalds authored
      Pull ext4 updates from Ted Ts'o:
       "Some locking and page fault bug fixes from Jan Kara, some ext4
        encryption fixes from me, and Li Xi's Project Quota commits"
      
      * tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
        fs: clean up the flags definition in uapi/linux/fs.h
        ext4: add FS_IOC_FSSETXATTR/FS_IOC_FSGETXATTR interface support
        ext4: add project quota support
        ext4: adds project ID support
        ext4 crypto: simplify interfaces to directory entry insert functions
        ext4 crypto: add missing locking for keyring_key access
        ext4: use pre-zeroed blocks for DAX page faults
        ext4: implement allocation of pre-zeroed blocks
        ext4: provide ext4_issue_zeroout()
        ext4: get rid of EXT4_GET_BLOCKS_NO_LOCK flag
        ext4: document lock ordering
        ext4: fix races of writeback with punch hole and zero range
        ext4: fix races between buffered IO and collapse / insert range
        ext4: move unlocked dio protection from ext4_alloc_file_blocks()
        ext4: fix races between page faults and hole punching
      391f2a16
    • Linus Torvalds's avatar
      Merge tag 'xfs-for-linus-4.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/dgc/linux-xfs · d5ffdf8b
      Linus Torvalds authored
      Pull more xfs updates from Dave Chinner:
       "This is the second update for XFS that I mentioned in the original
        pull request last week.
      
        It contains a revert for a suspend regression in 4.4 and a fix for a
        long standing log recovery issue that has been further exposed by all
        the log recovery changes made in the original 4.5 merge.
      
        There is one more thing in this pull request - one that I forgot to
        merge into the origin.  That is, pulling the XFS_IOC_FS[GS]ETXATTR
        ioctl up to the VFS level so that other filesystems can also use it
        for modifying project quota IDs
      
        Summary:
      
         - promotion of XFS_IOC_FS[GS]ETXATTR ioctl to the vfs level so that
           it can be shared with other filesystems.  The ext4 project quota
           functionality is the first target for this.  The commits in this
           series have not been updated with review or final SOB tags because
           the branch they were originally published in was needed by ext4.
           Those tags are:
      Reviewed-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Signed-off-by: default avatarDave Chinner <david@fromrobit.com>
      
         - Revert a change that is causing suspend failures.
      
         - Fix a use-after-free that can occur on log mount failures.  Been
           around forever, but now exposed by other changes to log recovery
           made in the first 4.5 merge"
      
      * tag 'xfs-for-linus-4.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/dgc/linux-xfs:
        xfs: log mount failures don't wait for buffers to be released
        Revert "xfs: clear PF_NOFREEZE for xfsaild kthread"
        xfs: introduce per-inode DAX enablement
        xfs: use FS_XFLAG definitions directly
        fs: XFS_IOC_FS[SG]SETXATTR to FS_IOC_FS[SG]ETXATTR promotion
      d5ffdf8b
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · eadee0ce
      Linus Torvalds authored
      Pull more vfs updates from Al Viro:
       "Embarrassing braino fix + pipe page accounting + fixing an eyesore in
        find_filesystem() (checking that s1 is equal to prefix of s2 of given
        length can be done in many ways, but "compare strlen(s1) with length
        and then do strncmp()" is not a good one...)"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        [regression] fix braino in fs/dlm/user.c
        pipe: limit the per-user amount of pages allocated in pipes
        find_filesystem(): simplify comparison
      eadee0ce
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · 6fb11e65
      Linus Torvalds authored
      Merge misc fixes from Andrew Morton:
       "Six fixes"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        ocfs2: NFS hangs in __ocfs2_cluster_lock due to race with ocfs2_unblock_lock
        reiserfs: fix dereference of ERR_PTR
        ratelimit: fix bug in time interval by resetting right begin time
        mm: fix kernel crash in khugepaged thread
        mm: fix mlock accouting
        thp: change pmd_trans_huge_lock() interface to return ptl
      6fb11e65
    • Linus Torvalds's avatar
      Merge branch 'for-4.5/nvme' of git://git.kernel.dk/linux-block · 3e1e21c7
      Linus Torvalds authored
      Pull NVMe updates from Jens Axboe:
       "Last branch for this series is the nvme changes.  It's in a separate
        branch to avoid splitting too much between core and NVMe changes,
        since NVMe is still helping drive some blk-mq changes.  That said, not
        a huge amount of core changes in here.  The grunt of the work is the
        continued split of the code"
      
      * 'for-4.5/nvme' of git://git.kernel.dk/linux-block: (67 commits)
        uapi: update install list after nvme.h rename
        NVMe: Export NVMe attributes to sysfs group
        NVMe: Shutdown controller only for power-off
        NVMe: IO queue deletion re-write
        NVMe: Remove queue freezing on resets
        NVMe: Use a retryable error code on reset
        NVMe: Fix admin queue ring wrap
        nvme: make SG_IO support optional
        nvme: fixes for NVME_IOCTL_IO_CMD on the char device
        nvme: synchronize access to ctrl->namespaces
        nvme: Move nvme_freeze/unfreeze_queues to nvme core
        PCI/AER: include header file
        NVMe: Export namespace attributes to sysfs
        NVMe: Add pci error handlers
        block: remove REQ_NO_TIMEOUT flag
        nvme: merge iod and cmd_info
        nvme: meta_sg doesn't have to be an array
        nvme: properly free resources for cancelled command
        nvme: simplify completion handling
        nvme: special case AEN requests
        ...
      3e1e21c7
    • Linus Torvalds's avatar
      Merge branch 'for-4.5/lightnvm' of git://git.kernel.dk/linux-block · 0a13daed
      Linus Torvalds authored
      Pull lightnvm fixes and updates from Jens Axboe:
       "This should have been part of the drivers branch, but it arrived a bit
        late and wasn't based on the official core block driver branch.  So
        they got a small scolding, but got a pass since it's still new.  Hence
        it's in a separate branch.
      
        This is mostly pure fixes, contained to lightnvm/, and minor feature
        additions"
      
      * 'for-4.5/lightnvm' of git://git.kernel.dk/linux-block: (26 commits)
        lightnvm: ensure that nvm_dev_ops can be used without CONFIG_NVM
        lightnvm: introduce factory reset
        lightnvm: use system block for mm initialization
        lightnvm: introduce ioctl to initialize device
        lightnvm: core on-disk initialization
        lightnvm: introduce mlc lower page table mappings
        lightnvm: add mccap support
        lightnvm: manage open and closed blocks separately
        lightnvm: fix missing grown bad block type
        lightnvm: reference rrpc lun in rrpc block
        lightnvm: introduce nvm_submit_ppa
        lightnvm: move rq->error to nvm_rq->error
        lightnvm: support multiple ppas in nvm_erase_ppa
        lightnvm: move the pages per block check out of the loop
        lightnvm: sectors first in ppa list
        lightnvm: fix locking and mempool in rrpc_lun_gc
        lightnvm: put block back to gc list on its reclaim fail
        lightnvm: check bi_error in gc
        lightnvm: return the get_bb_tbl return value
        lightnvm: refactor end_io functions for sync
        ...
      0a13daed
    • Linus Torvalds's avatar
      Merge branch 'for-4.5/drivers' of git://git.kernel.dk/linux-block · 64120354
      Linus Torvalds authored
      Pull block driver updates from Jens Axboe:
       "This is the block driver pull request for 4.5, with the exception of
        NVMe, which is in a separate branch and will be posted after this one.
      
        This pull request contains:
      
         - A set of bcache stability fixes, which have been acked by Kent.
           These have been used and tested for more than a year by the
           community, so it's about time that they got in.
      
         - A set of drbd updates from the drbd team (Andreas, Lars, Philipp)
           and Markus Elfring, Oleg Drokin.
      
         - A set of fixes for xen blkback/front from the usual suspects, (Bob,
           Konrad) as well as community based fixes from Kiri, Julien, and
           Peng.
      
         - A 2038 time fix for sx8 from Shraddha, with a fix from me.
      
         - A small mtip32xx cleanup from Zhu Yanjun.
      
         - A null_blk division fix from Arnd"
      
      * 'for-4.5/drivers' of git://git.kernel.dk/linux-block: (71 commits)
        null_blk: use sector_div instead of do_div
        mtip32xx: restrict variables visible in current code module
        xen/blkfront: Fix crash if backend doesn't follow the right states.
        xen/blkback: Fix two memory leaks.
        xen/blkback: make st_ statistics per ring
        xen/blkfront: Handle non-indirect grant with 64KB pages
        xen-blkfront: Introduce blkif_ring_get_request
        xen-blkback: clear PF_NOFREEZE for xen_blkif_schedule()
        xen/blkback: Free resources if connect_ring failed.
        xen/blocks: Return -EXX instead of -1
        xen/blkback: make pool of persistent grants and free pages per-queue
        xen/blkback: get the number of hardware queues/rings from blkfront
        xen/blkback: pseudo support for multi hardware queues/rings
        xen/blkback: separate ring information out of struct xen_blkif
        xen/blkfront: correct setting for xen_blkif_max_ring_order
        xen/blkfront: make persistent grants pool per-queue
        xen/blkfront: Remove duplicate setting of ->xbdev.
        xen/blkfront: Cleanup of comments, fix unaligned variables, and syntax errors.
        xen/blkfront: negotiate number of queues/rings to be used with backend
        xen/blkfront: split per device io_lock
        ...
      64120354
    • Tariq Saeed's avatar
      ocfs2: NFS hangs in __ocfs2_cluster_lock due to race with ocfs2_unblock_lock · b1b1e15e
      Tariq Saeed authored
      NFS on a 2 node ocfs2 cluster each node exporting dir.  The lock causing
      the hang is the global bit map inode lock.  Node 1 is master, has the
      lock granted in PR mode; Node 2 is in the converting list (PR -> EX).
      There are no holders of the lock on the master node so it should
      downconvert to NL and grant EX to node 2 but that does not happen.
      BLOCKED + QUEUED in lock res are set and it is on osb blocked list.
      Threads are waiting in __ocfs2_cluster_lock on BLOCKED.  One thread
      wants EX, rest want PR.  So it is as though the downconvert thread needs
      to be kicked to complete the conv.
      
      The hang is caused by an EX req coming into __ocfs2_cluster_lock on the
      heels of a PR req after it sets BUSY (drops l_lock, releasing EX
      thread), forcing the incoming EX to wait on BUSY without doing anything.
      PR has called ocfs2_dlm_lock, which sets the node 1 lock from NL -> PR,
      queues ast.
      
      At this time, upconvert (PR ->EX) arrives from node 2, finds conflict
      with node 1 lock in PR, so the lock res is put on dlm thread's dirty
      listt.
      
      After ret from ocf2_dlm_lock, PR thread now waits behind EX on BUSY till
      awoken by ast.
      
      Now it is dlm_thread that serially runs dlm_shuffle_lists, ast, bast, in
      that order.  dlm_shuffle_lists ques a bast on behalf of node 2 (which
      will be run by dlm_thread right after the ast).  ast does its part, sets
      UPCONVERT_FINISHING, clears BUSY and wakes its waiters.  Next,
      dlm_thread runs bast.  It sets BLOCKED and kicks dc thread.  dc thread
      runs ocfs2_unblock_lock, but since UPCONVERT_FINISHING set, skips doing
      anything and reques.
      
      Inside of __ocfs2_cluster_lock, since EX has been waiting on BUSY ahead
      of PR, it wakes up first, finds BLOCKED set and skips doing anything but
      clearing UPCONVERT_FINISHING (which was actually "meant" for the PR
      thread), and this time waits on BLOCKED.  Next, the PR thread comes out
      of wait but since UPCONVERT_FINISHING is not set, it skips updating the
      l_ro_holders and goes straight to wait on BLOCKED.  So there, we have a
      hang! Threads in __ocfs2_cluster_lock wait on BLOCKED, lock res in osb
      blocked list.  Only when dc thread is awoken, it will run
      ocfs2_unblock_lock and things will unhang.
      
      One way to fix this is to wake the dc thread on the flag after clearing
      UPCONVERT_FINISHING
      
      Orabug: 20933419
      Signed-off-by: default avatarTariq Saeed <tariq.x.saeed@oracle.com>
      Signed-off-by: default avatarSantosh Shilimkar <santosh.shilimkar@oracle.com>
      Reviewed-by: default avatarWengang Wang <wen.gang.wang@oracle.com>
      Reviewed-by: default avatarMark Fasheh <mfasheh@suse.de>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Junxiao Bi <junxiao.bi@oracle.com>
      Reviewed-by: default avatarJoseph Qi <joseph.qi@huawei.com>
      Cc: Eric Ren <zren@suse.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b1b1e15e
    • Sudip Mukherjee's avatar
      reiserfs: fix dereference of ERR_PTR · ff7d080e
      Sudip Mukherjee authored
      reiserfs_iget() returns either NULL or error code in ERR_PTR.  And we
      were only checking for NULL, so in case of some other error we will try
      to dereference the ERR_PTR(-errno) thinking it to be a valid pointer.
      Signed-off-by: default avatarSudip Mukherjee <sudip@vectorindia.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ff7d080e
    • Jaewon Kim's avatar
      ratelimit: fix bug in time interval by resetting right begin time · c2594bc3
      Jaewon Kim authored
      rs->begin in ratelimit is set in two cases.
       1) when rs->begin was not initialized
       2) when rs->interval was passed
      
      For case #2, current ratelimit sets the begin to 0.  This incurrs
      improper suppression.  The begin value will be set in the next ratelimit
      call by 1).  Then the time interval check will be always false, and
      rs->printed will not be initialized.  Although enough time passed,
      ratelimit may return 0 if rs->printed is not less than rs->burst.  To
      reset interval properly, begin should be jiffies rather than 0.
      
      For an example code below:
      
          static DEFINE_RATELIMIT_STATE(mylimit, 1, 1);
          for (i = 1; i <= 10; i++) {
              if (__ratelimit(&mylimit))
                  printk("ratelimit test count %d\n", i);
              msleep(3000);
          }
      
      test result in the current code shows suppression even there is 3 seconds sleep.
      
        [  78.391148] ratelimit test count 1
        [  81.295988] ratelimit test count 2
        [  87.315981] ratelimit test count 4
        [  93.336267] ratelimit test count 6
        [  99.356031] ratelimit test count 8
        [ 105.376367] ratelimit test count 10
      Signed-off-by: default avatarJaewon Kim <jaewon31.kim@samsung.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c2594bc3
    • yalin wang's avatar
      mm: fix kernel crash in khugepaged thread · 16fd0fe4
      yalin wang authored
      This crash is caused by NULL pointer deference, in page_to_pfn() marco,
      when page == NULL :
      
        Unable to handle kernel NULL pointer dereference at virtual address 00000000
        Internal error: Oops: 94000006 [#1] SMP
        Modules linked in:
        CPU: 1 PID: 26 Comm: khugepaged Tainted: G        W       4.3.0-rc6-next-20151022ajb-00001-g32f3386-dirty #3
        PC is at khugepaged+0x378/0x1af8
        LR is at khugepaged+0x418/0x1af8
        Process khugepaged (pid: 26, stack limit = 0xffffffc079638020)
        Call trace:
          khugepaged+0x378/0x1af8
          kthread+0xdc/0xf4
          ret_from_fork+0xc/0x40
        Code: 35001700 f0002c60 aa0703e3 f9009fa0 (f94000e0)
        ---[ end trace 637503d8e28ae69e  ]---
        Kernel panic - not syncing: Fatal exception
        CPU2: stopping
        CPU: 2 PID: 0 Comm: swapper/2 Tainted: G      D W       4.3.0-rc6-next-20151022ajb-00001-g32f3386-dirty #3
        Hardware name: linux,dummy-virt (DT)
      
      [akpm@linux-foundation.org: fix fat-fingered merge resolution]
      Signed-off-by: default avataryalin wang <yalin.wang2010@gmail.com>
      Acked-by: default avatarVlastimil Babka <vbabka@suse.cz>
      Acked-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Acked-by: default avatarDavid Rientjes <rientjes@google.com>
      Cc: Cyrill Gorcunov <gorcunov@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      16fd0fe4
    • Kirill A. Shutemov's avatar
      mm: fix mlock accouting · 7162a1e8
      Kirill A. Shutemov authored
      Tetsuo Handa reported underflow of NR_MLOCK on munlock.
      
      Testcase:
      
          #include <stdio.h>
          #include <stdlib.h>
          #include <sys/mman.h>
      
          #define BASE ((void *)0x400000000000)
          #define SIZE (1UL << 21)
      
          int main(int argc, char *argv[])
          {
              void *addr;
      
              system("grep Mlocked /proc/meminfo");
              addr = mmap(BASE, SIZE, PROT_READ | PROT_WRITE,
                      MAP_ANONYMOUS | MAP_PRIVATE | MAP_LOCKED | MAP_FIXED,
                      -1, 0);
              if (addr == MAP_FAILED)
                  printf("mmap() failed\n"), exit(1);
              munmap(addr, SIZE);
              system("grep Mlocked /proc/meminfo");
              return 0;
          }
      
      It happens on munlock_vma_page() due to unfortunate choice of nr_pages
      data type:
      
          __mod_zone_page_state(zone, NR_MLOCK, -nr_pages);
      
      For unsigned int nr_pages, implicitly casted to long in
      __mod_zone_page_state(), it becomes something around UINT_MAX.
      
      munlock_vma_page() usually called for THP as small pages go though
      pagevec.
      
      Let's make nr_pages signed int.
      
      Similar fixes in 6cdb18ad ("mm/vmstat: fix overflow in
      mod_zone_page_state()") used `long' type, but `int' here is OK for a
      count of the number of sub-pages in a huge page.
      
      Fixes: ff6a6da6 ("mm: accelerate munlock() treatment of THP pages")
      Signed-off-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Reported-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Tested-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Cc: Michel Lespinasse <walken@google.com>
      Acked-by: default avatarMichal Hocko <mhocko@suse.com>
      Cc: <stable@vger.kernel.org>  [4.4+]
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      7162a1e8
    • Kirill A. Shutemov's avatar
      thp: change pmd_trans_huge_lock() interface to return ptl · b6ec57f4
      Kirill A. Shutemov authored
      After THP refcounting rework we have only two possible return values
      from pmd_trans_huge_lock(): success and failure.  Return-by-pointer for
      ptl doesn't make much sense in this case.
      
      Let's convert pmd_trans_huge_lock() to return ptl on success and NULL on
      failure.
      Signed-off-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Suggested-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Cc: Minchan Kim <minchan@kernel.org>
      Acked-by: default avatarMichal Hocko <mhocko@suse.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b6ec57f4
  3. 21 Jan, 2016 16 commits
    • Al Viro's avatar
      [regression] fix braino in fs/dlm/user.c · 117aa41e
      Al Viro authored
      it's "bugger off if we got ERR_PTR", not the other way round...
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      117aa41e
    • Linus Torvalds's avatar
      Merge branch 'uaccess' (batched user access infrastructure) · 404a4741
      Linus Torvalds authored
      Expose an interface to allow users to mark several accesses together as
      being user space accesses, allowing batching of the surrounding user
      space access markers (SMAP on x86, PAN on arm64, domain register
      switching on arm).
      
      This is currently only used for the user string lenth and copying
      functions, where the SMAP overhead on x86 drowned the actual user
      accesses (only noticeable on newer microarchitectures that support SMAP
      in the first place, of course).
      
      * user access batching branch:
        Use the new batched user accesses in generic user string handling
        Add 'unsafe' user access functions for batched accesses
        x86: reorganize SMAP handling in user space accesses
      404a4741
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · eae21770
      Linus Torvalds authored
      Merge third patch-bomb from Andrew Morton:
       "I'm pretty much done for -rc1 now:
      
         - the rest of MM, basically
      
         - lib/ updates
      
         - checkpatch, epoll, hfs, fatfs, ptrace, coredump, exit
      
         - cpu_mask simplifications
      
         - kexec, rapidio, MAINTAINERS etc, etc.
      
         - more dma-mapping cleanups/simplifications from hch"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (109 commits)
        MAINTAINERS: add/fix git URLs for various subsystems
        mm: memcontrol: add "sock" to cgroup2 memory.stat
        mm: memcontrol: basic memory statistics in cgroup2 memory controller
        mm: memcontrol: do not uncharge old page in page cache replacement
        Documentation: cgroup: add memory.swap.{current,max} description
        mm: free swap cache aggressively if memcg swap is full
        mm: vmscan: do not scan anon pages if memcg swap limit is hit
        swap.h: move memcg related stuff to the end of the file
        mm: memcontrol: replace mem_cgroup_lruvec_online with mem_cgroup_online
        mm: vmscan: pass memcg to get_scan_count()
        mm: memcontrol: charge swap to cgroup2
        mm: memcontrol: clean up alloc, online, offline, free functions
        mm: memcontrol: flatten struct cg_proto
        mm: memcontrol: rein in the CONFIG space madness
        net: drop tcp_memcontrol.c
        mm: memcontrol: introduce CONFIG_MEMCG_LEGACY_KMEM
        mm: memcontrol: allow to disable kmem accounting for cgroup2
        mm: memcontrol: account "kmem" consumers in cgroup2 memory controller
        mm: memcontrol: move kmem accounting code to CONFIG_MEMCG
        mm: memcontrol: separate kmem code from legacy tcp accounting code
        ...
      eae21770
    • Linus Torvalds's avatar
      Merge branch 'overlayfs-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs · e9f57ebc
      Linus Torvalds authored
      Pull overlayfs updates from Miklos Szeredi:
       "This contains several bug fixes and a new mount option
        'default_permissions' that allows read-only exported NFS
        filesystems to be used as lower layer"
      
      * 'overlayfs-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs:
        ovl: check dentry positiveness in ovl_cleanup_whiteouts()
        ovl: setattr: check permissions before copy-up
        ovl: root: copy attr
        ovl: move super block magic number to magic.h
        ovl: use a minimal buffer in ovl_copy_xattr
        ovl: allow zero size xattr
        ovl: default permissions
      e9f57ebc
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse · 5c89e9ea
      Linus Torvalds authored
      Pull fuse updates from Miklos Szeredi:
       "This adds SEEK_HOLE and SEEK_DATA support in lseek"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse:
        fuse: add support for SEEK_HOLE and SEEK_DATA in lseek
      5c89e9ea
    • Linus Torvalds's avatar
      Merge tag 'pci-v4.5-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci · d4342156
      Linus Torvalds authored
      Pull PCI updates from Bjorn Helgaas:
       "PCI changes for the v4.5 merge window:
      
        Enumeration:
         - Simplify config space size computation (Bjorn Helgaas)
         - Avoid iterating through ROM outside the resource window (Edward O'Callaghan)
         - Support PCIe devices with short cfg_size (Jason S. McMullan)
         - Add Netronome vendor and device IDs (Jason S. McMullan)
         - Limit config space size for Netronome NFP6000 family (Jason S. McMullan)
         - Add Netronome NFP4000 PF device ID (Simon Horman)
         - Limit config space size for Netronome NFP4000 (Simon Horman)
         - Print warnings for all invalid expansion ROM headers (Vladis Dronov)
      
        Resource management:
         - Fix minimum allocation address overwrite (Christoph Biedl)
      
        PCI device hotplug:
         - acpiphp_ibm: Fix null dereferences on null ibm_slot (Colin Ian King)
         - pciehp: Always protect pciehp_disable_slot() with hotplug mutex (Guenter Roeck)
         - shpchp: Constify hpc_ops structure (Julia Lawall)
         - ibmphp: Remove unneeded NULL test (Julia Lawall)
      
        Power management:
         - Make ASPM sysfs link_state_store() consistent with link_state_show() (Andy Lutomirski)
      
        Virtualization
         - Add function 1 DMA alias quirk for Lite-On/Plextor M6e/Marvell 88SS9183 (Tim Sander)
      
        MSI:
         - Remove empty pci_msi_init_pci_dev() (Bjorn Helgaas)
         - Mark PCIe/PCI (MSI) IRQ cascade handlers as IRQF_NO_THREAD (Grygorii Strashko)
         - Initialize MSI capability for all architectures (Guilherme G. Piccoli)
         - Relax msi_domain_alloc() to support parentless MSI irqdomains (Liu Jiang)
      
        ARM Versatile host bridge driver:
         - Remove unused pci_sys_data structures (Lorenzo Pieralisi)
      
        Broadcom iProc host bridge driver:
         - Hide CONFIG_PCIE_IPROC (Arnd Bergmann)
         - Do not use 0x in front of %pap (Dmitry V. Krivenok)
         - Update iProc PCIe device tree binding (Ray Jui)
         - Add PAXC interface support (Ray Jui)
         - Add iProc PCIe MSI device tree binding (Ray Jui)
         - Add iProc PCIe MSI support (Ray Jui)
      
        Freescale i.MX6 host bridge driver:
         - Use gpio_set_value_cansleep() (Fabio Estevam)
         - Add support for active-low reset GPIO (Petr Štetiar)
      
        HiSilicon host bridge driver:
         - Add support for HiSilicon Hip06 PCIe host controllers (Gabriele Paoloni)
      
        Intel VMD host bridge driver:
         - Export irq_domain_set_info() for module use (Keith Busch)
         - x86/PCI: Allow DMA ops specific to a PCI domain (Keith Busch)
         - Use 32 bit PCI domain numbers (Keith Busch)
         - Add driver for Intel Volume Management Device (VMD) (Keith Busch)
      
        Qualcomm host bridge driver:
         - Document PCIe devicetree bindings (Stanimir Varbanov)
         - Add Qualcomm PCIe controller driver (Stanimir Varbanov)
         - dts: apq8064: add PCIe devicetree node (Stanimir Varbanov)
         - dts: ifc6410: enable PCIe DT node for this board (Stanimir Varbanov)
      
        Renesas R-Car host bridge driver:
         - Add support for R-Car H3 to pcie-rcar (Harunobu Kurokawa)
         - Allow DT to override default window settings (Phil Edworthy)
         - Convert to DT resource parsing API (Phil Edworthy)
         - Revert "PCI: rcar: Build pcie-rcar.c only on ARM" (Phil Edworthy)
         - Remove unused pci_sys_data struct from pcie-rcar (Phil Edworthy)
         - Add runtime PM support to pcie-rcar (Phil Edworthy)
         - Add Gen2 PHY setup to pcie-rcar (Phil Edworthy)
         - Add gen2 fallback compatibility string for pci-rcar-gen2 (Simon Horman)
         - Add gen2 fallback compatibility string for pcie-rcar (Simon Horman)
      
        Synopsys DesignWare host bridge driver:
         - Simplify control flow (Bjorn Helgaas)
         - Make config accessor override checking symmetric (Bjorn Helgaas)
         - Ensure ATU is enabled before IO/conf space accesses (Stanimir Varbanov)
      
        Miscellaneous:
         - Add of_pci_get_host_bridge_resources() stub (Arnd Bergmann)
         - Check for PCI_HEADER_TYPE_BRIDGE equality, not bitmask (Bjorn Helgaas)
         - Fix all whitespace issues (Bogicevic Sasa)
         - x86/PCI: Simplify pci_bios_{read,write} (Geliang Tang)
         - Use to_pci_dev() instead of open-coding it (Geliang Tang)
         - Use kobj_to_dev() instead of open-coding it (Geliang Tang)
         - Use list_for_each_entry() to simplify code (Geliang Tang)
         - Fix typos in <linux/msi.h> (Thomas Petazzoni)
         - x86/PCI: Clarify AMD Fam10h config access restrictions comment (Tomasz Nowicki)"
      
      * tag 'pci-v4.5-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (58 commits)
        PCI: Add function 1 DMA alias quirk for Lite-On/Plextor M6e/Marvell 88SS9183
        PCI: Limit config space size for Netronome NFP4000
        PCI: Add Netronome NFP4000 PF device ID
        x86/PCI: Add driver for Intel Volume Management Device (VMD)
        PCI/AER: Use 32 bit PCI domain numbers
        x86/PCI: Allow DMA ops specific to a PCI domain
        irqdomain: Export irq_domain_set_info() for module use
        PCI: host: Add of_pci_get_host_bridge_resources() stub
        genirq/MSI: Relax msi_domain_alloc() to support parentless MSI irqdomains
        PCI: rcar: Add Gen2 PHY setup to pcie-rcar
        PCI: rcar: Add runtime PM support to pcie-rcar
        PCI: designware: Make config accessor override checking symmetric
        PCI: ibmphp: Remove unneeded NULL test
        ARM: dts: ifc6410: enable PCIe DT node for this board
        ARM: dts: apq8064: add PCIe devicetree node
        PCI: hotplug: Use list_for_each_entry() to simplify code
        PCI: rcar: Remove unused pci_sys_data struct from pcie-rcar
        PCI: hisi: Add support for HiSilicon Hip06 PCIe host controllers
        PCI: Avoid iterating through memory outside the resource window
        PCI: acpiphp_ibm: Fix null dereferences on null ibm_slot
        ...
      d4342156
    • Linus Torvalds's avatar
      Merge tag 'pwm/for-4.5-rc1' of... · 859e7625
      Linus Torvalds authored
      Merge tag 'pwm/for-4.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm
      
      Pull pwm updates from Thierry Reding:
       "This set of changes contains a new driver for OMAP (using the
        dual-mode timers) as well as an assortment of fixes all across the
        board"
      
      * tag 'pwm/for-4.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm:
        pwm: Mark all devices as "might sleep"
        pwm: omap-dmtimer: Potential NULL dereference on error
        pwm: add HAS_IOMEM dependency to PWM_FSL_FTM
        pwm: Add PWM driver for OMAP using dual-mode timers
        pwm: rcar: Improve accuracy of frequency division setting
        pwm: lpc32xx: return ERANGE, if requested period is not supported
        pwm: lpc32xx: fix and simplify duty cycle and period calculations
        pwm: lpc32xx: make device usable with common clock framework
        pwm: lpc32xx: correct number of PWM channels from 2 to 1
        dt: lpc32xx: pwm: update documentation of LPC32xx PWM device
        dt: lpc32xx: pwm: correct LPC32xx PWM device node example
        pwm: fsl-ftm: Fix clock enable/disable when using PM
        pwm: lpss: Rework the sequence of programming PWM_SW_UPDATE
        pwm: lpss: Select core part automatically
        pwm: lpss: Update PWM setting for Broxton
        pwm: bcm2835: Fix email address specification
        pwm: bcm2835: Prevent division by zero
        pwm: bcm2835: Calculate scaler in ->config()
        pwm: lpss: Remove ->free() callback
      859e7625
    • Linus Torvalds's avatar
      Merge tag 'cris-for-4.5' of git://git.kernel.org/pub/scm/linux/kernel/git/jesper/cris · 96461fdb
      Linus Torvalds authored
      Pull CRIS updates from Jesper Nilsson:
       "Just some fixups for section mismatches from Guenter"
      
      * tag 'cris-for-4.5' of git://git.kernel.org/pub/scm/linux/kernel/git/jesper/cris:
        cris: Fix section mismatches in architecture startup code
        cris: debugport: Fix section mismatches
      96461fdb
    • Linus Torvalds's avatar
      Merge tag 'for-4.5' of git://git.osdn.jp/gitroot/uclinux-h8/linux · 278e5aca
      Linus Torvalds authored
      Pull h8300 updates from Yoshinori Sato:
       - Add KGDB support
       - zImage fix
       - various cleanup
      
      * tag 'for-4.5' of git://git.osdn.jp/gitroot/uclinux-h8/linux:
        h8300: System call entry enable interrupt.
        h8300: show_stack cleanup
        h8300: Restraint of warning.
        h8300: Add KGDB support.
        irqchip: renesas-h8s: Replace ctrl_outw/ctrl_inw with writew/readw
        h8300: signal stack fix
        h8300: Add LZO compression
        h8300: zImage alignment fix
        clk: h8300: Remove "sh73a0-" part from compatible value
        h8300: zImage alignment fix
      278e5aca
    • Thierry Reding's avatar
      pwm: Mark all devices as "might sleep" · ff01c944
      Thierry Reding authored
      Commit d1cd2142 ("pwm: Set enable state properly on failed call to
      enable") introduced a mutex that is needed to protect internal state of
      PWM devices. Since that mutex is acquired in pwm_set_polarity() and in
      pwm_enable() and might potentially block, all PWM devices effectively
      become "might sleep".
      
      It's rather pointless to keep the .can_sleep field around, but given
      that there are external users let's postpone the removal for the next
      release cycle.
      Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
      ff01c944
    • Linus Torvalds's avatar
      Merge tag 'pm+acpi-4.5-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 30f05309
      Linus Torvalds authored
      Pull more power management and ACPI updates from Rafael Wysocki:
       "This includes fixes on top of the previous batch of PM+ACPI updates
        and some new material as well.
      
        From the new material perspective the most significant are the driver
        core changes that should allow USB devices to stay suspended over
        system suspend/resume cycles if they have been runtime-suspended
        already beforehand.  Apart from that, ACPICA is updated to upstream
        revision 20160108 (cosmetic mostly, but including one fixup on top of
        the previous ACPICA update) and there are some devfreq updates the
        didn't make it before (due to timing).
      
        A few recent regressions are fixed, most importantly in the cpuidle
        menu governor and in the ACPI backlight driver and some x86 platform
        drivers depending on it.
      
        Some more bugs are fixed and cleanups are made on top of that.
      
        Specifics:
      
         - Modify the driver core and the USB subsystem to allow USB devices
           to stay suspended over system suspend/resume cycles if they have
           been runtime-suspended already beforehand and fix some bugs on top
           of these changes (Tomeu Vizoso, Rafael Wysocki).
      
         - Update ACPICA to upstream revision 20160108, including updates of
           the ACPICA's copyright notices, a code fixup resulting from a
           regression fix that was necessary in the upstream code only (the
           regression fixed by it has never been present in Linux) and a
           compiler warning fix (Bob Moore, Lv Zheng).
      
         - Fix a recent regression in the cpuidle menu governor that broke it
           on practically all architectures other than x86 and make a couple
           of optimizations on top of that fix (Rafael Wysocki).
      
         - Clean up the selection of cpuidle governors depending on whether or
           not the kernel is configured for tickless systems (Jean Delvare).
      
         - Revert a recent commit that introduced a regression in the ACPI
           backlight driver, address the problem it attempted to fix in a
           different way and revert one more cosmetic change depending on the
           problematic commit (Hans de Goede).
      
         - Add two more ACPI backlight quirks (Hans de Goede).
      
         - Fix a few minor problems in the core devfreq code, clean it up a
           bit and update the MAINTAINERS information related to it (Chanwoo
           Choi, MyungJoo Ham).
      
         - Improve an error message in the ACPI fan driver (Andy Lutomirski).
      
         - Fix a recent build regression in the cpupower tool (Shreyas
           Prabhu)"
      
      * tag 'pm+acpi-4.5-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (32 commits)
        cpuidle: menu: Avoid pointless checks in menu_select()
        sched / idle: Drop default_idle_call() fallback from call_cpuidle()
        cpupower: Fix build error in cpufreq-info
        cpuidle: Don't enable all governors by default
        cpuidle: Default to ladder governor on ticking systems
        time: nohz: Expose tick_nohz_enabled
        ACPICA: Update version to 20160108
        ACPICA: Silence a -Wbad-function-cast warning when acpi_uintptr_t is 'uintptr_t'
        ACPICA: Additional 2016 copyright changes
        ACPICA: Reduce regression fix divergence from upstream ACPICA
        ACPI / video: Add disable_backlight_sysfs_if quirk for the Toshiba Satellite R830
        ACPI / video: Revert "thinkpad_acpi: Use acpi_video_handles_brightness_key_presses()"
        ACPI / video: Document acpi_video_handles_brightness_key_presses() a bit
        ACPI / video: Fix using an uninitialized mutex / list_head in acpi_video_handles_brightness_key_presses()
        ACPI / video: Revert "ACPI / video: driver must be registered before checking for keypresses"
        ACPI / fan: Improve acpi_device_update_power error message
        ACPI / video: Add disable_backlight_sysfs_if quirk for the Toshiba Portege R700
        cpuidle: menu: Fix menu_select() for CPUIDLE_DRIVER_STATE_START == 0
        MAINTAINERS: Add devfreq-event entry
        MAINTAINERS: Add missing git repository and directory for devfreq
        ...
      30f05309
    • Linus Torvalds's avatar
      Merge tag 'renesas-sh-drivers-for-v4.5' of... · 3549d822
      Linus Torvalds authored
      Merge tag 'renesas-sh-drivers-for-v4.5' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas
      
      Pull SH driver updates from Simon Horman:
       "Clean up the clock API on legacy SH to make it more similar to the
        Common Clock Framework.  This will avoid different behaviour in
        drivers shared between legacy and CCF-based platforms (e.g.  SCIF)"
      
      * tag 'renesas-sh-drivers-for-v4.5' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
        drivers: sh: clk: Avoid crashes when passing NULL clocks
        drivers: sh: clk: Remove obsolete and unused clk_round_parent()
      3549d822
    • Linus Torvalds's avatar
      Merge tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 9638685e
      Linus Torvalds authored
      Pull ARM SoC driver updates from Olof Johansson:
       "Driver updates for ARM SoCs.  Some for SoC-family code under
        drivers/soc, but also some other driver updates that don't belong
        anywhere else.  We also bring in the drivers/reset code through
        arm-soc.
      
        Some of the larger updates:
      
         - Qualcomm support for SMEM, SMSM, SMP2P.  All used to communicate
           with other parts of the chip/board on these platforms, all
           proprietary protocols that don't fit into other subsystems and live
           in drivers/soc for now.
      
         - System bus driver for UniPhier
      
         - Driver for the TI Wakeup M3 IPC device
      
         - Power management for Raspberry PI
      
        + Again a bunch of other smaller updates and patches"
      
      * tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (38 commits)
        bus: uniphier: allow only built-in driver
        ARM: bcm2835: clarify RASPBERRYPI_FIRMWARE dependency
        MAINTAINERS: Drop Kumar Gala from QCOM
        bus: uniphier-system-bus: add UniPhier System Bus driver
        ARM: bcm2835: add rpi power domain driver
        dt-bindings: add rpi power domain driver bindings
        ARM: bcm2835: Define two new packets from the latest firmware.
        drivers/soc: make mediatek/mtk-scpsys.c explicitly non-modular
        soc: mediatek: SCPSYS: Add regulator support
        MAINTAINERS: Change QCOM entries
        soc: qcom: smd-rpm: Add existing platform support
        memory/tegra: Add number of TLB lines for Tegra124
        reset: hi6220: fix modular build
        soc: qcom: Introduce WCNSS_CTRL SMD client
        ARM: qcom: select ARM_CPU_SUSPEND for power management
        MAINTAINERS: Add rules for Qualcomm dts files
        soc: qcom: enable smsm/smp2p modular build
        serial: msm_serial: Make config tristate
        soc: qcom: smp2p: Qualcomm Shared Memory Point to Point
        soc: qcom: smsm: Add driver for Qualcomm SMSM
        ...
      9638685e
    • Linus Torvalds's avatar
      Merge tag 'armsoc-defconfig64' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 03d7d124
      Linus Torvalds authored
      Pull ARM 64-bit defconfig updates from Olof Johansson:
       "As mentioned earlier, we usually bake this into the general "arm64"
        branch, but this release we have partitioned up the updates a bit
        more.
      
        Most of these updates are enabling new SoCs in the single defconfig
        for 64-bit, Renesas R8A7795, a number of Tegra options, Socionext
        Uniphier and a handful of new options for other platforms as well"
      
      * tag 'armsoc-defconfig64' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
        arm64: mediatek: enable MTK_TIMER
        arm64: defconfig: add CS2000 support
        arm64: defconfig: Add Renesas R-Car SATA driver for R-Car Gen3 SoCs
        arm64: defconfig: enable UniPhier SoCs support
        arm64: add Kconfig entry for Socionext UniPhier SoC family
        arm64: defconfig: add Renesas sound and AK4613 support
        arm64: defconfig: add Renesas R-Car DMAC driver support
        arm64: defconfig: Enable Renesas R-Car I2C Controller
        arm64: defconfig: enable EthernetAVB
        arm64: defconfig: Enable GPIO of Renesas R-Car Gen3 SoC
        arm64: berlin: add the pinctrl dependency for Marvell Berlin SoCs
        arm64: defconfig: renesas: Enable Renesas r8a7795 SoC
        arm64: defconfig: Enable printk timestamps
        arm64: defconfig: Enable squashfs support
        arm64: defconfig: Enable sdhci-tegra driver
        arm64: defconfig: Enable serial-tegra driver
        arm64: defconfig: Enable tegra-apbdma driver
        arm64: defconfig: Do not disable Tegra AHB driver
        arm64: defconfig: Enable Tegra210 support
      03d7d124
    • Linus Torvalds's avatar
      Merge tag 'armsoc-defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · f9cd69fe
      Linus Torvalds authored
      Pull ARM SoC defconfig updates from Olof Johansson:
       "As usual, a bunch of commits, mostly adding drivers and other options
        to defconfigs because it makes sense to have them enabled on various
        development or product boards.  Too much to enumerate each here.
      
        There's an introduction of a pxa_defconfig, since PXA finally will
        allow building a shared kernel for all boards.  With this, we can
        hopefully remove a bunch of individual defconfigs down the road but it
        requires a bit of real life testing and transition period"
      
      * tag 'armsoc-defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (65 commits)
        ARM: Add CONFIG_DEPRECATED_PARAM_STRUCT to netwinder_defconfig
        ARM: multi_v7_defconfig: Add rockchip audio support
        arm: multi_v7_defconfig: Add virtio drivers
        ARM: zx_defconfig: remove CONFIG_MMC_DW_IDMAC
        ARM: versatile: enable the right LEDs
        ARM: pxa: add defconfig covering all the boards
        ARM: versatile: select some defaults in defconfig
        ARM: multi_v7_defconfig: Enable fan, sensors and audio for Odroid XU3
        ARM: bcm2835: enable auxiliary spi driver in defconfig
        ARM: bcm2835: enable all bcm2835-relevant in defconfig
        ARM: default to multi_v7_defconfig
        ARM: multi_v7_defconfig: enable rk808 clkout module
        ARM: multi_v7_defconfig: enable rockchip crypto module
        ARM: multi_v7_defconfig: enable Rockchip io-domain driver
        ARM: multi_v7_defconfig: Enable generic SoC internal OMAP regulators
        ARM: multi_v7_defconfig: Enable AM437x PMIC TPS65218
        ARM: multi_v7_defconfig: enable TPS65217 regulator
        ARM: realview: select apropriate targets
        ARM: defconfig: qcom: Enable SSBI drivers
        ARM: defconfig: Update qcom_defconfig
        ...
      f9cd69fe
    • Linus Torvalds's avatar
      Merge tag 'armsoc-dt64' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 62c79bb3
      Linus Torvalds authored
      Pull ARM 64-bit DT updates from Olof Johansson:
       "This is the first release where we split up the 64-bit contributions a
        bit more, and in particular we are having a separate DT branch for
        them.
      
        Contents:
      
         - New devices added to Broadcom NorthStar2
         - Misc fixes for Exynos7 boards
         - QCOM updates for MSM8916
         - Rockchip tweaks for rk3368 SoC and eval board
         - A series of fixes for APM X-Gene v1 and v2
         - Renesas R8A7795 CPU/PSCI additions
         - Marvell Berlin4CT PSCI, cpuidle, watchdog portions
         - Freescale LS1043a SoC and dev board support
      
        + some treewide or other misc changes"
      
      * tag 'armsoc-dt64' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (104 commits)
        dts/ls2080a: Update DTSI to add support of SP805 WDT
        Documentation: DT: Add entry for ARM SP805-WDT
        arm64: dts: X-Gene v2: I2C1 clock is always on
        arm64: dts: X-Gene v1: I2C0 clock is always on
        arm64: dts: Fix to use standard DT node names for X-Gene 1 and X-Gene 2 platforms
        arm64: dts: hikey: add label properties to UARTs
        arm64: dts: apq8016-sbc: add label properties for UART, I2C, and SPI
        arm64: dts: apq8016-sbc: enable UART0 on LS connector
        arm64: dts: juno: Add idle-states to device tree
        arm64: dts: Added syscon-reboot node for FSL's LS2080A SoC
        arm64: dts: add LS1043a-RDB board support
        arm64: dts: add Freescale LS1043a SoC support
        Documentation: DT: Add entry for Freescale LS1043a-RDB board
        arm64: dts: uniphier: add PH1-LD10 SoC/board support
        arm64: renesas: r8a7795: fix SATA clock assignment
        arm64: dts: salvator-x: Enable SATA controller
        arm64: dts: r8a7795: Add SATA controller node
        arm64: renesas: r8a7795: add internal delay for i2c IPs
        arm64: renesas: salvator-x: Add board part number to DT bindings
        arm64: dts: r8a7795: Add pmu device nodes
        ...
      62c79bb3