1. 19 Mar, 2016 2 commits
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · 814a2bf9
      Linus Torvalds authored
      Merge second patch-bomb from Andrew Morton:
      
       - a couple of hotfixes
      
       - the rest of MM
      
       - a new timer slack control in procfs
      
       - a couple of procfs fixes
      
       - a few misc things
      
       - some printk tweaks
      
       - lib/ updates, notably to radix-tree.
      
       - add my and Nick Piggin's old userspace radix-tree test harness to
         tools/testing/radix-tree/.  Matthew said it was a godsend during the
         radix-tree work he did.
      
       - a few code-size improvements, switching to __always_inline where gcc
         screwed up.
      
       - partially implement character sets in sscanf
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (118 commits)
        sscanf: implement basic character sets
        lib/bug.c: use common WARN helper
        param: convert some "on"/"off" users to strtobool
        lib: add "on"/"off" support to kstrtobool
        lib: update single-char callers of strtobool()
        lib: move strtobool() to kstrtobool()
        include/linux/unaligned: force inlining of byteswap operations
        include/uapi/linux/byteorder, swab: force inlining of some byteswap operations
        include/asm-generic/atomic-long.h: force inlining of some atomic_long operations
        usb: common: convert to use match_string() helper
        ide: hpt366: convert to use match_string() helper
        ata: hpt366: convert to use match_string() helper
        power: ab8500: convert to use match_string() helper
        power: charger_manager: convert to use match_string() helper
        drm/edid: convert to use match_string() helper
        pinctrl: convert to use match_string() helper
        device property: convert to use match_string() helper
        lib/string: introduce match_string() helper
        radix-tree tests: add test for radix_tree_iter_next
        radix-tree tests: add regression3 test
        ...
      814a2bf9
    • Linus Torvalds's avatar
      Merge branch 'for-4.6/drivers' of git://git.kernel.dk/linux-block · 237045fc
      Linus Torvalds authored
      Pull block driver updates from Jens Axboe:
       "This is the block driver pull request for this merge window.  It sits
        on top of for-4.6/core, that was just sent out.
      
        This contains:
      
         - A set of fixes for lightnvm.  One from Alan, fixing an overflow,
           and the rest from the usual suspects, Javier and Matias.
      
         - A set of fixes for nbd from Markus and Dan, and a fixup from Arnd
           for correct usage of the signed 64-bit divider.
      
         - A set of bug fixes for the Micron mtip32xx, from Asai.
      
         - A fix for the brd discard handling from Bart.
      
         - Update the maintainers entry for cciss, since that hardware has
           transferred ownership.
      
         - Three bug fixes for bcache from Eric Wheeler.
      
         - Set of fixes for xen-blk{back,front} from Jan and Konrad.
      
         - Removal of the cpqarray driver.  It has been disabled in Kconfig
           since 2013, and we were initially scheduled to remove it in 3.15.
      
         - Various updates and fixes for NVMe, with the most important being:
      
              - Removal of the per-device NVMe thread, replacing that with a
                watchdog timer instead. From Christoph.
      
              - Exposing the namespace WWID through sysfs, from Keith.
      
              - Set of cleanups from Ming Lin.
      
              - Logging the controller device name instead of the underlying
                PCI device name, from Sagi.
      
              - And a bunch of fixes and optimizations from the usual suspects
                in this area"
      
      * 'for-4.6/drivers' of git://git.kernel.dk/linux-block: (49 commits)
        NVMe: Expose ns wwid through single sysfs entry
        drivers:block: cpqarray clean up
        brd: Fix discard request processing
        cpqarray: remove it from the kernel
        cciss: update MAINTAINERS
        NVMe: Remove unused sq_head read in completion path
        bcache: fix cache_set_flush() NULL pointer dereference on OOM
        bcache: cleaned up error handling around register_cache()
        bcache: fix race of writeback thread starting before complete initialization
        NVMe: Create discard zero quirk white list
        nbd: use correct div_s64 helper
        mtip32xx: remove unneeded variable in mtip_cmd_timeout()
        lightnvm: generalize rrpc ppa calculations
        lightnvm: remove struct nvm_dev->total_blocks
        lightnvm: rename ->nr_pages to ->nr_sects
        lightnvm: update closed list outside of intr context
        xen/blback: Fit the important information of the thread in 17 characters
        lightnvm: fold get bb tbl when using dual/quad plane mode
        lightnvm: fix up nonsensical configure overrun checking
        xen-blkback: advertise indirect segment support earlier
        ...
      237045fc
  2. 18 Mar, 2016 24 commits
    • Linus Torvalds's avatar
      Merge branch 'for-4.6/core' of git://git.kernel.dk/linux-block · 35d88d97
      Linus Torvalds authored
      Pull core block updates from Jens Axboe:
       "Here are the core block changes for this merge window.  Not a lot of
        exciting stuff going on in this round, most of the changes have been
        on the driver side of things.  That pull request is coming next.  This
        pull request contains:
      
         - A set of fixes for chained bio handling from Christoph.
      
         - A tag bounds check for blk-mq from Hannes, ensuring that we don't
           do something stupid if a device reports an invalid tag value.
      
         - A set of fixes/updates for the CFQ IO scheduler from Jan Kara.
      
         - A set of blk-mq fixes from Keith, adding support for dynamic
           hardware queues, and fixing init of max_dev_sectors for stacking
           devices.
      
         - A fix for the dynamic hw context from Ming.
      
         - Enabling of cgroup writeback support on a block device, from
           Shaohua"
      
      * 'for-4.6/core' of git://git.kernel.dk/linux-block:
        blk-mq: add bounds check on tag-to-rq conversion
        block: bio_remaining_done() isn't unlikely
        block: cleanup bio_endio
        block: factor out chained bio completion
        block: don't unecessarily clobber bi_error for chained bios
        block-dev: enable writeback cgroup support
        blk-mq: Fix NULL pointer updating nr_requests
        blk-mq: mark request queue as mq asap
        block: Initialize max_dev_sectors to 0
        blk-mq: dynamic h/w context count
        cfq-iosched: Allow parent cgroup to preempt its child
        cfq-iosched: Allow sync noidle workloads to preempt each other
        cfq-iosched: Reorder checks in cfq_should_preempt()
        cfq-iosched: Don't group_idle if cfqq has big thinktime
      35d88d97
    • Linus Torvalds's avatar
      Merge tag 'usb-4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 040e3abb
      Linus Torvalds authored
      Pull USB fixes from Greg KH:
       "Here is a USB fix for the reported issue with commit 69bec725
        ("USB: core: let USB device know device node") as well as some other
        issues that have been reported so far with this merge window"
      
      * tag 'usb-4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
        USB: uas: Reduce can_queue to MAX_CMNDS
        USB: cdc-acm: more sanity checking
        USB: usb_driver_claim_interface: add sanity checking
        usb/core: usb_alloc_dev(): fix setting of ->portnum
        USB: iowarrior: fix oops with malicious USB descriptors
      040e3abb
    • Linus Torvalds's avatar
      Merge tag 'for-linus-4.6' of git://git.code.sf.net/p/openipmi/linux-ipmi · f7813ad5
      Linus Torvalds authored
      Pull IPMI updates from Corey Minyard:
       "Just some minor fixes, nothing big"
      
      * tag 'for-linus-4.6' of git://git.code.sf.net/p/openipmi/linux-ipmi:
        ipmi: do not probe ACPI devices if si_tryacpi is unset
        ipmi_si: Avoid a wrong long timeout on transaction done
        ipmi_si: Fix module parameter doc names
        ipmi_ssif: Fix logic around alert handling
      f7813ad5
    • Linus Torvalds's avatar
      Merge tag 'mfd-for-linus-4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd · 12e7b0a6
      Linus Torvalds authored
      Pull MFD updates from Lee Jones:
       "New Drivers:
         - Freescale Touch Screen ADC
         - X-Powers AXP PMIC with RSB
         - TI TPS65086 Power Management IC (PMIC)
      
        New Device Support:
         - Supply device PCI IDs for Intel Broxton
      
        Fix-ups:
         - Move to clkdev_create() API; intel_quark_i2c_gpio
         - Complete re-write of TI's TPS65912 Power Management IC (PMIC)
         - Remove unnecessary function argument; axp20x
         - Separate out bus related code; axp20x
         - Coding Style changes; axp20x
         - Allow more drivers to be compiled as modules
         - Work around false positive 'used uninitialised' warning; db8500-prcmu
      
        Bug Fixes:
         - Remove do_div(); fsl-imx25-gcq
         - Fix driver init when built-in; tps65010
         - Fix clock-unregister leak; intel-lpss"
      
      * tag 'mfd-for-linus-4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (53 commits)
        mfd: intel-lpss: Pass I2C configuration via properties on BXT
        mfd: imx6sx: Add PCIe register definitions for iomuxc gpr
        mfd: ipaq-micro: Use __maybe_unused to hide pm functions
        mfd: max77686: Add max77802 to I2C device ID table
        mfd: max77686: Export OF module alias information
        mfd: max77686: Allow driver to be built as a module
        mfd: stmpe: Add the proper PWM resources
        mfd: tps65090: Set regmap config reg counts properly
        mfd: syscon: Return ENOTSUPP instead of ENOSYS when disabled
        mfd: as3711: Set regmap config reg counts properly
        mfd: rc5t583: Set regmap config reg counts properly
        gpio: tps65086: Add GPO driver for the TPS65086 PMIC
        mfd: mt6397: Add platform device ID table
        mfd: da9063: Fix missing volatile registers in the core regmap_range volatile lists
        mfd: mt6397: Add MT6323 support to MT6397 driver
        mfd: mt6397: Add support for different Slave types
        mfd: mt6397: int_con and int_status may vary in location
        dt-bindings: mfd: Add bindings for the MediaTek MT6323 PMIC
        mfd: da9062: Fix missing volatile registers in the core regmap_range volatile lists
        mfd: Add documentation for ACT8945A DT bindings
        ...
      12e7b0a6
    • Linus Torvalds's avatar
      Merge tag 'sound-4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 021f163d
      Linus Torvalds authored
      Pull sound updates from Takashi Iwai:
       "After a heavy storm by syzkaller in 4.5 cycle, we have relatively few
        changes in the core at this time while a lot of changes are found in
        the driver side, unsurprisingly.  Below are some highlights:
      
        ALSA core:
         - A few more hardening in ALSA timer codes
         - An extension of sequencer API for advertising the card / pid
         - Small fixes in compress-offload and jack layers
      
        HD-audio:
         - Dynamic PCM assignment in HDMI/DP codec; preparation for upcoming
           DP-MST support
         - Lots of code refactoring for sharing with ASoC SKL driver
         - Regression fixes for Intel HDMI/DP
         - Fixups for CX20724 codec, Lenovo AiO
      
        USB-audio:
         - Add quirk_alias option to make quirk debugging easier
         - Fixes for possible Oops by malformed firmware
      
        Firewire:
         - Add support for FW-1804 in tascam driver
         - Improvements / changes in card registration, multi stream handling,
           etc for DICE
         - Lots of code refactoring
      
        ASoC:
         - Enhancements of still ongoing topology API
         - Lots of commits for Intel Skylake support including HDMI support
         - A few Intel Atom driver updates for recent devices
         - Lots of improvements to the Renesas drivers
         - Capture support for Qualcomm drivers
         - Support for TI DaVinci DRA7xxx devices
         - New machine drivers for Freescale systems with Cirrus CODECs,
           Mediatek systems with RT5650 CODECs
         - New CPU drivers for Allwinner S/PDIF controllers
         - New CODEC drivers for Maxim MAX9867 and MAX98926 and Realtek RT5514"
      
      * tag 'sound-4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (291 commits)
        ALSA: hda - Fix mutex deadlock at HDMI/DP hotplug
        ALSA: ctl: change return value in compatibility layer so that it's the same value in core implementation
        ALSA: mixart: silence an uninitialized variable warning
        ALSA: usb-audio: Add sanity checks for endpoint accesses
        ALSA: usb-audio: Minor code cleanup in create_fixed_stream_quirk()
        ALSA: usb-audio: Fix NULL dereference in create_fixed_stream_quirk()
        ALSA: hda - Limit i915 HDMI binding only for HSW and later
        ALSA: hda - Fix unconditional GPIO toggle via automute
        ALSA: mixart: silence unitialized variable warnings
        ALSA: hda - Fixes double fault in nvhdmi_chmap_cea_alloc_validate_get_type
        ALSA: intel8x0: Add clock quirk entry for AD1981B on IBM ThinkPad X41.
        ALSA: hda - Add new GPU codec ID 0x10de0082 to snd-hda
        ASoC: rsnd: add simplified module explanation
        ASoC: hdac_hdmi: Add broxton device ID
        ASoC: Intel: Bxtn: Add Broxton PCI ID
        ASoC: Intel: Skylake: Move Skylake dsp ops & loader ops
        ASoC: Intel: add dmabuffer to common sst_dsp
        ASoC: Intel: Skylake: Unstatify skl_dsp_enable_core
        ASoC: Intel: Skylake: Fix whitepsace issues
        ASoC: Intel: Skylake: Move module id defines
        ...
      021f163d
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma · 9ea44635
      Linus Torvalds authored
      Pull rdma updates from Doug Ledford:
       "Initial roundup of 4.6 merge window patches.
      
        This is the first of two pull requests.  It is the smaller request,
        but touches for more different things (this is everything but what is
        in or going into staging).  The pull request for the code in
        staging/rdma is on hold until after we decide what to do on the
        write/writev API issue and may be partially deferred until 4.7 as a
        result.
      
        Summary:
      
         - cxgb4 updates
         - nes updates
         - unification of iwarp portmapper code to core
         - add drain_cq API
         - various ib_core updates
         - minor ipoib updates
         - minor mlx4 updates
         - more significant mlx5 updates (including a minor merge conflict
           with net-next tree...merge is simple to resolve and Stephen's
           resolution was confirmed by Mellanox)
         - trivial net/9p rdma conversion
         - ocrdma RoCEv2 update
         - srpt updates"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma: (85 commits)
        iwpm: crash fix for large connections test
        iw_cxgb3: support for iWARP port mapping
        iw_cxgb4: remove port mapper related code
        iw_nes: remove port mapper related code
        iwcm: common code for port mapper
        net/9p: convert to new CQ API
        IB/mlx5: Add support for don't trap rules
        net/mlx5_core: Introduce forward to next priority action
        net/mlx5_core: Create anchor of last flow table
        iser: Accept arbitrary sg lists mapping if the device supports it
        mlx5: Add arbitrary sg list support
        IB/core: Add arbitrary sg_list support
        IB/mlx5: Expose correct max_fast_reg_page_list_len
        IB/mlx5: Make coding style more consistent
        IB/mlx5: Convert UMR CQ to new CQ API
        IB/ocrdma: Skip using unneeded intermediate variable
        IB/ocrdma: Skip using unneeded intermediate variable
        IB/ocrdma: Delete unnecessary variable initialisations in 11 functions
        IB/core: Documentation fix in the MAD header file
        IB/core: trivial prink cleanup.
        ...
      9ea44635
    • Hans de Goede's avatar
      USB: uas: Reduce can_queue to MAX_CMNDS · 55ff8cfb
      Hans de Goede authored
      The uas driver can never queue more then MAX_CMNDS (- 1) tags and tags
      are shared between luns, so there is no need to claim that we can_queue
      some random large number.
      
      Not claiming that we can_queue 65536 commands, fixes the uas driver
      failing to initialize while allocating the tag map with a "Page allocation
      failure (order 7)" error on systems which have been running for a while
      and thus have fragmented memory.
      
      Cc: stable@vger.kernel.org
      Reported-and-tested-by: default avatarYves-Alexis Perez <corsac@corsac.net>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      55ff8cfb
    • Oliver Neukum's avatar
      USB: cdc-acm: more sanity checking · 8835ba4a
      Oliver Neukum authored
      An attack has become available which pretends to be a quirky
      device circumventing normal sanity checks and crashes the kernel
      by an insufficient number of interfaces. This patch adds a check
      to the code path for quirky devices.
      Signed-off-by: default avatarOliver Neukum <ONeukum@suse.com>
      CC: stable@vger.kernel.org
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8835ba4a
    • Oliver Neukum's avatar
      USB: usb_driver_claim_interface: add sanity checking · 0b818e39
      Oliver Neukum authored
      Attacks that trick drivers into passing a NULL pointer
      to usb_driver_claim_interface() using forged descriptors are
      known. This thwarts them by sanity checking.
      Signed-off-by: default avatarOliver Neukum <ONeukum@suse.com>
      CC: stable@vger.kernel.org
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0b818e39
    • Nicolai Stange's avatar
      usb/core: usb_alloc_dev(): fix setting of ->portnum · 7222c832
      Nicolai Stange authored
      With commit 69bec725 ("USB: core: let USB device know device node"),
      the port1 argument of usb_alloc_dev() gets overwritten as follows:
      
        ... usb_alloc_dev(..., unsigned port1)
        {
          ...
          if (!parent->parent) {
            port1 = usb_hcd_find_raw_port_number(..., port1);
          }
          ...
        }
      
      Later on, this now overwritten port1 gets assigned to ->portnum:
      
        dev->portnum = port1;
      
      However, since xhci_find_raw_port_number() isn't idempotent, the
      aforementioned commit causes a number of KASAN splats like the following:
      
        BUG: KASAN: slab-out-of-bounds in xhci_find_raw_port_number+0x98/0x170
                                             at addr ffff8801d9311670
        Read of size 8 by task kworker/2:1/87
        [...]
        Workqueue: usb_hub_wq hub_event
         0000000000000188 000000005814b877 ffff8800cba17588 ffffffff8191447e
         0000000041b58ab3 ffffffff82a03209 ffffffff819143a2 ffffffff82a252f4
         ffff8801d93115e0 0000000000000188 ffff8801d9311628 ffff8800cba17588
        Call Trace:
         [<ffffffff8191447e>] dump_stack+0xdc/0x15e
         [<ffffffff819143a2>] ? _atomic_dec_and_lock+0xa2/0xa2
         [<ffffffff814e2cd1>] ? print_section+0x61/0xb0
         [<ffffffff814e4939>] print_trailer+0x179/0x2c0
         [<ffffffff814f0d84>] object_err+0x34/0x40
         [<ffffffff814f4388>] kasan_report_error+0x2f8/0x8b0
         [<ffffffff814eb91e>] ? __slab_alloc+0x5e/0x90
         [<ffffffff812178c0>] ? __lock_is_held+0x90/0x130
         [<ffffffff814f5091>] kasan_report+0x71/0xa0
         [<ffffffff814ec082>] ? kmem_cache_alloc_trace+0x212/0x560
         [<ffffffff81d99468>] ? xhci_find_raw_port_number+0x98/0x170
         [<ffffffff814f33d4>] __asan_load8+0x64/0x70
         [<ffffffff81d99468>] xhci_find_raw_port_number+0x98/0x170
         [<ffffffff81db0105>] xhci_setup_addressable_virt_dev+0x235/0xa10
         [<ffffffff81d9ea51>] xhci_setup_device+0x3c1/0x1430
         [<ffffffff8121cddd>] ? trace_hardirqs_on+0xd/0x10
         [<ffffffff81d9fac0>] ? xhci_setup_device+0x1430/0x1430
         [<ffffffff81d9fad3>] xhci_address_device+0x13/0x20
         [<ffffffff81d2081a>] hub_port_init+0x55a/0x1550
         [<ffffffff81d28705>] hub_event+0xef5/0x24d0
         [<ffffffff81d27810>] ? hub_port_debounce+0x2f0/0x2f0
         [<ffffffff8195e1ee>] ? debug_object_deactivate+0x1be/0x270
         [<ffffffff81210203>] ? print_rt_rq+0x53/0x2d0
         [<ffffffff8121657d>] ? trace_hardirqs_off+0xd/0x10
         [<ffffffff8226acfb>] ? _raw_spin_unlock_irqrestore+0x5b/0x60
         [<ffffffff81250000>] ? irq_domain_set_hwirq_and_chip+0x30/0xb0
         [<ffffffff81256339>] ? debug_lockdep_rcu_enabled+0x39/0x40
         [<ffffffff812178c0>] ? __lock_is_held+0x90/0x130
         [<ffffffff81196877>] process_one_work+0x567/0xec0
        [...]
      
      Afterwards, xhci reports some functional errors:
      
        xhci_hcd 0000:00:14.0: ERROR: unexpected setup address command completion
                                      code 0x11.
        xhci_hcd 0000:00:14.0: ERROR: unexpected setup address command completion
                                      code 0x11.
        usb 4-3: device not accepting address 2, error -22
      
      Fix this by not overwriting the port1 argument in usb_alloc_dev(), but
      storing the raw port number as required by OF in an additional variable,
      raw_port.
      
      Fixes: 69bec725 ("USB: core: let USB device know device node")
      Signed-off-by: default avatarNicolai Stange <nicstange@gmail.com>
      Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7222c832
    • Josh Boyer's avatar
      USB: iowarrior: fix oops with malicious USB descriptors · 4ec0ef3a
      Josh Boyer authored
      The iowarrior driver expects at least one valid endpoint.  If given
      malicious descriptors that specify 0 for the number of endpoints,
      it will crash in the probe function.  Ensure there is at least
      one endpoint on the interface before using it.
      
      The full report of this issue can be found here:
      http://seclists.org/bugtraq/2016/Mar/87Reported-by: default avatarRalf Spenneberg <ralf@spenneberg.net>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarJosh Boyer <jwboyer@fedoraproject.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4ec0ef3a
    • Joe Lawrence's avatar
      ipmi: do not probe ACPI devices if si_tryacpi is unset · 9f0257b3
      Joe Lawrence authored
      Extend the tryacpi module parameter to turn off acpi_ipmi_probe such
      that hard-coded options (type, ports, address, etc.) have complete
      control over the smi_info data structures setup by the driver.
      Signed-off-by: default avatarJoe Lawrence <joe.lawrence@stratus.com>
      Signed-off-by: default avatarCorey Minyard <cminyard@mvista.com>
      9f0257b3
    • Corey Minyard's avatar
      ipmi_si: Avoid a wrong long timeout on transaction done · d9dffd2a
      Corey Minyard authored
      Under some circumstances, the IPMI state machine could return
      a call without delay option but the driver would still do a long
      delay because the result wasn't checked.  Instead of calling
      the state machine after transaction done, just go back to the
      top of the processing to start over.
      Signed-off-by: default avatarCorey Minyard <cminyard@mvista.com>
      d9dffd2a
    • Corey Minyard's avatar
      ipmi_si: Fix module parameter doc names · f813655a
      Corey Minyard authored
      Several were tryacpi instead of their actual values.
      Signed-off-by: default avatarCorey Minyard <cminyard@mvista.com>
      f813655a
    • Corey Minyard's avatar
      ipmi_ssif: Fix logic around alert handling · 21c8f915
      Corey Minyard authored
      There was a mistake in the logic, if an alert came in very quickly
      it would hang the driver.
      Signed-off-by: default avatarCorey Minyard <cminyard@mvista.com>
      21c8f915
    • Linus Torvalds's avatar
      Merge tag 'staging-4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · 9dffdb38
      Linus Torvalds authored
      Pull staging driver updates from Greg KH:
       "Here is the big staging driver pull request for 4.6-rc1.
      
        Lots of little things here, over 1600 patches or so.  Notable is all
        of the good Lustre work happening, those developers have finally woken
        up and are cleaning up their code greatly.  The Outreachy intern
        application process is also happening, which brought in another 400 or
        so patches.  Full details are in the very long shortlog.
      
        All of these have been in linux-next with no reported issues"
      
      * tag 'staging-4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (1673 commits)
        staging: lustre: fix aligments in lnet selftest
        staging: lustre: report minimum of two buffers for LNet selftest load test
        staging: lustre: test for proper errno code in lstcon_rpc_trans_abort
        staging: lustre: filter remaining extra spacing for lnet selftest
        staging: lustre: remove extra spacing when setting variable for lnet selftest
        staging: lustre: remove extra spacing of variable declartions for lnet selftest
        staging: lustre: fix spacing issues checkpatch reported in lnet selftest
        staging: lustre: remove returns in void function for lnet selftest
        staging: lustre: fix bogus lst errors for lnet selftest
        staging: netlogic: Replacing pr_err with dev_err after the call to devm_kzalloc
        staging: mt29f_spinand: Replacing pr_info with dev_info after the call to devm_kzalloc
        staging: android: ion: fix up file mode
        staging: ion: debugfs invalid gfp mask
        staging: rts5208: Replace pci_enable_device with pcim_enable_device
        Staging: ieee80211: Place constant on right side of the test.
        staging: speakup: Replace del_timer with del_timer_sync
        staging: lowmemorykiller: fix 2 checks that checkpatch complained
        staging: mt29f_spinand: Drop void pointer cast
        staging: rdma: hfi1: file_ops: Replace ALIGN with PAGE_ALIGN
        staging: rdma: hfi1: driver: Replace IS_ALIGNED with PAGE_ALIGNED
        ...
      9dffdb38
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input · 10fdfee7
      Linus Torvalds authored
      Pull input updates from Dmitry Torokhov:
       "The most notable item is addition of support for Synaptics RMI4
        protocol which is native protocol for all current Synaptics devices
        (touchscreens, touchpads).  In later releases we'll switch devices
        using HID and PS/2 protocol emulation to RMI4.
      
        You will also get:
         - BYD PS/2 touchpad protocol support for psmouse
         - MELFAS MIP4 Touchscreen driver
         - rotary encoder was moved away from legacy platform data and to
           generic device properties API, devm_* API, and can now handle
           encoders using more than 2 GPIOs
         - Cypress touchpad driver was switched to devm_* API and device
           properties
         - other assorted driver fixes"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (40 commits)
        ARM: pxa/raumfeld: use PROPERTY_ENTRY_INTEGER to define props
        Input: synaptics-rmi4 - using logical instead of bitwise AND
        Input: powermate - fix oops with malicious USB descriptors
        Input: snvs_pwrkey - fix returned value check of syscon_regmap_lookup_by_phandle()
        MAINTAINERS: add devicetree bindings to Input Drivers section
        Input: synaptics-rmi4 - add device tree support to the SPI transport driver
        Input: synaptics-rmi4 - add SPI transport driver
        Input: synaptics-rmi4 - add support for F30
        Input: synaptics-rmi4 - add support for F12
        Input: synaptics-rmi4 - add device tree support for 2d sensors and F11
        Input: synaptics-rmi4 - add support for 2D sensors and F11
        Input: synaptics-rmi4 - add device tree support for RMI4 I2C devices
        Input: synaptics-rmi4 - add I2C transport driver
        Input: synaptics-rmi4 - add support for Synaptics RMI4 devices
        Input: ad7879 - add device tree support
        Input: ad7879 - fix default x/y axis assignment
        Input: ad7879 - move header to platform_data directory
        Input: ts4800 - add hardware dependency
        Input: cyapa - fix for losing events during device power transitions
        Input: sh_keysc - remove dependency on SUPERH
        ...
      10fdfee7
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/livepatching · 0f49fc95
      Linus Torvalds authored
      Pull livepatching update from Jiri Kosina:
      
       - cleanup of module notifiers; this depends on a module.c cleanup which
         has been acked by Rusty; from Jessica Yu
      
       - small assorted fixes and MAINTAINERS update
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/livepatching:
        livepatch/module: remove livepatch module notifier
        modules: split part of complete_formation() into prepare_coming_module()
        livepatch: Update maintainers
        livepatch: Fix the error message about unresolvable ambiguity
        klp: remove CONFIG_LIVEPATCH dependency from klp headers
        klp: remove superfluous errors in asm/livepatch.h
      0f49fc95
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial · 49dc2b71
      Linus Torvalds authored
      Pull trivial tree updates from Jiri Kosina.
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial:
        drivers/rtc: broken link fix
        drm/i915 Fix typos in i915_gem_fence.c
        Docs: fix missing word in REPORTING-BUGS
        lib+mm: fix few spelling mistakes
        MAINTAINERS: add git URL for APM driver
        treewide: Fix typo in printk
      49dc2b71
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid · d66435cc
      Linus Torvalds authored
      Pull HID updates from Jiri Kosina:
      
       - functionally equivalent cleanups for wacom driver, making the code
         more readable, from Benjamin Tissoires
      
       - a bunch of improvements and fixes for thingm driver from Heiner
         Kallweit
      
       - bugfixes to out-of-bound access for generic parsing functions (which
         have been there since ever) extract() and implement(), from Dmitry
         Torokhov
      
       - a lot of added / improved device support in sony, wacom, microsoft,
         multitouch and logitech driver, from various people
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (44 commits)
        HID: microsoft: Add ID for MS Wireless Comfort Keyboard
        hid: thingm: reorder calls in thingm_probe
        HID: i2c-hid: fix OOB write in i2c_hid_set_or_send_report()
        HID: multitouch: Release all touch slots on reset_resume
        HID: usbhid: enable NO_INIT_REPORTS quirk for Semico USB Keykoard2
        HID: penmount: report only one button for PenMount 6000 USB touchscreen controller
        HID: i2c-hid: Fix suspend/resume when already runtime suspended
        HID: i2c-hid: Add hid-over-i2c name to i2c id table
        HID: multitouch: force retrieving of Win8 signature blob
        HID: Support for CMedia CM6533 HID audio jack controls
        HID: thingm: improve locking
        HID: thingm: switch to managed version of led_classdev_register
        HID: thingm: remove workqueue
        HID: corsair: fix mapping of non-keyboard usages
        HID: wacom: close the wireless receiver on remove()
        HID: wacom: cleanup input devices
        HID: wacom: reuse wacom_parse_and_register() in wireless_work
        HID: wacom: move down wireless_work()
        HID: wacom: break out parsing of device and registering of input
        HID: wacom: break out wacom_intuos_get_tool_type
        ...
      d66435cc
    • Linus Torvalds's avatar
      Merge tag 'gpio-v4.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio · 1a46712a
      Linus Torvalds authored
      Pull GPIO updates from Linus Walleij:
       "This is the bulk of GPIO changes for kernel v4.6.  There is quite a
        lot of interesting stuff going on.
      
        The patches to other subsystems and arch-wide are ACKed as far as
        possible, though I consider things like per-arch <asm/gpio.h> as
        essentially a part of the GPIO subsystem so it should not be needed.
      
        Core changes:
      
         - The gpio_chip is now a *real device*.  Until now the gpio chips
           were just piggybacking the parent device or (gasp) floating in
           space outside of the device model.
      
           We now finally make GPIO chips devices.  The gpio_chip will create
           a gpio_device which contains a struct device, and this gpio_device
           struct is kept private.  Anything that needs to be kept private
           from the rest of the kernel will gradually be moved over to the
           gpio_device.
      
         - As a result of making the gpio_device a real device, we have added
           resource management, so devm_gpiochip_add_data() will cut down on
           overhead and reduce code lines.  A huge slew of patches convert
           almost all drivers in the subsystem to use this.
      
         - Building on making the GPIO a real device, we add the first step of
           a new userspace ABI: the GPIO character device.  We take small
           steps here, so we first add a pure *information* ABI and the tool
           "lsgpio" that will list all GPIO devices on the system and all
           lines on these devices.
      
           We can now discover GPIOs properly from userspace.  We still have
           not come up with a way to actually *use* GPIOs from userspace.
      
         - To encourage people to use the character device for the future, we
           have it always-enabled when using GPIO.  The old sysfs ABI is still
           opt-in (and can be used in parallel), but is marked as deprecated.
      
           We will keep it around for the foreseeable future, but it will not
           be extended to cover ever more use cases.
      
        Cleanup:
      
         - Bjorn Helgaas removed a whole slew of per-architecture <asm/gpio.h>
           includes.
      
           This dates back to when GPIO was an opt-in feature and no shared
           library even existed: just a header file with proper prototypes was
           provided and all semantics were up to the arch to implement.  These
           patches make the GPIO chip even more a proper device and cleans out
           leftovers of the old in-kernel API here and there.
      
           Still some cruft is left but it's very little now.
      
         - There is still some clamping of return values for .get() going on,
           but we now return sane values in the vast majority of drivers and
           the errorpath is sanitized.  Some patches for powerpc, blackfin and
           unicore still drop in.
      
         - We continue to switch the ARM, MIPS, blackfin, m68k local GPIO
           implementations to use gpiochip_add_data() and cut down on code
           lines.
      
         - MPC8xxx is converted to use the generic GPIO helpers.
      
         - ATH79 is converted to use the generic GPIO helpers.
      
        New drivers:
      
         - WinSystems WS16C48
      
         - Acces 104-DIO-48E
      
         - F81866 (a F7188x variant)
      
         - Qoric (a MPC8xxx variant)
      
         - TS-4800
      
         - SPI serializers (pisosr): simple 74xx shift registers connected to
           SPI to obtain a dirt-cheap output-only GPIO expander.
      
         - Texas Instruments TPIC2810
      
         - Texas Instruments TPS65218
      
         - Texas Instruments TPS65912
      
         - X-Gene (ARM64) standby GPIO controller"
      
      * tag 'gpio-v4.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (194 commits)
        Revert "Share upstreaming patches"
        gpio: mcp23s08: Fix clearing of interrupt.
        gpiolib: Fix comment referring to gpio_*() in gpiod_*()
        gpio: pca953x: Fix pca953x_gpio_set_multiple() on 64-bit
        gpio: xgene: Fix kconfig for standby GIPO contoller
        gpio: Add generic serializer DT binding
        gpio: uapi: use 0xB4 as ioctl() major
        gpio: tps65912: fix bad merge
        Revert "gpio: lp3943: Drop pin_used and lp3943_gpio_request/lp3943_gpio_free"
        gpio: omap: drop dev field from gpio_bank structure
        gpio: mpc8xxx: Slightly update the code for better readability
        gpio: mpc8xxx: Remove *read_reg and *write_reg from struct mpc8xxx_gpio_chip
        gpio: mpc8xxx: Fixup setting gpio direction output
        gpio: mcp23s08: Add support for mcp23s18
        dt-bindings: gpio: altera: Fix altr,interrupt-type property
        gpio: add driver for MEN 16Z127 GPIO controller
        gpio: lp3943: Drop pin_used and lp3943_gpio_request/lp3943_gpio_free
        gpio: timberdale: Switch to devm_ioremap_resource()
        gpio: ts4800: Add IMX51 dependency
        gpiolib: rewrite gpiodev_add_to_list
        ...
      1a46712a
    • Linus Torvalds's avatar
      Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu · 82b666ee
      Linus Torvalds authored
      Pull m68knommu updates from Greg Ungerer:
       "The main change is the removal of the bit-rotten 68360 support.  Also
        a fix to always make the ethernet FEC platform info available"
      
      * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu:
        m68knommu: remove obsolete 68360 support
        m68knommu: fix FEC platform device registration when driver is modular
      82b666ee
    • Linus Torvalds's avatar
      Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · 588ab3f9
      Linus Torvalds authored
      Pull arm64 updates from Catalin Marinas:
       "Here are the main arm64 updates for 4.6.  There are some relatively
        intrusive changes to support KASLR, the reworking of the kernel
        virtual memory layout and initial page table creation.
      
        Summary:
      
         - Initial page table creation reworked to avoid breaking large block
           mappings (huge pages) into smaller ones.  The ARM architecture
           requires break-before-make in such cases to avoid TLB conflicts but
           that's not always possible on live page tables
      
         - Kernel virtual memory layout: the kernel image is no longer linked
           to the bottom of the linear mapping (PAGE_OFFSET) but at the bottom
           of the vmalloc space, allowing the kernel to be loaded (nearly)
           anywhere in physical RAM
      
         - Kernel ASLR: position independent kernel Image and modules being
           randomly mapped in the vmalloc space with the randomness is
           provided by UEFI (efi_get_random_bytes() patches merged via the
           arm64 tree, acked by Matt Fleming)
      
         - Implement relative exception tables for arm64, required by KASLR
           (initial code for ARCH_HAS_RELATIVE_EXTABLE added to lib/extable.c
           but actual x86 conversion to deferred to 4.7 because of the merge
           dependencies)
      
         - Support for the User Access Override feature of ARMv8.2: this
           allows uaccess functions (get_user etc.) to be implemented using
           LDTR/STTR instructions.  Such instructions, when run by the kernel,
           perform unprivileged accesses adding an extra level of protection.
           The set_fs() macro is used to "upgrade" such instruction to
           privileged accesses via the UAO bit
      
         - Half-precision floating point support (part of ARMv8.2)
      
         - Optimisations for CPUs with or without a hardware prefetcher (using
           run-time code patching)
      
         - copy_page performance improvement to deal with 128 bytes at a time
      
         - Sanity checks on the CPU capabilities (via CPUID) to prevent
           incompatible secondary CPUs from being brought up (e.g.  weird
           big.LITTLE configurations)
      
         - valid_user_regs() reworked for better sanity check of the
           sigcontext information (restored pstate information)
      
         - ACPI parking protocol implementation
      
         - CONFIG_DEBUG_RODATA enabled by default
      
         - VDSO code marked as read-only
      
         - DEBUG_PAGEALLOC support
      
         - ARCH_HAS_UBSAN_SANITIZE_ALL enabled
      
         - Erratum workaround Cavium ThunderX SoC
      
         - set_pte_at() fix for PROT_NONE mappings
      
         - Code clean-ups"
      
      * tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (99 commits)
        arm64: kasan: Fix zero shadow mapping overriding kernel image shadow
        arm64: kasan: Use actual memory node when populating the kernel image shadow
        arm64: Update PTE_RDONLY in set_pte_at() for PROT_NONE permission
        arm64: Fix misspellings in comments.
        arm64: efi: add missing frame pointer assignment
        arm64: make mrs_s prefixing implicit in read_cpuid
        arm64: enable CONFIG_DEBUG_RODATA by default
        arm64: Rework valid_user_regs
        arm64: mm: check at build time that PAGE_OFFSET divides the VA space evenly
        arm64: KVM: Move kvm_call_hyp back to its original localtion
        arm64: mm: treat memstart_addr as a signed quantity
        arm64: mm: list kernel sections in order
        arm64: lse: deal with clobbered IP registers after branch via PLT
        arm64: mm: dump: Use VA_START directly instead of private LOWEST_ADDR
        arm64: kconfig: add submenu for 8.2 architectural features
        arm64: kernel: acpi: fix ioremap in ACPI parking protocol cpu_postboot
        arm64: Add support for Half precision floating point
        arm64: Remove fixmap include fragility
        arm64: Add workaround for Cavium erratum 27456
        arm64: mm: Mark .rodata as RO
        ...
      588ab3f9
    • Linus Torvalds's avatar
      Merge tag 'linux-kselftest-4.6-rc1' of... · 3d15cfdb
      Linus Torvalds authored
      Merge tag 'linux-kselftest-4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
      
      Pull Kselftest updates from Shuah Khan:
       "This update for Kselftest adds:
      
         - A new feature to create test-specific kconfig fragments.  This
           feature helps configure Kselftests to test specific Kernel
           Configuration options as opposed to defconfig.
      
         - A new test for Media Controller API
      
         - A few fixes"
      
      * tag 'linux-kselftest-4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
        selftests: media_dcevice_test fix usage information
        selftests: media_dcevice_test fix to handle ioctl failure case
        selftests: add missing .gitignore file or entry
        Makefile: add kselftest-merge
        selftests: create test-specific kconfig fragments
        selftests: breakpoint: add step_after_suspend_test
        selftests: add a new test for Media Controller API
      3d15cfdb
  3. 17 Mar, 2016 14 commits
    • Linus Torvalds's avatar
      Merge tag 'please-pull-pstore' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux · 5cd0911a
      Linus Torvalds authored
      Pull pstore update from Tony Luck:
       "Allow ram backend to be configured with addresses above 4GB"
      
      * tag 'please-pull-pstore' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux:
        pstore: Add support for 64 Bit address space
      5cd0911a
    • Linus Torvalds's avatar
      Merge tag 'gfs2-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 · 1ca80a0a
      Linus Torvalds authored
      Pull GFS2 updates from Bob Peterson:
       "We only have six patches ready for this merge window:
      
         - Arnd Bergmann contributed a patch that fixes an uninitialized
           variable warning.
      
         - The second patch avoids a kernel panic due to referencing an iopen
           glock that may not be held, in an error path.
      
         - The third patch fixes a rounding error that caused xfs_tests direct
           IO write "fsx" tests to fail on GFS2.
      
         - The fourth patch tidies up the code path when glocks are being
           reused to recreate a dinode that was recently deleted.
      
         - The fifth reverts an ages-old patch that should no longer be
           needed, and which interfered with the transition of dinodes from
           unlinked to free.
      
         - And lastly, a patch to eliminate a function parameter that's not
           needed"
      
      * tag 'gfs2-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2:
        GFS2: Eliminate parameter non_block on gfs2_inode_lookup
        GFS2: Don't filter out I_FREEING inodes anymore
        GFS2: Prevent delete work from occurring on glocks used for create
        GFS2: Fix direct IO write rounding error
        gfs2: avoid uninitialized variable warning
        GFS2: Check if iopen is held when deleting inode
      1ca80a0a
    • Linus Torvalds's avatar
      Merge tag 'dlm-4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm · d77bed0d
      Linus Torvalds authored
      Pull dlm updates from David Teigland:
       "Previous changes introduced the use of socket error reporting for dlm
        sockets.  This set includes two fixes in how the socket error
        callbacks are used"
      
      * tag 'dlm-4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm:
        DLM: Save and restore socket callbacks properly
        DLM: Replace nodeid_to_addr with kernel_getpeername
      d77bed0d
    • Linus Torvalds's avatar
      Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 · faeb20ec
      Linus Torvalds authored
      Pull ext4 updates from Ted Ts'o:
       "Performance improvements in SEEK_DATA and xattr scalability
        improvements, plus a lot of clean ups and bug fixes"
      
      * tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (38 commits)
        ext4: clean up error handling in the MMP support
        jbd2: do not fail journal because of frozen_buffer allocation failure
        ext4: use __GFP_NOFAIL in ext4_free_blocks()
        ext4: fix compile error while opening the macro DOUBLE_CHECK
        ext4: print ext4 mount option data_err=abort correctly
        ext4: fix NULL pointer dereference in ext4_mark_inode_dirty()
        ext4: drop unneeded BUFFER_TRACE in ext4_delete_inline_entry()
        ext4: fix misspellings in comments.
        jbd2: fix FS corruption possibility in jbd2_journal_destroy() on umount path
        ext4: more efficient SEEK_DATA implementation
        ext4: cleanup handling of bh->b_state in DAX mmap
        ext4: return hole from ext4_map_blocks()
        ext4: factor out determining of hole size
        ext4: fix setting of referenced bit in ext4_es_lookup_extent()
        ext4: remove i_ioend_count
        ext4: simplify io_end handling for AIO DIO
        ext4: move trans handling and completion deferal out of _ext4_get_block
        ext4: rename and split get blocks functions
        ext4: use i_mutex to serialize unaligned AIO DIO
        ext4: pack ioend structure better
        ...
      faeb20ec
    • Linus Torvalds's avatar
      Merge tag 'configfs-for-linus' of git://git.infradead.org/users/hch/configfs · 364e8dd9
      Linus Torvalds authored
      Pull configfs updates from Christoph Hellwig:
      
       - A large patch from me to simplify setting up the list of default
         groups by actually implementing it as a list instead of an array.
      
       - a small Y2083 prep patch from Deepa Dinamani.  Probably doesn't
         matter on it's own, but it seems like he is trying to get rid of all
         CURRENT_TIME uses in file systems, which is a worthwhile goal.
      
      * tag 'configfs-for-linus' of git://git.infradead.org/users/hch/configfs:
        configfs: switch ->default groups to a linked list
        configfs: Replace CURRENT_TIME by current_fs_time()
      364e8dd9
    • Jessica Yu's avatar
      sscanf: implement basic character sets · f9310b2f
      Jessica Yu authored
      Implement basic character sets for the '%[' conversion specifier.
      
      The '%[' conversion specifier matches a nonempty sequence of characters
      from the specified set of accepted (or with '^', rejected) characters
      between the brackets.  The substring matched is to be made up of
      characters in (or not in) the set.  This is useful for matching
      substrings that are delimited by something other than spaces.
      
      This implementation differs from its glibc counterpart in the following ways:
       (1) No support for character ranges (e.g., 'a-z' or '0-9')
       (2) The hyphen '-' is not a special character
       (3) The closing bracket ']' cannot be matched
       (4) No support (yet) for discarding matching input ('%*[')
      
      The bitmap code is largely based upon sample code which was provided by
      Rasmus.
      
      The motivation for adding character set support to sscanf originally
      stemmed from the kernel livepatching project.  An ongoing patchset
      utilizes new livepatch Elf symbol and section names to store important
      metadata livepatch needs to properly apply its patches.  Such metadata
      is stored in these section and symbol names as substrings delimited by
      periods '.' and commas ','.  For example, a livepatch symbol name might
      look like this:
      
      .klp.sym.vmlinux.printk,0
      
      However, sscanf currently can only extract "substrings" delimited by
      whitespace using the "%s" specifier.  Thus for the above symbol name,
      one cannot not use sscanf() to extract substrings "vmlinux" or
      "printk", for example.  A number of discussions on the livepatch
      mailing list dealing with string parsing code for extracting these '.'
      and ',' delimited substrings eventually led to the conclusion that such
      code would be completely unnecessary if the kernel sscanf() supported
      character sets.  Thus only a single sscanf() call would be necessary to
      extract these substrings.  In addition, such an addition to sscanf()
      could benefit other areas of the kernel that might have a similar need
      in the future.
      
      [akpm@linux-foundation.org: 80-col tweaks]
      Signed-off-by: default avatarJessica Yu <jeyu@redhat.com>
      Signed-off-by: default avatarRasmus Villemoes <linux@rasmusvillemoes.dk>
      Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
      Cc: Kees Cook <keescook@chromium.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f9310b2f
    • Josh Poimboeuf's avatar
      lib/bug.c: use common WARN helper · 2553b67a
      Josh Poimboeuf authored
      The traceoff_on_warning option doesn't have any effect on s390, powerpc,
      arm64, parisc, and sh because there are two different types of WARN
      implementations:
      
      1) The above mentioned architectures treat WARN() as a special case of a
         BUG() exception.  They handle warnings in report_bug() in lib/bug.c.
      
      2) All other architectures just call warn_slowpath_*() directly.  Their
         warnings are handled in warn_slowpath_common() in kernel/panic.c.
      
      Support traceoff_on_warning on all architectures and prevent any future
      divergence by using a single common function to emit the warning.
      
      Also remove the '()' from '%pS()', because the parentheses look funky:
      
        [   45.607629] WARNING: at /root/warn_mod/warn_mod.c:17 .init_dummy+0x20/0x40 [warn_mod]()
      Reported-by: default avatarChunyu Hu <chuhu@redhat.com>
      Signed-off-by: default avatarJosh Poimboeuf <jpoimboe@redhat.com>
      Acked-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Tested-by: default avatarPrarit Bhargava <prarit@redhat.com>
      Acked-by: default avatarPrarit Bhargava <prarit@redhat.com>
      Acked-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      2553b67a
    • Kees Cook's avatar
      param: convert some "on"/"off" users to strtobool · 4cc7ecb7
      Kees Cook authored
      This changes several users of manual "on"/"off" parsing to use
      strtobool.
      
      Some side-effects:
      - these uses will now parse y/n/1/0 meaningfully too
      - the early_param uses will now bubble up parse errors
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Acked-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Acked-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Cc: Amitkumar Karwar <akarwar@marvell.com>
      Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: Joe Perches <joe@perches.com>
      Cc: Kalle Valo <kvalo@codeaurora.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Nishant Sarmukadam <nishants@marvell.com>
      Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
      Cc: Steve French <sfrench@samba.org>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      4cc7ecb7
    • Kees Cook's avatar
      lib: add "on"/"off" support to kstrtobool · a81a5a17
      Kees Cook authored
      Add support for "on" and "off" when converting to boolean.
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Cc: Amitkumar Karwar <akarwar@marvell.com>
      Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Joe Perches <joe@perches.com>
      Cc: Kalle Valo <kvalo@codeaurora.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Nishant Sarmukadam <nishants@marvell.com>
      Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
      Cc: Steve French <sfrench@samba.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a81a5a17
    • Kees Cook's avatar
      lib: update single-char callers of strtobool() · 1404297e
      Kees Cook authored
      Some callers of strtobool() were passing a pointer to unterminated
      strings.  In preparation of adding multi-character processing to
      kstrtobool(), update the callers to not pass single-character pointers,
      and switch to using the new kstrtobool_from_user() helper where
      possible.
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Cc: Amitkumar Karwar <akarwar@marvell.com>
      Cc: Nishant Sarmukadam <nishants@marvell.com>
      Cc: Kalle Valo <kvalo@codeaurora.org>
      Cc: Steve French <sfrench@samba.org>
      Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Joe Perches <joe@perches.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1404297e
    • Kees Cook's avatar
      lib: move strtobool() to kstrtobool() · ef951599
      Kees Cook authored
      Create the kstrtobool_from_user() helper and move strtobool() logic into
      the new kstrtobool() (matching all the other kstrto* functions).
      Provides an inline wrapper for existing strtobool() callers.
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Cc: Joe Perches <joe@perches.com>
      Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
      Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: Amitkumar Karwar <akarwar@marvell.com>
      Cc: Nishant Sarmukadam <nishants@marvell.com>
      Cc: Kalle Valo <kvalo@codeaurora.org>
      Cc: Steve French <sfrench@samba.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ef951599
    • Denys Vlasenko's avatar
      include/linux/unaligned: force inlining of byteswap operations · e3bde956
      Denys Vlasenko authored
      Sometimes gcc mysteriously doesn't inline
      very small functions we expect to be inlined. See
      
          https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66122
      
      With this .config:
      http://busybox.net/~vda/kernel_config_OPTIMIZE_INLINING_and_Os,
      the following functions get deinlined many times.
      Examples of disassembly:
      
      <get_unaligned_be16> (24 copies, 108 calls):
             66 8b 07                mov    (%rdi),%ax
             55                      push   %rbp
             48 89 e5                mov    %rsp,%rbp
             86 e0                   xchg   %ah,%al
             5d                      pop    %rbp
             c3                      retq
      
      <get_unaligned_be32> (25 copies, 181 calls):
             8b 07                   mov    (%rdi),%eax
             55                      push   %rbp
             48 89 e5                mov    %rsp,%rbp
             0f c8                   bswap  %eax
             5d                      pop    %rbp
             c3                      retq
      
      <get_unaligned_be64> (23 copies, 94 calls):
             48 8b 07                mov    (%rdi),%rax
             55                      push   %rbp
             48 89 e5                mov    %rsp,%rbp
             48 0f c8                bswap  %rax
             5d                      pop    %rbp
             c3                      retq
      
      <put_unaligned_be16> (2 copies, 11 calls):
             89 f8                   mov    %edi,%eax
             55                      push   %rbp
             c1 ef 08                shr    $0x8,%edi
             c1 e0 08                shl    $0x8,%eax
             09 c7                   or     %eax,%edi
             48 89 e5                mov    %rsp,%rbp
             66 89 3e                mov    %di,(%rsi)
      
      <put_unaligned_be32> (8 copies, 43 calls):
             55                      push   %rbp
             0f cf                   bswap  %edi
             89 3e                   mov    %edi,(%rsi)
             48 89 e5                mov    %rsp,%rbp
             5d                      pop    %rbp
             c3                      retq
      
      <put_unaligned_be64> (26 copies, 157 calls):
             55                      push   %rbp
             48 0f cf                bswap  %rdi
             48 89 3e                mov    %rdi,(%rsi)
             48 89 e5                mov    %rsp,%rbp
             5d                      pop    %rbp
             c3                      retq
      
      This patch fixes this via s/inline/__always_inline/.
      
      It only affects arches with efficient unaligned access insns, such as x86.
      (arched which lack such ops do not include linux/unaligned/access_ok.h)
      
      Code size decrease after the patch is ~8.5k:
      
          text     data      bss       dec     hex filename
      92197848 20826112 36417536 149441496 8e84bd8 vmlinux
      92189231 20826144 36417536 149432911 8e82a4f vmlinux6_unaligned_be_after
      Signed-off-by: default avatarDenys Vlasenko <dvlasenk@redhat.com>
      Acked-by: default avatarIngo Molnar <mingo@kernel.org>
      Cc: Thomas Graf <tgraf@suug.ch>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      e3bde956
    • Denys Vlasenko's avatar
      include/uapi/linux/byteorder, swab: force inlining of some byteswap operations · bc27fb68
      Denys Vlasenko authored
      Sometimes gcc mysteriously doesn't inline
      very small functions we expect to be inlined. See
      
          https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66122
      
      With this .config:
      http://busybox.net/~vda/kernel_config_OPTIMIZE_INLINING_and_Os,
      the following functions get deinlined many times.
      Examples of disassembly:
      
      <get_unaligned_be16> (12 copies, 51 calls):
             66 8b 07                mov    (%rdi),%ax
             55                      push   %rbp
             48 89 e5                mov    %rsp,%rbp
             86 e0                   xchg   %ah,%al
             5d                      pop    %rbp
             c3                      retq
      
      <get_unaligned_be32> (12 copies, 135 calls):
             8b 07                   mov    (%rdi),%eax
             55                      push   %rbp
             48 89 e5                mov    %rsp,%rbp
             0f c8                   bswap  %eax
             5d                      pop    %rbp
             c3                      retq
      
      <get_unaligned_be64> (2 copies, 20 calls):
             48 8b 07                mov    (%rdi),%rax
             55                      push   %rbp
             48 89 e5                mov    %rsp,%rbp
             48 0f c8                bswap  %rax
             5d                      pop    %rbp
             c3                      retq
      
      <__swab16p> (16 copies, 146 calls):
             55                      push   %rbp
             89 f8                   mov    %edi,%eax
             86 e0                   xchg   %ah,%al
             48 89 e5                mov    %rsp,%rbp
             5d                      pop    %rbp
             c3                      retq
      
      <__swab32p> (43 copies, ~560 calls):
             55                      push   %rbp
             89 f8                   mov    %edi,%eax
             0f c8                   bswap  %eax
             48 89 e5                mov    %rsp,%rbp
             5d                      pop    %rbp
             c3                      retq
      
      <__swab64p> (21 copies, 119 calls):
             55                      push   %rbp
             48 89 f8                mov    %rdi,%rax
             48 0f c8                bswap  %rax
             48 89 e5                mov    %rsp,%rbp
             5d                      pop    %rbp
             c3                      retq
      
      <__swab32s> (6 copies, 47 calls):
             8b 07                   mov    (%rdi),%eax
             55                      push   %rbp
             48 89 e5                mov    %rsp,%rbp
             0f c8                   bswap  %eax
             89 07                   mov    %eax,(%rdi)
             5d                      pop    %rbp
             c3                      retq
      
      This patch fixes this via s/inline/__always_inline/.
      Code size decrease after the patch is ~4.5k:
      
          text     data      bss       dec     hex filename
      92202377 20826112 36417536 149446025 8e85d89 vmlinux
      92197848 20826112 36417536 149441496 8e84bd8 vmlinux5_swap_after
      Signed-off-by: default avatarDenys Vlasenko <dvlasenk@redhat.com>
      Acked-by: default avatarIngo Molnar <mingo@kernel.org>
      Cc: Thomas Graf <tgraf@suug.ch>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      bc27fb68
    • Denys Vlasenko's avatar
      include/asm-generic/atomic-long.h: force inlining of some atomic_long operations · a644fdf0
      Denys Vlasenko authored
      Sometimes gcc mysteriously doesn't inline
      very small functions we expect to be inlined. See
      
          https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66122
      
      With this .config:
      http://busybox.net/~vda/kernel_config_OPTIMIZE_INLINING_and_Os,
      atomic_long_inc(), atomic_long_dec() and atomic_long_add()
      functions get deinlined about 40 times. Examples of disassembly:
      
      <atomic_long_inc> (21 copies, 147 calls):
             55                      push   %rbp
             48 89 e5                mov    %rsp,%rbp
             f0 48 ff 07             lock incq (%rdi)
             5d                      pop    %rbp
             c3                      retq
      
      <atomic_long_dec> (4 copies, 14 calls) is similar to inc.
      
      <atomic_long_add> (11 copies, 41 calls):
             55                      push   %rbp
             48 89 e5                mov    %rsp,%rbp
             f0 48 01 3e             lock add %rdi,(%rsi)
             5d                      pop    %rbp
             c3                      retq
      
      This patch fixes this via s/inline/__always_inline/.
      Code size decrease after the patch is ~1.3k:
      
          text     data      bss       dec     hex filename
      92203657 20826112 36417536 149447305 8e86289 vmlinux
      92202377 20826112 36417536 149446025 8e85d89 vmlinux4_atomiclong_after
      Signed-off-by: default avatarDenys Vlasenko <dvlasenk@redhat.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Thomas Graf <tgraf@suug.ch>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a644fdf0