1. 10 5月, 2013 6 次提交
    • L
      Merge tag 'firewire-updates' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394 · f78089e8
      Linus Torvalds 提交于
      Pull firewure updates from Stefan Richter:
        - fix controller removal when controller is in suspended state
        - fix video reception on VIA VT6306 with gstreamer, MythTV, and maybe dv4l
        - fix a startup issue with Agere/LSI FW643-e2
        - error logging improvements and other small updates
      
      * tag 'firewire-updates' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394:
        firewire: ohci: dump_stack() for PHY regs read/write failures
        firewire: ohci: Improve bus reset error messages
        firewire: ohci: Alias dev_* log functions
        firewire: ohci: Fix 'failed to read phy reg' on FW643 rev8
        firewire: ohci: fix VIA VT6306 video reception
        firewire: ohci: Check LPS before register access on pci removal
        firewire: ohci: Fix double free_irq()
        firewire: remove unnecessary alloc/OOM messages
        firewire: sbp2: replace BUG_ON by WARN_ON
        firewire: core: remove an always false test
        firewire: Remove two unneeded checks for macros
      f78089e8
    • L
      Merge tag 'edac_fixes_for_3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp · 7462543a
      Linus Torvalds 提交于
      Pull two small EDAC fixes from Borislav Petkov.
      
      * tag 'edac_fixes_for_3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp:
        EDAC: Don't give write permission to read-only files
        EDAC, mc_sysfs.c: Fix string array pointer types
      7462543a
    • L
      Merge git://www.linux-watchdog.org/linux-watchdog · bde9d73d
      Linus Torvalds 提交于
      Pull watchdog update from Wim Van Sebroeck:
       "Fix a kdump issue in hpwdt and a possible NULL dereference"
      
      * git://www.linux-watchdog.org/linux-watchdog:
        watchdog: Fix race condition in registration code
        watchdog: Convert to devm_ioremap_resource()
      bde9d73d
    • L
      Merge tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux · 5647ac0a
      Linus Torvalds 提交于
      Pull removal of GENERIC_GPIO from Grant Likely:
       "GENERIC_GPIO now synonymous with GPIOLIB.  There are no longer any
        valid cases for enableing GENERIC_GPIO without GPIOLIB, even though it
        is possible to do so which has been causing confusion and breakage.
        This branch does the work to completely eliminate GENERIC_GPIO."
      
      * tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux:
        gpio: update gpio Chinese documentation
        Remove GENERIC_GPIO config option
        Convert selectors of GENERIC_GPIO to GPIOLIB
        blackfin: force use of gpiolib
        m68k: coldfire: use gpiolib
        mips: pnx833x: remove requirement for GENERIC_GPIO
        openrisc: default GENERIC_GPIO to false
        avr32: default GENERIC_GPIO to false
        xtensa: remove explicit selection of GENERIC_GPIO
        sh: replace CONFIG_GENERIC_GPIO by CONFIG_GPIOLIB
        powerpc: remove redundant GENERIC_GPIO selection
        unicore32: default GENERIC_GPIO to false
        unicore32: remove unneeded select GENERIC_GPIO
        arm: plat-orion: use GPIO driver on CONFIG_GPIOLIB
        arm: remove redundant GENERIC_GPIO selection
        mips: alchemy: require gpiolib
        mips: txx9: change GENERIC_GPIO to GPIOLIB
        mips: loongson: use GPIO driver on CONFIG_GPIOLIB
        mips: remove redundant GENERIC_GPIO select
      5647ac0a
    • L
      Merge branch 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma · 1763e735
      Linus Torvalds 提交于
      Pull slave-dmaengine updates from Vinod Koul:
       "This time we have dmatest improvements from Andy along with dw_dmac
        fixes.  He has also done support for acpi for dmanegine.
      
        Also we have bunch of fixes going in DT support for dmanegine for
        various folks.  Then Haswell and other ioat changes from Dave and
        SUDMAC support from Shimoda."
      
      * 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma: (53 commits)
        dma: tegra: implement suspend/resume callbacks
        dma:of: Use a mutex to protect the of_dma_list
        dma: of: Fix of_node reference leak
        dmaengine: sirf: move driver init from module_init to subsys_initcall
        sudmac: add support for SUDMAC
        dma: sh: add Kconfig
        at_hdmac: move to generic DMA binding
        ioatdma: ioat3_alloc_sed can be static
        ioatdma: Adding write back descriptor error status support for ioatdma 3.3
        ioatdma: S1200 platforms ioatdma channel 2 and 3 falsely advertise RAID cap
        ioatdma: Adding support for 16 src PQ ops and super extended descriptors
        ioatdma: Removing hw bug workaround for CB3.x .2 and earlier
        dw_dmac: add ACPI support
        dmaengine: call acpi_dma_request_slave_channel as well
        dma: acpi-dma: introduce ACPI DMA helpers
        dma: of: Remove unnecessary list_empty check
        DMA: OF: Check properties value before running be32_to_cpup() on it
        DMA: of: Constant names
        ioatdma: skip silicon bug workaround for pq_align for cb3.3
        ioatdma: Removing PQ val disable for cb3.3
        ...
      1763e735
    • L
      Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux · b29bdba5
      Linus Torvalds 提交于
      Pull thermal management update from Zhang Rui:
       "The most important one is to build thermal core and governor and cpu
        cooling code into one module.  This fixes a regression that thermal
        core does not work if it is built as module, since 3.7.  I'll backport
        them to stable kernel once those changes are in upstream.
      
        The largest batch is the thermal kernel-doc & coding style
        updates/cleanups from Eduardo.
      
        Highlights:
      
         - build all thermal framework code into one module to fix a
           regression that thermal does not work if it is built as module.
      
         - Marvell Armada 370/XP thermal sensor driver
      
         - thermal core/cpu cooling kernel-doc & coding style updates and
           cleanups.
      
         - Add Eduardo Valentin as thermal sub-maintainer, both in mailing
           list and patchwork.  He will help me on arm thermal drivers."
      
      * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux: (68 commits)
        thermal: db8500_cpufreq_cooling: remove usage of IS_ERR_OR_NULL()
        thermal: thermal_core: remove usage of IS_ERR_OR_NULL
        thermal: cpu_cooling: improve line breaking
        thermal: cpu_cooling: alignment improvements
        thermal: cpu_cooling: remove checkpatch.pl warning
        thermal: cpu_cooling: remove trailing blank line
        thermal: cpu_cooling: align on open parenthesis
        thermal: cpu_cooling: standardize comment style
        thermal: cpu_cooling: standardize end of function
        thermal: cpu_cooling: remove trailing white spaces
        Thermal: update documentation for thermal_zone_device_register
        thermal: update kernel-doc for thermal_zone_device_register
        thermal: update kernel-doc for create_trip_attrs
        thermal: update kernel-doc for thermal_cooling_device_register
        thermal: update kernel-doc for thermal_zone_unbind_cooling_device
        thermal: update kernel-doc for thermal_zone_bind_cooling_device
        thermal: use EXPORT_SYMBOL_GPL
        thermal: rename notify_thermal_framework to thermal_notify_framework
        thermal: update driver license
        thermal: use strlcpy instead of strcpy
        ...
      b29bdba5
  2. 09 5月, 2013 11 次提交
    • S
      EDAC: Don't give write permission to read-only files · c8c64d16
      Srivatsa S. Bhat 提交于
      I get the following warning on boot:
      
      ------------[ cut here ]------------
      WARNING: at drivers/base/core.c:575 device_create_file+0x9a/0xa0()
      Hardware name:  -[8737R2A]-
      Write permission without 'store'
      ...
      </snip>
      
      Drilling down, this is related to dynamic channel ce_count attribute
      files sporting a S_IWUSR mode without a ->store() function. Looking
      around, it appears that they aren't supposed to have a ->store()
      function. So remove the bogus write permission to get rid of the
      warning.
      Signed-off-by: NSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
      Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
      Cc: <stable@vger.kernel.org> # 3.[89]
      [ shorten commit message ]
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      c8c64d16
    • G
      watchdog: Fix race condition in registration code · 60403f7a
      Guenter Roeck 提交于
      A race condition exists when registering the first watchdog device.
      Sequence of events:
      
      - watchdog_register_device calls watchdog_dev_register
      - watchdog_dev_register creates the watchdog misc device by calling
        misc_register.
        At that time, the matching character device (/dev/watchdog0) does not yet
        exist, and old_wdd is not set either.
      - Userspace gets an event and opens /dev/watchdog
      - watchdog_open is called and sets wdd = old_wdd, which is still NULL,
        and tries to dereference it. This causes the kernel to panic.
      
      Seen with systemd trying to open /dev/watchdog immediately after
      it was created.
      Reported-by: NArkadiusz Miskiewicz <arekm@maven.pl>
      Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
      Tested-by: NArkadiusz Miskiewicz <arekm@maven.pl>
      Signed-off-by: NWim Van Sebroeck <wim@iguana.be>
      60403f7a
    • S
      watchdog: Convert to devm_ioremap_resource() · 6330c707
      Sachin Kamat 提交于
      Use the newly introduced devm_ioremap_resource() instead of
      devm_request_and_ioremap() which provides more consistent error handling.
      
      devm_ioremap_resource() provides its own error messages; so all explicit
      error messages can be removed from the failure code paths.
      Signed-off-by: NSachin Kamat <sachin.kamat@linaro.org>
      Reviewed-by: NThierry Reding <thierry.reding@avionic-design.de>
      Cc: Gabor Juhos <juhosg@openwrt.org>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Signed-off-by: NWim Van Sebroeck <wim@iguana.be>
      6330c707
    • L
      Merge tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband · e0fd9aff
      Linus Torvalds 提交于
      Pull InfiniBand/RDMA changes from Roland Dreier:
       - XRC transport fixes
       - Fix DHCP on IPoIB
       - mlx4 preparations for flow steering
       - iSER fixes
       - miscellaneous other fixes
      
      * tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband: (23 commits)
        IB/iser: Add support for iser CM REQ additional info
        IB/iser: Return error to upper layers on EAGAIN registration failures
        IB/iser: Move informational messages from error to info level
        IB/iser: Add module version
        mlx4_core: Expose a few helpers to fill DMFS HW strucutures
        mlx4_core: Directly expose fields of DMFS HW rule control segment
        mlx4_core: Change a few DMFS fields names to match firmare spec
        mlx4: Match DMFS promiscuous field names to firmware spec
        mlx4_core: Move DMFS HW structs to common header file
        IB/mlx4: Set link type for RAW PACKET QPs in the QP context
        IB/mlx4: Disable VLAN stripping for RAW PACKET QPs
        mlx4_core: Reduce warning message for SRQ_LIMIT event to debug level
        RDMA/iwcm: Don't touch cmid after dropping reference
        IB/qib: Correct qib_verbs_register_sysfs() error handling
        IB/ipath: Correct ipath_verbs_register_sysfs() error handling
        RDMA/cxgb4: Fix SQ allocation when on-chip SQ is disabled
        SRPT: Fix odd use of WARN_ON()
        IPoIB: Fix ipoib_hard_header() return value
        RDMA: Rename random32() to prandom_u32()
        RDMA/cxgb3: Fix uninitialized variable
        ...
      e0fd9aff
    • L
      Merge tag 'arm64-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux-aarch64 · 3d15b798
      Linus Torvalds 提交于
      Pull arm64 update from Catalin Marinas:
      
       - Since drivers/irqchip/irq-gic.c no longer has dependencies on arm32
         specifics (the 'gic' branch merged), it can be enabled on arm64.
      
       - Enable arm64 support for poweroff/restart (for code under
         drivers/power/reset/).
      
       - Fixes (dts file, exception handling, bitops)
      
      * tag 'arm64-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux-aarch64:
        arm64: Treat the bitops index argument as an 'int'
        arm64: Ignore the 'write' ESR flag on cache maintenance faults
        arm64: dts: fix #address-cells for foundation-v8
        arm64: vexpress: Add support for poweroff/restart
        arm64: Enable support for the ARM GIC interrupt controller
      3d15b798
    • L
      Merge tag 'f2fs-for-v3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs · 942d33da
      Linus Torvalds 提交于
      Pull f2fs updates from Jaegeuk Kim:
       "This patch-set includes the following major enhancement patches.
         - introduce a new gloabl lock scheme
         - add tracepoints on several major functions
         - fix the overall cleaning process focused on victim selection
         - apply the block plugging to merge IOs as much as possible
         - enhance management of free nids and its list
         - enhance the readahead mode for node pages
         - address several cretical deadlock conditions
         - reduce lock_page calls
      
        The other minor bug fixes and enhancements are as follows.
         - calculation mistakes: overflow
         - bio types: READ, READA, and READ_SYNC
         - fix the recovery flow, data races, and null pointer errors"
      
      * tag 'f2fs-for-v3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: (68 commits)
        f2fs: cover free_nid management with spin_lock
        f2fs: optimize scan_nat_page()
        f2fs: code cleanup for scan_nat_page() and build_free_nids()
        f2fs: bugfix for alloc_nid_failed()
        f2fs: recover when journal contains deleted files
        f2fs: continue to mount after failing recovery
        f2fs: avoid deadlock during evict after f2fs_gc
        f2fs: modify the number of issued pages to merge IOs
        f2fs: remove useless #include <linux/proc_fs.h> as we're now using sysfs as debug entry.
        f2fs: fix inconsistent using of NM_WOUT_THRESHOLD
        f2fs: check truncation of mapping after lock_page
        f2fs: enhance alloc_nid and build_free_nids flows
        f2fs: add a tracepoint on f2fs_new_inode
        f2fs: check nid == 0 in add_free_nid
        f2fs: add REQ_META about metadata requests for submit
        f2fs: give a chance to merge IOs by IO scheduler
        f2fs: avoid frequent background GC
        f2fs: add tracepoints to debug checkpoint request
        f2fs: add tracepoints for write page operations
        f2fs: add tracepoints to debug the block allocation
        ...
      942d33da
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rkuo/linux-hexagon-kernel · 246e6a0d
      Linus Torvalds 提交于
      Pull Hexagon fixes from Richard Kuo:
       "A bug fix and a Kconfig cleanup"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rkuo/linux-hexagon-kernel:
        HEXAGON: Remove non existent reference to GENERIC_KERNEL_EXECVE & GENERIC_KERNEL_THREAD
        Hexagon: fix register used to call do_work_pending
      246e6a0d
    • C
      mm/slab: Fix crash during slab init · 956e46ef
      Chris Mason 提交于
      Commit 8a965b3b ("mm, slab_common: Fix bootstrap creation of kmalloc
      caches") introduced a regression that caused us to crash early during
      boot.  The commit was introducing ordering of slab creation, making sure
      two odd-sized slabs were created after specific powers of two sizes.
      
      But, if any of the power of two slabs were created earlier during boot,
      slabs at index 1 or 2 might not get created at all.  This patch makes
      sure none of the slabs get skipped.
      
      Tony Lindgren bisected this down to the offending commit, which really
      helped because bisect kept bringing me to almost but not quite this one.
      Signed-off-by: NChris Mason <chris.mason@fusionio.com>
      Acked-by: NChristoph Lameter <cl@linux.com>
      Acked-by: NTony Lindgren <tony@atomide.com>
      Acked-by: NSoren Brinkmann <soren.brinkmann@xilinx.com>
      Tested-by: NTetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
      Tested-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      956e46ef
    • R
    • L
      Merge branch 'for-3.10/drivers' of git://git.kernel.dk/linux-block · ebb37277
      Linus Torvalds 提交于
      Pull block driver updates from Jens Axboe:
       "It might look big in volume, but when categorized, not a lot of
        drivers are touched.  The pull request contains:
      
         - mtip32xx fixes from Micron.
      
         - A slew of drbd updates, this time in a nicer series.
      
         - bcache, a flash/ssd caching framework from Kent.
      
         - Fixes for cciss"
      
      * 'for-3.10/drivers' of git://git.kernel.dk/linux-block: (66 commits)
        bcache: Use bd_link_disk_holder()
        bcache: Allocator cleanup/fixes
        cciss: bug fix to prevent cciss from loading in kdump crash kernel
        cciss: add cciss_allow_hpsa module parameter
        drivers/block/mg_disk.c: add CONFIG_PM_SLEEP to suspend/resume functions
        mtip32xx: Workaround for unaligned writes
        bcache: Make sure blocksize isn't smaller than device blocksize
        bcache: Fix merge_bvec_fn usage for when it modifies the bvm
        bcache: Correctly check against BIO_MAX_PAGES
        bcache: Hack around stuff that clones up to bi_max_vecs
        bcache: Set ra_pages based on backing device's ra_pages
        bcache: Take data offset from the bdev superblock.
        mtip32xx: mtip32xx: Disable TRIM support
        mtip32xx: fix a smatch warning
        bcache: Disable broken btree fuzz tester
        bcache: Fix a format string overflow
        bcache: Fix a minor memory leak on device teardown
        bcache: Documentation updates
        bcache: Use WARN_ONCE() instead of __WARN()
        bcache: Add missing #include <linux/prefetch.h>
        ...
      ebb37277
    • L
      Merge branch 'for-3.10/core' of git://git.kernel.dk/linux-block · 4de13d7a
      Linus Torvalds 提交于
      Pull block core updates from Jens Axboe:
      
       - Major bit is Kents prep work for immutable bio vecs.
      
       - Stable candidate fix for a scheduling-while-atomic in the queue
         bypass operation.
      
       - Fix for the hang on exceeded rq->datalen 32-bit unsigned when merging
         discard bios.
      
       - Tejuns changes to convert the writeback thread pool to the generic
         workqueue mechanism.
      
       - Runtime PM framework, SCSI patches exists on top of these in James'
         tree.
      
       - A few random fixes.
      
      * 'for-3.10/core' of git://git.kernel.dk/linux-block: (40 commits)
        relay: move remove_buf_file inside relay_close_buf
        partitions/efi.c: replace useless kzalloc's by kmalloc's
        fs/block_dev.c: fix iov_shorten() criteria in blkdev_aio_read()
        block: fix max discard sectors limit
        blkcg: fix "scheduling while atomic" in blk_queue_bypass_start
        Documentation: cfq-iosched: update documentation help for cfq tunables
        writeback: expose the bdi_wq workqueue
        writeback: replace custom worker pool implementation with unbound workqueue
        writeback: remove unused bdi_pending_list
        aoe: Fix unitialized var usage
        bio-integrity: Add explicit field for owner of bip_buf
        block: Add an explicit bio flag for bios that own their bvec
        block: Add bio_alloc_pages()
        block: Convert some code to bio_for_each_segment_all()
        block: Add bio_for_each_segment_all()
        bounce: Refactor __blk_queue_bounce to not use bi_io_vec
        raid1: use bio_copy_data()
        pktcdvd: Use bio_reset() in disabled code to kill bi_idx usage
        pktcdvd: use bio_copy_data()
        block: Add bio_copy_data()
        ...
      4de13d7a
  3. 08 5月, 2013 23 次提交
    • J
      f2fs: cover free_nid management with spin_lock · 59bbd474
      Jaegeuk Kim 提交于
      After build_free_nids() searches free nid candidates from nat pages and
      current journal blocks, it checks all the candidates if they are allocated
      so that the nat cache has its nid with an allocated block address.
      
      In this procedure, previously we used
          list_for_each_entry_safe(fnid, next_fnid, &nm_i->free_nid_list, list).
      But, this is not covered by free_nid_list_lock, resulting in null pointer bug.
      
      This patch moves this checking routine inside add_free_nid() in order not to use
      the spin_lock.
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      59bbd474
    • H
      f2fs: optimize scan_nat_page() · 23d38844
      Haicheng Li 提交于
      When nm_i->fcnt > 2 * MAX_FREE_NIDS, stop scanning other NAT entries.
      Signed-off-by: NHaicheng Li <haicheng.li@linux.intel.com>
      [Jaegeuk Kim: fix handling the return value of add_free_nid()]
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      23d38844
    • H
      f2fs: code cleanup for scan_nat_page() and build_free_nids() · 8760952d
      Haicheng Li 提交于
      This patch does two cleanups:
      1. remove unused variable "fcnt" in build_free_nids().
      2. make scan_nat_page() as void type and remove useless variable "fcnt".
      Signed-off-by: NHaicheng Li <haicheng.li@linux.intel.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      8760952d
    • H
      f2fs: bugfix for alloc_nid_failed() · 95630cba
      Haicheng Li 提交于
      Directly drop the free_nid cache when nm_i->fcnt > 2 * MAX_FREE_NIDS
      
      Since there is NOT nmi->free_nid_list_lock spinlock protection between
      a sequential calling of alloc_nid() and alloc_nid_failed(), some other
      threads may already add new free_nid to the free_nid_list during this
      period.
      
      We need to make sure nmi->fcnt is never > 2 * MAX_FREE_NIDS.
      Signed-off-by: NHaicheng Li <haicheng.li@linux.intel.com>
      [Jaegeuk Kim: fit the coding style]
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      95630cba
    • C
      f2fs: recover when journal contains deleted files · 047184b4
      Chris Fries 提交于
      When recovering a journal file with fsync data for files that have
      been deleted, don't bail out on recovery.
      Signed-off-by: NChris Fries <C.Fries@motorola.com>
      Reviewed-by: NRussell Knize <rknize2@motorola.com>
      Reviewed-by: NJason Hrycay <jason.hrycay@motorola.com>
      [Jaegeuk Kim: fit the coding style]
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      047184b4
    • C
      f2fs: continue to mount after failing recovery · bde582b2
      Chris Fries 提交于
      When unable to roll forward the journal, we shouldn't bail out and
      not mount, we should continue to attempt the mount.  Bad recovery data
      is likely unrecoverable at this point, and requiring the user to try
      to mount again doesn't solve any issues.
      Signed-off-by: NChris Fries <C.Fries@motorola.com>
      Reviewed-by: NRussell Knize <rknize2@motorola.com>
      Reviewed-by: NJason Hrycay <jason.hrycay@motorola.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      bde582b2
    • J
      f2fs: avoid deadlock during evict after f2fs_gc · 531ad7d5
      Jaegeuk Kim 提交于
      o Deadlock case #1
      
      Thread 1:
      - writeback_sb_inodes
       - do_writepages
        - f2fs_write_data_pages
         - write_cache_pages
          - f2fs_write_data_page
           - f2fs_balance_fs
            - wait mutex_lock(gc_mutex)
      
      Thread 2:
      - f2fs_balance_fs
       - mutex_lock(gc_mutex)
       - f2fs_gc
        - f2fs_iget
         - wait iget_locked(inode->i_lock)
      
      Thread 3:
      - do_unlinkat
       - iput
        - lock(inode->i_lock)
         - evict
          - inode_wait_for_writeback
      
      o Deadlock case #2
      
      Thread 1:
      - __writeback_single_inode
       : set I_SYNC
        - do_writepages
         - f2fs_write_data_page
          - f2fs_balance_fs
           - f2fs_gc
            - iput
             - evict
              - inode_wait_for_writeback(I_SYNC)
      
      In order to avoid this, even though iput is called with the zero-reference
      count, we need to stop the eviction procedure if the inode is on writeback.
      So this patch links f2fs_drop_inode which checks the I_SYNC flag.
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      531ad7d5
    • C
      arm64: Treat the bitops index argument as an 'int' · 420c158d
      Catalin Marinas 提交于
      The bitops prototype use an 'int' as the bit index type but the asm
      implementation assume it to be a 'long'. Since the compiler does not
      guarantee zeroing the upper 32-bits in a register when used as 'int',
      change the bitops implementation accordingly.
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      420c158d
    • C
      arm64: Ignore the 'write' ESR flag on cache maintenance faults · 0e7f7bcc
      Catalin Marinas 提交于
      ESR.WnR bit is always set on data cache maintenance faults even though
      the page is not required to have write permission. If a translation
      fault (page not yet mapped) happens for read-only user address range,
      Linux incorrectly assumes a permission fault. This patch adds the check
      of the ESR.CM bit during the page fault handling to ignore the 'write'
      flag.
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      Reported-by: NTim Northover <Tim.Northover@arm.com>
      Cc: stable@vger.kernel.org
      0e7f7bcc
    • M
      arm64: dts: fix #address-cells for foundation-v8 · ed1f2363
      Mark Rutland 提交于
      Commit 90556ca1 ("arm64: vexpress: Add dts files for the ARMv8 RTSM
      models") added foundation-v8.dts, but erroneously set
      /cpus/#address-cells = <1> while providing two cells in each cpus/cpu@N
      node's reg property.
      
      As of commit ea393a2e ("arm64: smp: honour #address-size when parsing
      CPU reg property") we read in as many address cells as specified rather
      than always reading two. This means that for foundation-v8.dts, we only
      read the first reg cell (zero) for each cpu node, and receive a lot of
      warnings at boot of the form "/cpus/cpu@1: duplicate cpu reg properties
      in the DT".
      
      This patch corrects foundation-v8.dts to have the correct value for
      /cpus/#address-cells.
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Pawel Moll <pawel.moll@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Tested-by: NMarc Zyngier <marc.zyngier@arm.com>
      Acked-by: NMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      ed1f2363
    • C
      arm64: vexpress: Add support for poweroff/restart · aa1e8ec1
      Catalin Marinas 提交于
      This patch adds the arm_pm_poweroff definition expected by the
      vexpress-poweroff.c driver and enables the latter for arm64.
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      Acked-by: NPawel Moll <pawel.moll@arm.com>
      aa1e8ec1
    • C
      arm64: Enable support for the ARM GIC interrupt controller · c4188edc
      Catalin Marinas 提交于
      This patch enables ARM_GIC on the arm64 kernel.
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      c4188edc
    • C
      Merge branch 'gic' into HEAD · e6b6dc7f
      Catalin Marinas 提交于
      * arm64-prep-gic:
        irqchip: gic: Perform the gic_secondary_init() call via CPU notifier
        irqchip: gic: Call handle_bad_irq() directly
        arm: Move chained_irq_(enter|exit) to a generic file
        arm: Move the set_handle_irq and handle_arch_irq declarations to asm/irq.h
      e6b6dc7f
    • L
      Merge branch 'akpm' (incoming from Andrew) · 5af43c24
      Linus Torvalds 提交于
      Merge more incoming from Andrew Morton:
      
       - Various fixes which were stalled or which I picked up recently
      
       - A large rotorooting of the AIO code.  Allegedly to improve
         performance but I don't really have good performance numbers (I might
         have lost the email) and I can't raise Kent today.  I held this out
         of 3.9 and we could give it another cycle if it's all too late/scary.
      
      I ended up taking only the first two thirds of the AIO rotorooting.  I
      left the percpu parts and the batch completion for later.  - Linus
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (33 commits)
        aio: don't include aio.h in sched.h
        aio: kill ki_retry
        aio: kill ki_key
        aio: give shared kioctx fields their own cachelines
        aio: kill struct aio_ring_info
        aio: kill batch allocation
        aio: change reqs_active to include unreaped completions
        aio: use cancellation list lazily
        aio: use flush_dcache_page()
        aio: make aio_read_evt() more efficient, convert to hrtimers
        wait: add wait_event_hrtimeout()
        aio: refcounting cleanup
        aio: make aio_put_req() lockless
        aio: do fget() after aio_get_req()
        aio: dprintk() -> pr_debug()
        aio: move private stuff out of aio.h
        aio: add kiocb_cancel()
        aio: kill return value of aio_complete()
        char: add aio_{read,write} to /dev/{null,zero}
        aio: remove retry-based AIO
        ...
      5af43c24
    • K
      aio: don't include aio.h in sched.h · a27bb332
      Kent Overstreet 提交于
      Faster kernel compiles by way of fewer unnecessary includes.
      
      [akpm@linux-foundation.org: fix fallout]
      [akpm@linux-foundation.org: fix build]
      Signed-off-by: NKent Overstreet <koverstreet@google.com>
      Cc: Zach Brown <zab@redhat.com>
      Cc: Felipe Balbi <balbi@ti.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Mark Fasheh <mfasheh@suse.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Asai Thambi S P <asamymuthupa@micron.com>
      Cc: Selvan Mani <smani@micron.com>
      Cc: Sam Bradshaw <sbradshaw@micron.com>
      Cc: Jeff Moyer <jmoyer@redhat.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Benjamin LaHaise <bcrl@kvack.org>
      Reviewed-by: N"Theodore Ts'o" <tytso@mit.edu>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a27bb332
    • K
      aio: kill ki_retry · 41ef4eb8
      Kent Overstreet 提交于
      Thanks to Zach Brown's work to rip out the retry infrastructure, we don't
      need this anymore - ki_retry was only called right after the kiocb was
      initialized.
      
      This also refactors and trims some duplicated code, as well as cleaning up
      the refcounting/error handling a bit.
      
      [akpm@linux-foundation.org: use fmode_t in aio_run_iocb()]
      [akpm@linux-foundation.org: fix file_start_write/file_end_write tests]
      [akpm@linux-foundation.org: coding-style fixes]
      Signed-off-by: NKent Overstreet <koverstreet@google.com>
      Cc: Zach Brown <zab@redhat.com>
      Cc: Felipe Balbi <balbi@ti.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Mark Fasheh <mfasheh@suse.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Asai Thambi S P <asamymuthupa@micron.com>
      Cc: Selvan Mani <smani@micron.com>
      Cc: Sam Bradshaw <sbradshaw@micron.com>
      Cc: Jeff Moyer <jmoyer@redhat.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Benjamin LaHaise <bcrl@kvack.org>
      Reviewed-by: N"Theodore Ts'o" <tytso@mit.edu>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      41ef4eb8
    • K
      aio: kill ki_key · 8a660890
      Kent Overstreet 提交于
      ki_key wasn't actually used for anything previously - it was always 0.
      Drop it to trim struct kiocb a bit.
      Signed-off-by: NKent Overstreet <koverstreet@google.com>
      Cc: Zach Brown <zab@redhat.com>
      Cc: Felipe Balbi <balbi@ti.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Mark Fasheh <mfasheh@suse.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Asai Thambi S P <asamymuthupa@micron.com>
      Cc: Selvan Mani <smani@micron.com>
      Cc: Sam Bradshaw <sbradshaw@micron.com>
      Cc: Jeff Moyer <jmoyer@redhat.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Benjamin LaHaise <bcrl@kvack.org>
      Reviewed-by: N"Theodore Ts'o" <tytso@mit.edu>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8a660890
    • K
      aio: give shared kioctx fields their own cachelines · 4e23bcae
      Kent Overstreet 提交于
      [akpm@linux-foundation.org: make reqs_active __cacheline_aligned_in_smp]
      Signed-off-by: NKent Overstreet <koverstreet@google.com>
      Cc: Zach Brown <zab@redhat.com>
      Cc: Felipe Balbi <balbi@ti.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Mark Fasheh <mfasheh@suse.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Asai Thambi S P <asamymuthupa@micron.com>
      Cc: Selvan Mani <smani@micron.com>
      Cc: Sam Bradshaw <sbradshaw@micron.com>
      Cc: Jeff Moyer <jmoyer@redhat.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Benjamin LaHaise <bcrl@kvack.org>
      Reviewed-by: N"Theodore Ts'o" <tytso@mit.edu>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4e23bcae
    • K
      aio: kill struct aio_ring_info · 58c85dc2
      Kent Overstreet 提交于
      struct aio_ring_info was kind of odd, the only place it's used is where
      it's embedded in struct kioctx - there's no real need for it.
      
      The next patch rearranges struct kioctx and puts various things on their
      own cachelines - getting rid of struct aio_ring_info now makes that
      reordering a bit clearer.
      Signed-off-by: NKent Overstreet <koverstreet@google.com>
      Cc: Zach Brown <zab@redhat.com>
      Cc: Felipe Balbi <balbi@ti.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Mark Fasheh <mfasheh@suse.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Asai Thambi S P <asamymuthupa@micron.com>
      Cc: Selvan Mani <smani@micron.com>
      Cc: Sam Bradshaw <sbradshaw@micron.com>
      Cc: Jeff Moyer <jmoyer@redhat.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Benjamin LaHaise <bcrl@kvack.org>
      Reviewed-by: N"Theodore Ts'o" <tytso@mit.edu>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      58c85dc2
    • K
      aio: kill batch allocation · a1c8eae7
      Kent Overstreet 提交于
      Previously, allocating a kiocb required touching quite a few global
      (well, per kioctx) cachelines...  so batching up allocation to amortize
      those was worthwhile.  But we've gotten rid of some of those, and in
      another couple of patches kiocb allocation won't require writing to any
      shared cachelines, so that means we can just rip this code out.
      Signed-off-by: NKent Overstreet <koverstreet@google.com>
      Cc: Zach Brown <zab@redhat.com>
      Cc: Felipe Balbi <balbi@ti.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Mark Fasheh <mfasheh@suse.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Asai Thambi S P <asamymuthupa@micron.com>
      Cc: Selvan Mani <smani@micron.com>
      Cc: Sam Bradshaw <sbradshaw@micron.com>
      Cc: Jeff Moyer <jmoyer@redhat.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Benjamin LaHaise <bcrl@kvack.org>
      Reviewed-by: N"Theodore Ts'o" <tytso@mit.edu>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a1c8eae7
    • K
      aio: change reqs_active to include unreaped completions · 3e845ce0
      Kent Overstreet 提交于
      The aio code tries really hard to avoid having to deal with the
      completion ringbuffer overflowing.  To do that, it has to keep track of
      the number of outstanding kiocbs, and the number of completions
      currently in the ringbuffer - and it's got to check that every time we
      allocate a kiocb.  Ouch.
      
      But - we can improve this quite a bit if we just change reqs_active to
      mean "number of outstanding requests and unreaped completions" - that
      means kiocb allocation doesn't have to look at the ringbuffer, which is
      a fairly significant win.
      Signed-off-by: NKent Overstreet <koverstreet@google.com>
      Cc: Zach Brown <zab@redhat.com>
      Cc: Felipe Balbi <balbi@ti.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Mark Fasheh <mfasheh@suse.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Asai Thambi S P <asamymuthupa@micron.com>
      Cc: Selvan Mani <smani@micron.com>
      Cc: Sam Bradshaw <sbradshaw@micron.com>
      Cc: Jeff Moyer <jmoyer@redhat.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Benjamin LaHaise <bcrl@kvack.org>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      3e845ce0
    • K
      aio: use cancellation list lazily · 0460fef2
      Kent Overstreet 提交于
      Cancelling kiocbs requires adding them to a per kioctx linked list,
      which is one of the few things we need to take the kioctx lock for in
      the fast path.  But most kiocbs can't be cancelled - so if we just do
      this lazily, we can avoid quite a bit of locking overhead.
      
      While we're at it, instead of using a flag bit switch to using ki_cancel
      itself to indicate that a kiocb has been cancelled/completed.  This lets
      us get rid of ki_flags entirely.
      
      [akpm@linux-foundation.org: remove buggy BUG()]
      Signed-off-by: NKent Overstreet <koverstreet@google.com>
      Cc: Zach Brown <zab@redhat.com>
      Cc: Felipe Balbi <balbi@ti.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Mark Fasheh <mfasheh@suse.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Asai Thambi S P <asamymuthupa@micron.com>
      Cc: Selvan Mani <smani@micron.com>
      Cc: Sam Bradshaw <sbradshaw@micron.com>
      Cc: Jeff Moyer <jmoyer@redhat.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Benjamin LaHaise <bcrl@kvack.org>
      Reviewed-by: N"Theodore Ts'o" <tytso@mit.edu>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0460fef2
    • K
      aio: use flush_dcache_page() · 21b40200
      Kent Overstreet 提交于
      This wasn't causing problems before because it's not needed on x86, but
      it is needed on other architectures.
      Signed-off-by: NKent Overstreet <koverstreet@google.com>
      Cc: Zach Brown <zab@redhat.com>
      Cc: Felipe Balbi <balbi@ti.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Mark Fasheh <mfasheh@suse.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Asai Thambi S P <asamymuthupa@micron.com>
      Cc: Selvan Mani <smani@micron.com>
      Cc: Sam Bradshaw <sbradshaw@micron.com>
      Cc: Jeff Moyer <jmoyer@redhat.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Benjamin LaHaise <bcrl@kvack.org>
      Cc: Theodore Ts'o <tytso@mit.edu>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      21b40200