1. 24 Jan, 2015 1 commit
    • Mikulas Patocka's avatar
      dm: fix handling of multiple internal suspends · 96b26c8c
      Mikulas Patocka authored
      Commit ffcc3936
       ("dm: enhance internal suspend and resume interface")
      attempted to handle multiple internal suspends on the same device, but
      it did that incorrectly.  When these functions are called in this order
      on the same device the device is no longer suspended, but it should be:
      Fix this bug by maintaining an 'internal_suspend_count' and resuming
      the device when this count drops to zero.
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
  2. 23 Jan, 2015 2 commits
    • Joe Thornber's avatar
      dm cache: fix problematic dual use of a single migration count variable · a59db676
      Joe Thornber authored
      Introduce a new variable to count the number of allocated migration
      structures.  The existing variable cache->nr_migrations became
      overloaded.  It was used to:
       i) track of the number of migrations in flight for the purposes of
          quiescing during suspend.
       ii) to estimate the amount of background IO occuring.
      Recent discard changes meant that REQ_DISCARD bios are processed with
      a migration.  Discards are not background IO so nr_migrations was not
      incremented.  However this could cause quiescing to complete early.
      (i) is now handled with a new variable cache->nr_allocated_migrations.
      cache->nr_migrations has been renamed cache->nr_io_migrations.
      cleanup_migration() is now called free_io_migration(), since it
      decrements that variable.
      Also, remove the unused cache->next_migration variable that got replaced
      with with prealloc_structs a while ago.
      Signed-off-by: default avatarJoe Thornber <ejt@redhat.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      Cc: stable@vger.kernel.org
    • Joe Thornber's avatar
      dm cache: share cache-metadata object across inactive and active DM tables · 9b1cc9f2
      Joe Thornber authored
      If a DM table is reloaded with an inactive table when the device is not
      suspended (normal procedure for LVM2), then there will be two dm-bufio
      objects that can diverge.  This can lead to a situation where the
      inactive table uses bufio to read metadata at the same time the active
      table writes metadata -- resulting in the inactive table having stale
      metadata buffers once it is promoted to the active table slot.
      Fix this by using reference counting and a global list of cache metadata
      objects to ensure there is only one metadata object per metadata device.
      Signed-off-by: default avatarJoe Thornber <ejt@redhat.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      Cc: stable@vger.kernel.org
  3. 17 Dec, 2014 4 commits
    • zhendong chen's avatar
      dm: fix missed error code if .end_io isn't implemented by target_type · 5164bece
      zhendong chen authored
      In bio-based DM's clone_endio(), when target_type doesn't implement
      .end_io (e.g. linear) r will be always be initialized 0.  So if a
      WRITE SAME bio fails WRITE SAME will not be disabled as intended.
      Fix this by initializing r to error, rather than 0, in clone_endio().
      Signed-off-by: default avatarAlex Chen <alex.chen@huawei.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      Fixes: 7eee4ae2 ("dm: disable WRITE SAME if it fails")
      Cc: stable@vger.kernel.org
    • Marc Dionne's avatar
      dm thin: fix crash by initializing thin device's refcount and completion earlier · 2b94e896
      Marc Dionne authored
      Commit 80e96c54
       ("dm thin: do not allow thin device activation
      while pool is suspended") delayed the initialization of a new thin
      device's refcount and completion until after this new thin was added
      to the pool's active_thins list and the pool lock is released.  This
      opens a race with a worker thread that walks the list and calls
      thin_get/put, noticing that the refcount goes to 0 and calling
      complete, freezing up the system and giving the oops below:
       kernel: BUG: unable to handle kernel NULL pointer dereference at           (null)
       kernel: IP: [<ffffffff810d360b>] __wake_up_common+0x2b/0x90
       kernel: Call Trace:
       kernel: [<ffffffff810d3683>] __wake_up_locked+0x13/0x20
       kernel: [<ffffffff810d3dc7>] complete+0x37/0x50
       kernel: [<ffffffffa0595c50>] thin_put+0x20/0x30 [dm_thin_pool]
       kernel: [<ffffffffa059aab7>] do_worker+0x667/0x870 [dm_thin_pool]
       kernel: [<ffffffff816a8a4c>] ? __schedule+0x3ac/0x9a0
       kernel: [<ffffffff810b1aef>] process_one_work+0x14f/0x400
       kernel: [<ffffffff810b206b>] worker_thread+0x6b/0x490
       kernel: [<ffffffff810b2000>] ? rescuer_thread+0x260/0x260
       kernel: [<ffffffff810b6a7b>] kthread+0xdb/0x100
       kernel: [<ffffffff810b69a0>] ? kthread_create_on_node+0x170/0x170
       kernel: [<ffffffff816ad7ec>] ret_from_fork+0x7c/0xb0
       kernel: [<ffffffff810b69a0>] ? kthread_create_on_node+0x170/0x170
      Set the thin device's initial refcount and initialize the completion
      before adding it to the pool's active_thins list in thin_ctr().
      Signed-off-by: default avatarMarc Dionne <marc.dionne@your-file-system.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
    • Joe Thornber's avatar
      dm thin: fix missing out-of-data-space to write mode transition if blocks are released · 2c43fd26
      Joe Thornber authored
      Discard bios and thin device deletion have the potential to release data
      blocks.  If the thin-pool is in out-of-data-space mode, and blocks were
      released, transition the thin-pool back to full write mode.
      The correct time to do this is just after the thin-pool metadata commit.
      It cannot be done before the commit because the space maps will not
      allow immediate reuse of the data blocks in case there's a rollback
      following power failure.
      Signed-off-by: default avatarJoe Thornber <ejt@redhat.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      Cc: stable@vger.kernel.org
    • Joe Thornber's avatar
      dm thin: fix inability to discard blocks when in out-of-data-space mode · 45ec9bd0
      Joe Thornber authored
      When the pool was in PM_OUT_OF_SPACE mode its process_prepared_discard
      function pointer was incorrectly being set to
      process_prepared_discard_passdown rather than process_prepared_discard.
      This incorrect function pointer meant the discard was being passed down,
      but not effecting the mapping.  As such any discard that was issued, in
      an attempt to reclaim blocks, would not successfully free data space.
      Reported-by: default avatarEric Sandeen <sandeen@redhat.com>
      Signed-off-by: default avatarJoe Thornber <ejt@redhat.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      Cc: stable@vger.kernel.org
  4. 16 Dec, 2014 2 commits
  5. 15 Dec, 2014 8 commits
    • Linus Torvalds's avatar
      Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux · 988adfdf
      Linus Torvalds authored
      Pull drm updates from Dave Airlie:
         - AMD KFD driver merge
           This is the AMD HSA interface for exposing a lowlevel interface for
           GPGPU use.  They have an open source userspace built on top of this
           interface, and the code looks as good as it was going to get out of
         - Initial atomic modesetting work
           The need for an atomic modesetting interface to allow userspace to
           try and send a complete set of modesetting state to the driver has
           arisen, and been suffering from neglect this past year.  No more,
           the start of the common code and changes for msm driver to use it
           are in this tree.  Ongoing work to get the userspace ioctl finished
           and the code clean will probably wait until next kernel.
         - DisplayID 1.3 and tiled monitor exposed to userspace.
           Tiled monitor property is now exposed for userspace to make use of.
         - Rockchip drm driver merged.
         - imx gpu driver moved out of staging
        Other stuff:
         - core:
              panel - MIPI DSI + new panels.
              expose suggested x/y properties for virtual GPUs
         - i915:
              Initial Skylake (SKL) support
              gen3/4 reset work
              start of dri1/ums removal
              infoframe tracking
              fixes for lots of things.
         - nouveau:
              tegra k1 voltage support
              GM204 modesetting support
              GT21x memory reclocking work
         - radeon:
              CI dpm fixes
              GPUVM improvements
              Initial DPM fan control
         - rcar-du:
              HDMI support added
              removed some support for old boards
              slave encoder driver for Analog Devices adv7511
         - exynos:
              Exynos4415 SoC support
         - msm:
              a4xx gpu support
              atomic helper conversion
         - tegra:
              iommu support
              universal plane support
              ganged-mode DSI support
         - sti:
              HDMI i2c improvements
         - vmwgfx:
              some late fixes.
         - qxl:
              use suggested x/y properties"
      * 'drm-next' of git://people.freedesktop.org/~airlied/linux: (969 commits)
        drm: sti: fix module compilation issue
        drm/i915: save/restore GMBUS freq across suspend/resume on gen4
        drm: sti: correctly cleanup CRTC and planes
        drm: sti: add HQVDP plane
        drm: sti: add cursor plane
        drm: sti: enable auxiliary CRTC
        drm: sti: fix delay in VTG programming
        drm: sti: prepare sti_tvout to support auxiliary crtc
        drm: sti: use drm_crtc_vblank_{on/off} instead of drm_vblank_{on/off}
        drm: sti: fix hdmi avi infoframe
        drm: sti: remove event lock while disabling vblank
        drm: sti: simplify gdp code
        drm: sti: clear all mixer control
        drm: sti: remove gpio for HDMI hot plug detection
        drm: sti: allow to change hdmi ddc i2c adapter
        drm/doc: Document drm_add_modes_noedid() usage
        drm/i915: Remove '& 0xffff' from the mask given to WA_REG()
        drm/i915: Invert the mask and val arguments in wa_add() and WA_REG()
        drm: Zero out DRM object memory upon cleanup
        drm/i915/bdw: Fix the write setting up the WIZ hashing mode
    • Linus Torvalds's avatar
      x86: mm: consolidate VM_FAULT_RETRY handling · 26178ec1
      Linus Torvalds authored
      The VM_FAULT_RETRY handling was confusing and incorrect for the case of
      returning to kernel mode.  We need to handle the exception table fixup
      if we return to kernel mode due to a fatal signal - it will basically
      look to the kernel user mode access like the access failed due to the VM
      going away from udner it.  Which is correct - the process is dying - and
      avoids the whole "repeat endless kernel page faults" case.
      Handling the VM_FAULT_RETRY early and in just one place also simplifies
      the mmap_sem handling, since once we've taken care of VM_FAULT_RETRY we
      know that we can just drop the lock.  The remaining accounting and
      possible error handling is thread-local and does not need the mmap_sem.
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    • Linus Torvalds's avatar
      x86: mm: move mmap_sem unlock from mm_fault_error() to caller · 7fb08eca
      Linus Torvalds authored
      This replaces four copies in various stages of mm_fault_error() handling
      with just a single one.  It will also allow for more natural placement
      of the unlocking after some further cleanup.
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    • Jens Axboe's avatar
      Revert "blk-mq: Micro-optimize bt_get()" · 35d37c66
      Jens Axboe authored
      This reverts commit 52f7eb94
      The optimization is only really safe for a single queue, otherwise
      'bs' and 'bt' can indeed change, and if we don't do a finish_wait()
      for each loop, we'll potentially change the wait structure and
      corrupt task wait list.
      Reported-by: Jan Kara's avatarJan Kara <jack@suse.cz>
    • Benjamin Gaignard's avatar
      drm: sti: fix module compilation issue · 4e0cd681
      Benjamin Gaignard authored
      When compiling in module some symbol aren't missing,
      export them correctly.
      Signed-off-by: Benjamin Gaignard's avatarBenjamin Gaignard <benjamin.gaignard@linaro.org>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
    • Linus Torvalds's avatar
      Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security · 67e2c388
      Linus Torvalds authored
      Pull security layer updates from James Morris:
       "In terms of changes, there's general maintenance to the Smack,
        SELinux, and integrity code.
        The IMA code adds a new kconfig option, IMA_APPRAISE_SIGNED_INIT,
        which allows IMA appraisal to require signatures.  Support for reading
        keys from rootfs before init is call is also added"
      * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: (23 commits)
        selinux: Remove security_ops extern
        security: smack: fix out-of-bounds access in smk_parse_smack()
        VFS: refactor vfs_read()
        ima: require signature based appraisal
        integrity: provide a hook to load keys when rootfs is ready
        ima: load x509 certificate from the kernel
        integrity: provide a function to load x509 certificate from the kernel
        integrity: define a new function integrity_read_file()
        Security: smack: replace kzalloc with kmem_cache for inode_smack
        Smack: Lock mode for the floor and hat labels
        ima: added support for new kernel cmdline parameter ima_template_fmt
        ima: allocate field pointers array on demand in template_desc_init_fields()
        ima: don't allocate a copy of template_fmt in template_desc_init_fields()
        ima: display template format in meas. list if template name length is zero
        ima: added error messages to template-related functions
        ima: use atomic bit operations to protect policy update interface
        ima: ignore empty and with whitespaces policy lines
        ima: no need to allocate entry for comment
        ima: report policy load status
        ima: use path names cache
    • Linus Torvalds's avatar
      Merge tag 'char-misc-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · 6ae840e7
      Linus Torvalds authored
      Pull char/misc driver updates from Greg KH:
       "Here's the big char/misc driver update for 3.19-rc1
        Lots of little things all over the place in different drivers, and a
        new subsystem, "coresight" has been added.  Full details are in the
      * tag 'char-misc-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (73 commits)
        parport: parport_pc, do not remove parent devices early
        spmi: Remove shutdown/suspend/resume kernel-doc
        carma-fpga-program: drop videobuf dependency
        carma-fpga: drop videobuf dependency
        carma-fpga-program.c: fix compile errors
        i8k: Fix temperature bug handling in i8k_get_temp()
        cxl: Name interrupts in /proc/interrupt
        CXL: Return error to PSL if IRQ demultiplexing fails & print clearer warning
        coresight-replicator: remove .owner field for driver
        coresight: fixed comments in coresight.h
        coresight: fix typo in comment in coresight-priv.h
        coresight: bindings for coresight drivers
        coresight: Adding ABI documentation
        w1: support auto-load of w1_bq27000 module.
        w1: avoid potential u16 overflow
        cn: verify msg->len before making callback
        mei: export fw status registers through sysfs
        mei: read and print all six FW status registers
        mei: txe: add cherrytrail device id
        mei: kill cached host and me csr values
    • Linus Torvalds's avatar
      Merge tag 'driver-core-3.19-rc1' of... · e6b5be2b
      Linus Torvalds authored
      Merge tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
      Pull driver core update from Greg KH:
       "Here's the set of driver core patches for 3.19-rc1.
        They are dominated by the removal of the .owner field in platform
        drivers.  They touch a lot of files, but they are "simple" changes,
        just removing a line in a structure.
        Other than that, a few minor driver core and debugfs changes.  There
        are some ath9k patches coming in through this tree that have been
        acked by the wireless maintainers as they relied on the debugfs
        Everything has been in linux-next for a while"
      * tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits)
        Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries"
        fs: debugfs: add forward declaration for struct device type
        firmware class: Deletion of an unnecessary check before the function call "vunmap"
        firmware loader: fix hung task warning dump
        devcoredump: provide a one-way disable function
        device: Add dev_<level>_once variants
        ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries
        ath: use seq_file api for ath9k debugfs files
        debugfs: add helper function to create device related seq_file
        drivers/base: cacheinfo: remove noisy error boot message
        Revert "core: platform: add warning if driver has no owner"
        drivers: base: support cpu cache information interface to userspace via sysfs
        drivers: base: add cpu_device_create to support per-cpu devices
        topology: replace custom attribute macros with standard DEVICE_ATTR*
        cpumask: factor out show_cpumap into separate helper function
        driver core: Fix unbalanced device reference in drivers_probe
        driver core: fix race with userland in device_add()
        sysfs/kernfs: make read requests on pre-alloc files use the buffer.
        sysfs/kernfs: allow attributes to request write buffer be pre-allocated.
        fs: sysfs: return EGBIG on write if offset is larger than file size
  6. 14 Dec, 2014 11 commits
    • Linus Torvalds's avatar
      Merge tag 'tty-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · 37da7bbb
      Linus Torvalds authored
      Pull tty/serial driver updates from Greg KH:
       "Here's the big tty/serial driver update for 3.19-rc1.
        There are a number of TTY core changes/fixes in here from Peter Hurley
        that have all been teted in linux-next for a long time now.  There are
        also the normal serial driver updates as well, full details in the
        changelog below"
      * tag 'tty-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (219 commits)
        serial: pxa: hold port.lock when reporting modem line changes
        tty-hvsi_lib: Deletion of an unnecessary check before the function call "tty_kref_put"
        tty: Deletion of unnecessary checks before two function calls
        n_tty: Fix read_buf race condition, increment read_head after pushing data
        serial: of-serial: add PM suspend/resume support
        Revert "serial: of-serial: add PM suspend/resume support"
        Revert "serial: of-serial: fix up PM ops on no_console_suspend and port type"
        serial: 8250: don't attempt a trylock if in sysrq
        serial: core: Add big-endian iotype
        serial: samsung: use port->fifosize instead of hardcoded values
        serial: samsung: prefer to use fifosize from driver data
        serial: samsung: fix style problems
        serial: samsung: wait for transfer completion before clock disable
        serial: icom: fix error return code
        serial: tegra: clean up tty-flag assignments
        serial: Fix io address assign flow with Fintek PCI-to-UART Product
        serial: mxs-auart: fix tx_empty against shift register
        serial: mxs-auart: fix gpio change detection on interrupt
        serial: mxs-auart: Fix mxs_auart_set_ldisc()
        serial: 8250_dw: Use 64-bit access for OCTEON.
    • Linus Torvalds's avatar
      Merge tag 'usb-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · e7cf773d
      Linus Torvalds authored
      Pull USB updates from Greg KH:
       "Here's the big set of USB and PHY patches for 3.19-rc1.
        The normal churn in the USB gadget area is in here, as well as xhci
        and other individual USB driver updates.  The PHY tree is also in
        here, as there were dependancies on the USB tree.
        All of these have been in linux-next"
      * tag 'usb-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (351 commits)
        arm: omap3: twl: remove usb phy init data
        usbip: fix error handling in stub_probe()
        usb: gadget: udc: missing curly braces
        USB: mos7720: delete some unneeded code
        wusb: replace memset by memzero_explicit
        usbip: remove unneeded structure
        usb: xhci: fix comment for PORT_DEV_REMOVE
        xhci: don't use the same variable for stopped and halted rings current TD
        xhci: clear extra bits from slot context when setting max exit latency
        xhci: cleanup finish_td function
        USB: adutux: NULL dereferences on disconnect
        usb: chipidea: fix platform_no_drv_owner.cocci warnings
        usb: chipidea: Fixed a few typos in comments
        Documentation: bindings: add doc for the USB2 ChipIdea USB driver
        usb: chipidea: add a usb2 driver for ci13xxx
        usb: chipidea: fix phy handling
        usb: chipidea: remove duplicate dev_set_drvdata for host_start
        usb: chipidea: parameter 'mode' isn't needed for hw_device_reset
        usb: chipidea: add controller reset API
        usb: chipidea: remove flag CI_HDRC_REQUIRE_TRANSCEIVER
    • Linus Torvalds's avatar
      Merge tag 'squashfs-updates' of git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-next · 7a02d089
      Linus Torvalds authored
      Pull squashfs update from Phillip Lougher:
       "These patches optionally add LZ4 compression support to Squashfs.
        LZ4 is a lightweight compression algorithm which can be used on
        embedded systems to reduce CPU and memory overhead (in comparison to
        the standard zlib compression).
        These patches add the wrapper code to allow Squashfs to use the
        existing LZ4 decompression code, and the necessary configuration
      * tag 'squashfs-updates' of git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-next:
        Squashfs: Add LZ4 compression configuration option
        Squashfs: add LZ4 compression support
    • Linus Torvalds's avatar
      Merge tag 'gpio-v3.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio · 980f3c34
      Linus Torvalds authored
      Pull take two of the GPIO updates:
       "Same stuff as last time, now with a fixup patch for the previous
        compile error plus I ran a few extra rounds of compile-testing.
        This is the bulk of GPIO changes for the v3.19 series:
         - A new API that allows setting more than one GPIO at the time.  This
           is implemented for the new descriptor-based API only and makes it
           possible to e.g. toggle a clock and data line at the same time, if
           the hardware can do this with a single register write.  Both
           consumers and drivers need new calls, and the core will fall back
           to driving individual lines where needed.  Implemented for the
           MPC8xxx driver initially
         - Patched the mdio-mux-gpio and the serial mctrl driver that drives
           modems to use the new multiple-setting API to set several signals
         - Get rid of the global GPIO descriptor array, and instead allocate
           descriptors dynamically for each GPIO on a certain GPIO chip.  This
           moves us closer to getting rid of the limitation of using the
           global, static GPIO numberspace
         - New driver and device tree bindings for 74xx ICs
         - New driver and device tree bindings for the VF610 Vybrid
         - Support the RCAR r8a7793 and r8a7794
         - Guidelines for GPIO device tree bindings trying to get things a bit
           more strict with the advent of combined device properties
         - Suspend/resume support for the MVEBU driver
         - A slew of minor fixes and improvements"
      * tag 'gpio-v3.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (33 commits)
        gpio: mcp23s08: fix up compilation error
        gpio: pl061: document gpio-ranges property for bindings file
        gpio: pl061: hook request if gpio-ranges avaiable
        gpio: mcp23s08: Add option to configure IRQ output polarity as active high
        gpio: fix deferred probe detection for legacy API
        serial: mctrl_gpio: use gpiod_set_array function
        mdio-mux-gpio: Use GPIO descriptor interface and new gpiod_set_array function
        gpio: remove const modifier from gpiod_get_direction()
        gpio: remove gpio_descs global array
        gpio: mxs: implement get_direction callback
        gpio: em: Use dynamic allocation of GPIOs
        gpio: Check if base is positive before calling gpio_is_valid()
        gpio: mcp23s08: Add simple IRQ support for SPI devices
        gpio: mcp23s08: request a shared interrupt
        gpio: mcp23s08: Do not free unrequested interrupt
        gpio: rcar: Add r8a7793 and r8a7794 support
        gpio-mpc8xxx: add mpc8xxx_gpio_set_multiple function
        gpiolib: allow simultaneous setting of multiple GPIO outputs
        gpio: mvebu: add suspend/resume support
        gpio: gpio-davinci: remove duplicate check on resource
    • Linus Torvalds's avatar
      Merge git://git.kvack.org/~bcrl/aio-next · 7d22286f
      Linus Torvalds authored
      Pull aio updates from Benjamin LaHaise.
      * git://git.kvack.org/~bcrl/aio-next:
        aio: Skip timer for io_getevents if timeout=0
        aio: Make it possible to remap aio ring
    • Linus Torvalds's avatar
      Merge branch 'i2c/for-3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · 96895199
      Linus Torvalds authored
      Pull i2c updates from Wolfram Sang:
       "For 3.19, the I2C subsystem has to offer special candy this time.
        Right in time for Christmas :)
         - I2C slave framework: finally, a generic mechanism for Linux being
           an I2C slave (if the bus driver supports that).  Docs are still
           missing but will come later this cycle, the code is good enough to
         - I2C muxes represent their topology in sysfs much more detailed.
           This will help users to navigate around much easier.
         - irq population of i2c clients is now done at probe time, not device
           creation time, to have better support for deferred probing.
         - new drivers for Imagination SCB, Amlogic Meson
         - DMA support added for Freescale IMX, Renesas SHMobile
         - slightly bigger driver updates to OMAP, i801, AT91, and rk3x
           (mostly quirk handling, timing updates, and using better kernel
         - eeprom driver can now write with byte-access (very slow, but OK to
         - and the bunch of smaller fixes, cleanups, ID updates..."
      * 'i2c/for-3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (56 commits)
        i2c: sh_mobile: remove unneeded DMA mask
        i2c: rcar: add slave support
        i2c: slave-eeprom: add eeprom simulator driver
        i2c: core changes for slave support
        MAINTAINERS: add I2C dt bindings also to I2C realm
        i2c: designware: Fix falling time bindings doc
        i2c: davinci: switch to use platform_get_irq
        Documentation: i2c: Use PM ops instead of legacy suspend/resume
        i2c: sh_mobile: optimize irq entry
        i2c: pxa: add support for SCCB devices
        omap: i2c: don't check bus state IP rev3.3 and earlier
        i2c: s3c2410: Handle i2c sys_cfg register in i2c driver
        i2c: rk3x: add Kconfig dependency on COMMON_CLK
        i2c: omap: add notes related to i2c multimaster mode
        i2c: omap: don't reset controller if Arbitration Lost detected
        i2c: omap: implement workaround for handling invalid BB-bit values
        i2c: omap: cleanup register definitions
        i2c: rk3x: handle dynamic clock rate changes correctly
        i2c: at91: enable probe deferring on dma channel request
        i2c: at91: remove legacy DMA support
    • Linus Torvalds's avatar
      Merge tag 'md/3.19' of git://neil.brown.name/md · 8fd9589c
      Linus Torvalds authored
      Pull md updates from Neil Brown:
       "Three fixes for md.
         I did have a largish set of locking changes queued, but late testing
        showed they weren't quite as stable as I thought and while I fixed
        what I found, I decided it safer to delay them a release ...
        particularly as I'll be AFK for a few weeks.  So expect a larger batch
        next time :-)"
      * tag 'md/3.19' of git://neil.brown.name/md:
        md: Check MD_RECOVERY_RUNNING as well as ->sync_thread.
        md: fix semicolon.cocci warnings
        md/raid5: fetch_block must fetch all the blocks handle_stripe_dirtying wants.
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 536e89ee
      Linus Torvalds authored
      Pull x86 fixes from Ingo Molnar:
       "Misc fixes (mainly Andy's TLS fixes), plus a cleanup"
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/tls: Disallow unusual TLS segments
        x86/tls: Validate TLS entries to protect espfix
        MAINTAINERS: Add me as x86 VDSO submaintainer
        x86/asm: Unify segment selector defines
        x86/asm: Guard against building the 32/64-bit versions of the asm-offsets*.c file directly
        x86_64, switch_to(): Load TLS descriptors before switching DS and ES
        x86/mm: Use min() instead of min_t() in the e820 printout code
        x86/mm: Fix zone ranges boot printout
        x86/doc: Update documentation after file shuffling
    • Andy Lutomirski's avatar
      x86/tls: Disallow unusual TLS segments · 0e58af4e
      Andy Lutomirski authored and Ingo Molnar's avatar Ingo Molnar committed
      Users have no business installing custom code segments into the
      GDT, and segments that are not present but are otherwise valid
      are a historical source of interesting attacks.
      For completeness, block attempts to set the L bit.  (Prior to
      this patch, the L bit would have been silently dropped.)
      This is an ABI break.  I've checked glibc, musl, and Wine, and
      none of them look like they'll have any trouble.
      Note to stable maintainers: this is a hardening patch that fixes
      no known bugs.  Given the possibility of ABI issues, this
      probably shouldn't be backported quickly.
      Signed-off-by: default avatarAndy Lutomirski <luto@amacapital.net>
      Acked-by: default avatarH. Peter Anvin <hpa@zytor.com>
      Cc: stable@vger.kernel.org # optional
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: security@kernel.org <security@kernel.org>
      Cc: Willy Tarreau <w@1wt.eu>
      Signed-off-by: Ingo Molnar's avatarIngo Molnar <mingo@kernel.org>
    • Andy Lutomirski's avatar
      x86/tls: Validate TLS entries to protect espfix · 41bdc785
      Andy Lutomirski authored and Ingo Molnar's avatar Ingo Molnar committed
      Installing a 16-bit RW data segment into the GDT defeats espfix.
      AFAICT this will not affect glibc, Wine, or dosemu at all.
      Signed-off-by: default avatarAndy Lutomirski <luto@amacapital.net>
      Acked-by: default avatarH. Peter Anvin <hpa@zytor.com>
      Cc: stable@vger.kernel.org
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: security@kernel.org <security@kernel.org>
      Cc: Willy Tarreau <w@1wt.eu>
      Signed-off-by: Ingo Molnar's avatarIngo Molnar <mingo@kernel.org>
    • Andy Lutomirski's avatar
  7. 13 Dec, 2014 12 commits
    • Fam Zheng's avatar
      aio: Skip timer for io_getevents if timeout=0 · 5f785de5
      Fam Zheng authored
      In this case, it is basically a polling. Let's not involve timer at all
      because that would hurt performance for application event loops.
      In an arbitrary test I've done, io_getevents syscall elapsed time
      reduces from 50000+ nanoseconds to a few hundereds.
      Signed-off-by: default avatarFam Zheng <famz@redhat.com>
      Signed-off-by: default avatarBenjamin LaHaise <bcrl@kvack.org>
    • Pavel Emelyanov's avatar
      aio: Make it possible to remap aio ring · e4a0d3e7
      Pavel Emelyanov authored
      There are actually two issues this patch addresses. Let me start with
      the one I tried to solve in the beginning.
      So, in the checkpoint-restore project (criu) we try to dump tasks'
      state and restore one back exactly as it was. One of the tasks' state
      bits is rings set up with io_setup() call. There's (almost) no problems
      in dumping them, there's a problem restoring them -- if I dump a task
      with aio ring originally mapped at address A, I want to restore one
      back at exactly the same address A. Unfortunately, the io_setup() does
      not allow for that -- it mmaps the ring at whatever place mm finds
      appropriate (it calls do_mmap_pgoff() with zero address and without
      the MAP_FIXED flag).
      To make restore possible I'm going to mremap() the freshly created ring
      into the address A (under which it was seen before dump). The problem is
      that the ring's virtual address is passed back to the user-space as the
      context ID and this ID is then used as search key by all the other io_foo()
      calls. Reworking this ID to be just some integer doesn't seem to work, as
      this value is already used by libaio as a pointer using which this library
      accesses memory for aio meta-data.
      So, to make restore work we need to make sure that
      a) ring is mapped at desired virtual address
      b) kioctx->user_id matches this value
      Having said that, the patch makes mremap() on aio region update the
      kioctx's user_id and mmap_base values.
      Here appears the 2nd issue I mentioned in the beginning of this mail.
      If (regardless of the C/R dances I do) someone creates an io context
      with io_setup(), then mremap()-s the ring and then destroys the context,
      the kill_ioctx() routine will call munmap() on wrong (old) address.
      This will result in a) aio ring remaining in memory and b) some other
      vma get unexpectedly unmapped.
      What do you think?
      Signed-off-by: default avatarPavel Emelyanov <xemul@parallels.com>
      Acked-by: default avatarDmitry Monakhov <dmonakhov@openvz.org>
      Signed-off-by: default avatarBenjamin LaHaise <bcrl@kvack.org>
    • Linus Torvalds's avatar
      Merge branch 'for-3.19/drivers' of git://git.kernel.dk/linux-block · 9ea18f8c
      Linus Torvalds authored
      Pull block layer driver updates from Jens Axboe:
       - NVMe updates:
              - The blk-mq conversion from Matias (and others)
              - A stack of NVMe bug fixes from the nvme tree, mostly from Keith.
              - Various bug fixes from me, fixing issues in both the blk-mq
                conversion and generic bugs.
              - Abort and CPU online fix from Sam.
              - Hot add/remove fix from Indraneel.
       - A couple of drbd fixes from the drbd team (Andreas, Lars, Philipp)
       - With the generic IO stat accounting from 3.19/core, converting md,
         bcache, and rsxx to use those.  From Gu Zheng.
       - Boundary check for queue/irq mode for null_blk from Matias.  Fixes
         cases where invalid values could be given, causing the device to hang.
       - The xen blkfront pull request, with two bug fixes from Vitaly.
      * 'for-3.19/drivers' of git://git.kernel.dk/linux-block: (56 commits)
        NVMe: fix race condition in nvme_submit_sync_cmd()
        NVMe: fix retry/error logic in nvme_queue_rq()
        NVMe: Fix FS mount issue (hot-remove followed by hot-add)
        NVMe: fix error return checking from blk_mq_alloc_request()
        NVMe: fix freeing of wrong request in abort path
        xen/blkfront: remove redundant flush_op
        xen/blkfront: improve protection against issuing unsupported REQ_FUA
        NVMe: Fix command setup on IO retry
        null_blk: boundary check queue_mode and irqmode
        block/rsxx: use generic io stats accounting functions to simplify io stat accounting
        md: use generic io stats accounting functions to simplify io stat accounting
        drbd: use generic io stats accounting functions to simplify io stat accounting
        md/bcache: use generic io stats accounting functions to simplify io stat accounting
        NVMe: Update module version major number
        NVMe: fail pci initialization if the device doesn't have any BARs
        NVMe: add ->exit_hctx() hook
        NVMe: make setup work for devices that don't do INTx
        NVMe: enable IO stats by default
        NVMe: nvme_submit_async_admin_req() must use atomic rq allocation
        NVMe: replace blk_put_request() with blk_mq_free_request()
    • Linus Torvalds's avatar
      Merge branch 'for-3.19/core' of git://git.kernel.dk/linux-block · caf292ae
      Linus Torvalds authored
      Pull block driver core update from Jens Axboe:
       "This is the pull request for the core block IO changes for 3.19.  Not
        a huge round this time, mostly lots of little good fixes:
         - Fix a bug in sysfs blktrace interface causing a NULL pointer
           dereference, when enabled/disabled through that API.  From Arianna
         - Various updates/fixes/improvements for blk-mq:
              - A set of updates from Bart, mostly fixing buts in the tag
              - Cleanup/code consolidation from Christoph.
              - Extend queue_rq API to be able to handle batching issues of IO
                requests. NVMe will utilize this shortly. From me.
              - A few tag and request handling updates from me.
              - Cleanup of the preempt handling for running queues from Paolo.
              - Prevent running of unmapped hardware queues from Ming Lei.
              - Move the kdump memory limiting check to be in the correct
                location, from Shaohua.
              - Initialize all software queues at init time from Takashi. This
                prevents a kobject warning when CPUs are brought online that
                weren't online when a queue was registered.
         - Single writeback fix for I_DIRTY clearing from Tejun.  Queued with
           the core IO changes, since it's just a single fix.
         - Version X of the __bio_add_page() segment addition retry from
           Maurizio.  Hope the Xth time is the charm.
         - Documentation fixup for IO scheduler merging from Jan.
         - Introduce (and use) generic IO stat accounting helpers for non-rq
           drivers, from Gu Zheng.
         - Kill off artificial limiting of max sectors in a request from
      * 'for-3.19/core' of git://git.kernel.dk/linux-block: (26 commits)
        bio: modify __bio_add_page() to accept pages that don't start a new segment
        blk-mq: Fix uninitialized kobject at CPU hotplugging
        blktrace: don't let the sysfs interface remove trace from running list
        blk-mq: Use all available hardware queues
        blk-mq: Micro-optimize bt_get()
        blk-mq: Fix a race between bt_clear_tag() and bt_get()
        blk-mq: Avoid that __bt_get_word() wraps multiple times
        blk-mq: Fix a use-after-free
        blk-mq: prevent unmapped hw queue from being scheduled
        blk-mq: re-check for available tags after running the hardware queue
        blk-mq: fix hang in bt_get()
        blk-mq: move the kdump check to blk_mq_alloc_tag_set
        blk-mq: cleanup tag free handling
        blk-mq: use 'nr_cpu_ids' as highest CPU ID count for hwq <-> cpu map
        blk: introduce generic io stat accounting help function
        blk-mq: handle the single queue case in blk_mq_hctx_next_cpu
        genhd: check for int overflow in disk_expand_part_tbl()
        blk-mq: add blk_mq_free_hctx_request()
        blk-mq: export blk_mq_free_request()
        blk-mq: use get_cpu/put_cpu instead of preempt_disable/preempt_enable
    • Linus Torvalds's avatar
      Merge tag 'trace-seq-buf-3.19-v2' of... · 8f4385d5
      Linus Torvalds authored
      Merge tag 'trace-seq-buf-3.19-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
      Pull tracing fixlet from Steven Rostedt:
       "Remove unnecessary preempt_disable in printk()"
      * tag 'trace-seq-buf-3.19-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        printk: Do not disable preemption for accessing printk_func
    • Linus Torvalds's avatar
      Merge tag 'trace-fixes-v3.18' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · 52bb4525
      Linus Torvalds authored
      Pull tracing fixes from Steven Rostedt:
       "Here's two fixes:
        1) Discovered by Fengguang Wu's tests.  I changed the parameters to
           the function graph x86 prepare_ftrace_return call but forgot to
           update the call from entry_32 (i386 version).  This patch corrects
        2) I was tracing some code and found that the sched_switch tracepoint
           was showing tasks in the INTERRUPTIBLE state as RUNNING.  This was
           due to the updates to convert preempt_count into a per_cpu
           variable.  The tracepoint logic was made to use the tasks
           saved_preempt_count which could hold a stale "PREEMPT_ACTIVE",
           instead of using the current preempt_count() call"
      * tag 'trace-fixes-v3.18' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        tracing/sched: Check preempt_count() for current when reading task->state
        ftrace/x86: Update i386 call to prepare_ftrace_return()
    • Linus Torvalds's avatar
      Merge branch 'upstream' of git://git.infradead.org/users/pcmoore/audit · a99abce2
      Linus Torvalds authored
      Pull audit updates from Paul Moore:
       "Two small patches from the audit next branch; only one of which has
        any real significant code changes, the other is simply a MAINTAINERS
        update for audit.
        The single code patch is pretty small and rather straightforward, it
        changes the audit "version" number reported to userspace from an
        integer to a bitmap which is used to indicate the functionality of the
        running kernel.  This really doesn't have much impact on the kernel,
        but it will make life easier for the audit userspace folks.
        Thankfully we were still on a version number which allowed us to do
        this without breaking userspace"
      * 'upstream' of git://git.infradead.org/users/pcmoore/audit:
        audit: convert status version to a feature bitmap
        audit: add Paul Moore to the MAINTAINERS entry
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 · e3aa91a7
      Linus Torvalds authored
      Pull crypto update from Herbert Xu:
       - The crypto API is now documented :)
       - Disallow arbitrary module loading through crypto API.
       - Allow get request with empty driver name through crypto_user.
       - Allow speed testing of arbitrary hash functions.
       - Add caam support for ctr(aes), gcm(aes) and their derivatives.
       - nx now supports concurrent hashing properly.
       - Add sahara support for SHA1/256.
       - Add ARM64 version of CRC32.
       - Misc fixes.
      * git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (77 commits)
        crypto: tcrypt - Allow speed testing of arbitrary hash functions
        crypto: af_alg - add user space interface for AEAD
        crypto: qat - fix problem with coalescing enable logic
        crypto: sahara - add support for SHA1/256
        crypto: sahara - replace tasklets with kthread
        crypto: sahara - add support for i.MX53
        crypto: sahara - fix spinlock initialization
        crypto: arm - replace memset by memzero_explicit
        crypto: powerpc - replace memset by memzero_explicit
        crypto: sha - replace memset by memzero_explicit
        crypto: sparc - replace memset by memzero_explicit
        crypto: algif_skcipher - initialize upon init request
        crypto: algif_skcipher - removed unneeded code
        crypto: algif_skcipher - Fixed blocking recvmsg
        crypto: drbg - use memzero_explicit() for clearing sensitive data
        crypto: drbg - use MODULE_ALIAS_CRYPTO
        crypto: include crypto- module prefix in template
        crypto: user - add MODULE_ALIAS
        crypto: sha-mb - remove a bogus NULL check
        crytpo: qat - Fix 64 bytes requests
    • Linus Torvalds's avatar
      Merge branch 'akpm' (second patch-bomb from Andrew) · 78a45c6f
      Linus Torvalds authored
      Merge second patchbomb from Andrew Morton:
       - the rest of MM
       - misc fs fixes
       - add execveat() syscall
       - new ratelimit feature for fault-injection
       - decompressor updates
       - ipc/ updates
       - fallocate feature creep
       - fsnotify cleanups
       - a few other misc things
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (99 commits)
        cgroups: Documentation: fix trivial typos and wrong paragraph numberings
        parisc: percpu: update comments referring to __get_cpu_var
        percpu: update local_ops.txt to reflect this_cpu operations
        percpu: remove __get_cpu_var and __raw_get_cpu_var macros
        fsnotify: remove destroy_list from fsnotify_mark
        fsnotify: unify inode and mount marks handling
        fallocate: create FAN_MODIFY and IN_MODIFY events
        mm/cma: make kmemleak ignore CMA regions
        slub: fix cpuset check in get_any_partial
        slab: fix cpuset check in fallback_alloc
        shmdt: use i_size_read() instead of ->i_size
        ipc/shm.c: fix overly aggressive shmdt() when calls span multiple segments
        ipc/msg: increase MSGMNI, remove scaling
        ipc/sem.c: increase SEMMSL, SEMMNI, SEMOPM
        ipc/sem.c: change memory barrier in sem_lock() to smp_rmb()
        lib/decompress.c: consistency of compress formats for kernel image
        decompress_bunzip2: off by one in get_next_block()
        usr/Kconfig: make initrd compression algorithm selection not expert
        fault-inject: add ratelimit option
        ratelimit: add initialization macro
    • SeongJae Park's avatar
      cgroups: Documentation: fix trivial typos and wrong paragraph numberings · 29d293b6
      SeongJae Park authored
      Signed-off-by: default avatarSeongJae Park <sj38.park@gmail.com>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Tejun Heo <tj@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    • Christoph Lameter's avatar
      parisc: percpu: update comments referring to __get_cpu_var · 6ddb798f
      Christoph Lameter authored
      __get_cpu_var was removed. Update comments to refer to
      this_cpu_ptr() instead.
      Signed-off-by: default avatarChristoph Lameter <cl@linux.com>
      Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
      Cc: Tejun Heo <tj@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    • Christoph Lameter's avatar
      percpu: update local_ops.txt to reflect this_cpu operations · 7d94a82e
      Christoph Lameter authored
      Update the documentation to reflect changes due to the availability of
      this_cpu operations.
      Signed-off-by: default avatarChristoph Lameter <cl@linux.com>
      Cc: Tejun Heo <tj@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>