1. 13 Nov, 2016 8 commits
    • Linus Torvalds's avatar
      Merge tag 'char-misc-4.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · acb57b75
      Linus Torvalds authored
      Pull char/misc fixes from Greg KH:
       "Here are three small driver fixes for some reported issues for
        4.9-rc5.
      
        One for the hyper-v subsystem, fixing up a naming issue that showed up
        in 4.9-rc1, one mei driver fix, and one fix for parallel ports,
        resolving a reported regression.
      
        All have been in linux-next with no reported issues"
      
      * tag 'char-misc-4.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
        ppdev: fix double-free of pp->pdev->name
        vmbus: make sysfs names consistent with PCI
        mei: bus: fix received data size check in NFC fixup
      acb57b75
    • Linus Torvalds's avatar
      Merge tag 'driver-core-4.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core · cf2b191c
      Linus Torvalds authored
      Pull driver core fixes from Greg KH:
       "Here are two driver core fixes for 4.9-rc5.
      
        The first resolves an issue with some drivers not liking to be unbound
        and bound again (if CONFIG_DEBUG_TEST_DRIVER_REMOVE is enabled), which
        solves some reported problems with graphics and storage drivers. The
        other resolves a smatch error with the 4.9-rc1 driver core changes
        around this feature.
      
        Both have been in linux-next with no reported issues"
      
      * tag 'driver-core-4.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
        driver core: fix smatch warning on dev->bus check
        driver core: skip removal test for non-removable drivers
      cf2b191c
    • Linus Torvalds's avatar
      Merge tag 'staging-4.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · 85b9df7a
      Linus Torvalds authored
      Pull staging/IIO fixes from Grek KH:
       "Here are a few small staging and iio driver fixes for reported issues.
      
        The last one was cherry-picked from my -next branch to resolve a build
        warning that Arnd fixed, in his quest to be able to turn
        -Wmaybe-uninitialized back on again. That patch, and all of the
        others, have been in linux-next for a while with no reported issues"
      
      * tag 'staging-4.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
        iio: maxim_thermocouple: detect invalid storage size in read()
        staging: nvec: remove managed resource from PS2 driver
        Revert "staging: nvec: ps2: change serio type to passthrough"
        drivers: staging: nvec: remove bogus reset command for PS/2 interface
        staging: greybus: arche-platform: fix device reference leak
        staging: comedi: ni_tio: fix buggy ni_tio_clock_period_ps() return value
        staging: sm750fb: Fix bugs introduced by early commits
        iio: hid-sensors: Increase the precision of scale to fix wrong reading interpretation.
        iio: orientation: hid-sensor-rotation: Add PM function (fix non working driver)
        iio: st_sensors: fix scale configuration for h3lis331dl
        staging: iio: ad5933: avoid uninitialized variable in error case
      85b9df7a
    • Linus Torvalds's avatar
      Merge tag 'usb-4.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · befdfffd
      Linus Torvalds authored
      Pull USB / PHY fixes from Greg KH:
       "Here are a number of small USB and PHY driver fixes for 4.9-rc5
      
        Nothing major, just small fixes for reported issues, all of these have
        been in linux-next for a while with no reported issues"
      
      * tag 'usb-4.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
        USB: cdc-acm: fix TIOCMIWAIT
        cdc-acm: fix uninitialized variable
        drivers/usb: Skip auto handoff for TI and RENESAS usb controllers
        usb: musb: remove duplicated actions
        usb: musb: da8xx: Don't print phy error on -EPROBE_DEFER
        phy: sun4i: check PMU presence when poking unknown bit of pmu
        phy-rockchip-pcie: remove deassert of phy_rst from exit callback
        phy: da8xx-usb: rename the ohci device to ohci-da8xx
        phy: Add reset callback for not generic phy
        uwb: fix device reference leaks
        usb: gadget: u_ether: remove interrupt throttling
        usb: dwc3: st: add missing <linux/pinctrl/consumer.h> include
        usb: dwc3: Fix error handling for core init
      befdfffd
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.dk/linux-block · 348ce85b
      Linus Torvalds authored
      Pull more block fixes from Jens Axboe:
       "Since I mistakenly left out the lightnvm regression fix yesterday and
        the aoeblk seems adequately tested at this point, might as well send
        out another pull to make -rc5"
      
      * 'for-linus' of git://git.kernel.dk/linux-block:
        aoe: fix crash in page count manipulation
        lightnvm: invalid offset calculation for lba_shift
      348ce85b
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 980221d1
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "The megaraid_sas patch in here fixes a major regression in the last
        fix set that made all megaraid_sas cards unusable. It turns out no-one
        had actually tested such an "obvious" fix, sigh. The fix for the fix
        has been tested ...
      
        The next most serious is the vmw_pvscsi abort problem which basically
        means that aborts don't work on the vmware paravirt devices and error
        handling always escalates to reset.
      
        The rest are an assortment of missed reference counting in certain
        paths and corner case bugs that show up on some architectures"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: megaraid_sas: fix macro MEGASAS_IS_LOGICAL to avoid regression
        scsi: qla2xxx: fix invalid DMA access after command aborts in PCI device remove
        scsi: qla2xxx: do not queue commands when unloading
        scsi: libcxgbi: fix incorrect DDP resource cleanup
        scsi: qla2xxx: Fix scsi scan hang triggered if adapter fails during init
        scsi: scsi_dh_alua: Fix a reference counting bug
        scsi: vmw_pvscsi: return SUCCESS for successful command aborts
        scsi: mpt3sas: Fix for block device of raid exists even after deleting raid disk
        scsi: scsi_dh_alua: fix missing kref_put() in alua_rtpg_work()
      980221d1
    • Linus Torvalds's avatar
      Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux · d41bd8f3
      Linus Torvalds authored
      Pull clk fixes from Stephen Boyd:
       "The typical collection of minor bug fixes in clk drivers. We don't
        have anything in the core framework here, just driver fixes.
      
        There's a boot fix for Samsung devices and a safety measure for qoriq
        to prevent CPUs from running too fast. There's also a fix for i.MX6Q
        to properly handle audio clock rates. We also have some "that's
        obviously wrong" fixes like bad NULL pointer checks in the MPP driver
        and a poor usage of __pa in the xgene clk driver that are fixed here"
      
      * tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux:
        clk: mmp: pxa910: fix return value check in pxa910_clk_init()
        clk: mmp: pxa168: fix return value check in pxa168_clk_init()
        clk: mmp: mmp2: fix return value check in mmp2_clk_init()
        clk: qoriq: Don't allow CPU clocks higher than starting value
        clk: imx: fix integer overflow in AV PLL round rate
        clk: xgene: Don't call __pa on ioremaped address
        clk/samsung: Use CLK_OF_DECLARE_DRIVER initialization method for CLKOUT
        clk: rockchip: don't return NULL when failing to register ddrclk branch
      d41bd8f3
    • Arnd Bergmann's avatar
      iio: maxim_thermocouple: detect invalid storage size in read() · d70674ee
      Arnd Bergmann authored
      As found by gcc -Wmaybe-uninitialized, having a storage_bytes value other
      than 2 or 4 will result in undefined behavior:
      
      drivers/iio/temperature/maxim_thermocouple.c: In function 'maxim_thermocouple_read':
      drivers/iio/temperature/maxim_thermocouple.c:141:5: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      
      This probably cannot happen, but returning -EINVAL here is appropriate
      and makes gcc happy and the code more robust.
      
      Fixes: 231147ee ("iio: maxim_thermocouple: Align 16 bit big endian value of raw reads")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      (cherry picked from commit 32cb7d27)
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d70674ee
  2. 12 Nov, 2016 11 commits
    • Jens Axboe's avatar
      aoe: fix crash in page count manipulation · 0cbc72a1
      Jens Axboe authored
      aoeblk contains some mysterious code, that wants to elevate the bio
      vec page counts while it's under IO. That is not needed, it's
      fragile, and it's causing kernel oopses for some.
      Reported-by: default avatarTested-by: Don Koch <kochd@us.ibm.com>
      Tested-by: default avatarTested-by: Don Koch <kochd@us.ibm.com>
      Signed-off-by: default avatarJens Axboe <axboe@fb.com>
      0cbc72a1
    • Matias Bjørling's avatar
      lightnvm: invalid offset calculation for lba_shift · 409ae5a7
      Matias Bjørling authored
      The ns->lba_shift assumes its value to be the logarithmic of the
      LA size. A previous patch duplicated the lba_shift calculation into
      lightnvm. It prematurely also subtracted a 512byte shift, which commonly
      is applied per-command. The 512byte shift being subtracted twice led to
      data loss when restoring the logical to physical mapping table from
      device and when issuing I/O commands using rrpc.
      
      Fix offset by removing the 512byte shift subtraction when calculating
      lba_shift.
      
      Fixes: b0b4e09c "lightnvm: control life of nvm_dev in driver"
      Reported-by: default avatarJavier González <javier@cnexlabs.com>
      Signed-off-by: default avatarMatias Bjørling <m@bjorling.me>
      Signed-off-by: default avatarJens Axboe <axboe@fb.com>
      409ae5a7
    • Linus Torvalds's avatar
      Merge tag 'acpi-4.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 86e4ee76
      Linus Torvalds authored
      Pull ACPI fix from Rafael Wysocki:
       "Fix a recent regression in the 8250_dw serial driver introduced by
        adding a quirk for the APM X-Gene SoC to it which uncovered an issue
        related to the handling of built-in device properties in the core ACPI
        device enumeration code (Heikki Krogerus)"
      
      * tag 'acpi-4.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        ACPI / platform: Add support for build-in properties
      86e4ee76
    • Linus Torvalds's avatar
      Merge tag 'pm-4.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · b9f659b8
      Linus Torvalds authored
      Pull power management fixes from Rafael Wysocki:
       "These fix two bugs in error code paths in the PM core (system-wide
        suspend of devices), a device reference leak in the boot-time suspend
        test code and a cpupower utility regression from the 4.7 cycle.
      
        Specifics:
      
         - Prevent the PM core from attempting to suspend parent devices if
           any of their children, whose suspend callbacks were invoked
           asynchronously, have failed to suspend during the "late" and
           "noirq" phases of system-wide suspend of devices (Brian Norris).
      
         - Prevent the boot-time system suspend test code from leaking a
           reference to the RTC device used by it (Johan Hovold).
      
         - Fix cpupower to use the return value of one of its library
           functions correctly and restore the correct behavior of it when
           used for setting cpufreq tunables broken during the 4.7 development
           cycle (Laura Abbott)"
      
      * tag 'pm-4.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        PM / sleep: don't suspend parent when async child suspend_{noirq, late} fails
        PM / sleep: fix device reference leak in test_suspend
        cpupower: Correct return type of cpu_power_is_cpu_online() in cpufreq-set
      b9f659b8
    • Linus Torvalds's avatar
      Merge tag 'arc-4.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc · e6251f00
      Linus Torvalds authored
      Pull ARC fixes from Vineet Gupta:
      
       - mmap handler for dma ops as generic handler no longer works for us
         [Alexey]
      
       - Fixes for EZChip platform [Noam]
      
       - Fix RTC clocksource driver build issue
      
       - ARC IRQ handling fixes [Yuriy]
      
       - Revert a recent makefile change which doesn't go well with oldish
         tools out in the wild
      
      * tag 'arc-4.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc:
        ARCv2: MCIP: Use IDU_M_DISTRI_DEST mode if there is only 1 destination core
        ARC: IRQ: Do not use hwirq as virq and vice versa
        ARC: [plat-eznps] set default baud for early console
        ARC: [plat-eznps] remove IPI clear from SMP operations
        Revert "ARC: build: retire old toggles"
        ARC: timer: rtc: implement read loop in "C" vs. inline asm
        ARC: change return value of userspace cmpxchg assist syscall
        arc: Implement arch-specific dma_map_ops.mmap
        ARC: [SMP] avoid overriding present cpumask
        ARC: Enable PERF_EVENTS in nSIM driven platforms
      e6251f00
    • Linus Torvalds's avatar
      Merge tag 'platform-drivers-x86-v4.9-3' of... · e3d183c0
      Linus Torvalds authored
      Merge tag 'platform-drivers-x86-v4.9-3' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86
      
      Pull x86 platform driver fixes from Darren Hart:
       "Minor doc fix, a DMI match for ideapad and a fix to toshiba-wmi to
        avoid loading on non-toshiba systems.
      
        Documentation/ABI:
         - ibm_rtl: The "What:" fields are incomplete
      
        toshiba-wmi:
         - Fix loading the driver on non Toshiba laptops
      
        ideapad-laptop:
         - Add another DMI entry for Yoga 900"
      
      * tag 'platform-drivers-x86-v4.9-3' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86:
        Documentation/ABI: ibm_rtl: The "What:" fields are incomplete
        toshiba-wmi: Fix loading the driver on non Toshiba laptops
        ideapad-laptop: Add another DMI entry for Yoga 900
      e3d183c0
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.dk/linux-block · 5f3a5cb8
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
       "Two small (really, one liners both of them!) fixes that should go into
        this series:
      
         - Request allocation error handling fix for nbd, from Christophe,
           fixing a regression in this series.
      
         - An oops fix for drbd. Not a regression in this series, but stable
           material. From Richard"
      
      * 'for-linus' of git://git.kernel.dk/linux-block:
        drbd: Fix kernel_sendmsg() usage - potential NULL deref
        nbd: Fix error handling
      5f3a5cb8
    • Linus Torvalds's avatar
      Merge tag 'pci-v4.9-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci · 8233008f
      Linus Torvalds authored
      Pull PCI fixes from Bjorn Helgaas:
      
       - Update MAINTAINERS for Intel VMD driver filename
      
       - Update Rockchip rk3399 host bridge driver DTS and resets
      
       - Fix ROM shadow problem that made some video device initialization
         fail
      
      * tag 'pci-v4.9-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
        PCI: VMD: Update filename to reflect move
        arm64: dts: rockchip: add three new resets for rk3399 PCIe controller
        PCI: rockchip: Add three new resets as required properties
        PCI: Don't attempt to claim shadow copies of ROM
      8233008f
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-for-v4.9-rc5' of git://people.freedesktop.org/~airlied/linux · 4fb68f97
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "AMD, radeon, i915, imx, msm and udl fixes:
      
         - amdgpu/radeon have a number of power management regressions and
           fixes along with some better error checking
      
         - imx has a single regression fix
      
         - udl has a single kmalloc instead of stack for usb control msg fix
      
         - msm has some fixes for modesetting bugs and regressions
      
         - i915 has a one fix for a Sandybridge regression along with some
           others for DP audio.
      
        They all seem pretty okay at this stage, we've got one MST fix I know
        going through process for i915, but I expect it'll be next week"
      
      * tag 'drm-fixes-for-v4.9-rc5' of git://people.freedesktop.org/~airlied/linux: (30 commits)
        drm/udl: make control msg static const. (v2)
        drm/amd/powerplay: implement get_clock_by_type for iceland.
        drm/amd/powerplay/smu7: fix checks in smu7_get_evv_voltages (v2)
        drm/amd/powerplay: update phm_get_voltage_evv_on_sclk for iceland
        drm/amd/powerplay: propagate errors in phm_get_voltage_evv_on_sclk
        drm/imx: disable planes before DC
        drm/amd/powerplay: return false instead of -EINVAL
        drm/amdgpu/powerplay/smu7: fix unintialized data usage
        drm/amdgpu: fix crash in acp_hw_fini
        drm/i915: Limit Valleyview and earlier to only using mappable scanout
        drm/i915: Round tile chunks up for constructing partial VMAs
        drm/i915/dp: Extend BDW DP audio workaround to GEN9 platforms
        drm/i915/dp: BDW cdclk fix for DP audio
        drm/i915/vlv: Prevent enabling hpd polling in late suspend
        drm/i915: Respect alternate_ddc_pin for all DDI ports
        drm/msm: Fix error handling crashes seen when VRAM allocation fails
        drm/msm/mdp5: 8x16 actually has 8 mixer stages
        drm/msm/mdp5: no scaling support on RGBn pipes for 8x16
        drm/msm/mdp5: handle non-fullscreen base plane case
        drm/msm: Set CLK_IGNORE_UNUSED flag for PLL clocks
        ...
      4fb68f97
    • Linus Torvalds's avatar
      Merge tag 'mmc-v4.9-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc · b8b73df3
      Linus Torvalds authored
      Pull MMC fixes from Ulf Hansson:
       "MMC core:
         - Fix mmc card initialization for hosts not supporting HW busy
           detection
         - Fix mmc_test for sending commands during non-blocking write
      
        MMC host:
         - mxs: Avoid using an uninitialized
         - sdhci: Restore enhanced strobe setting during runtime resume
         - sdhci: Fix a couple of reset related issues
         - dw_mmc: Fix a reset controller issue"
      
      * tag 'mmc-v4.9-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
        mmc: mxs: Initialize the spinlock prior to using it
        mmc: mmc: Use 500ms as the default generic CMD6 timeout
        mmc: mmc_test: Fix "Commands during non-blocking write" tests
        mmc: sdhci: Fix missing enhanced strobe setting during runtime resume
        mmc: sdhci: Reset cmd and data circuits after tuning failure
        mmc: sdhci: Fix unexpected data interrupt handling
        mmc: sdhci: Fix CMD line reset interfering with ongoing data transfer
        mmc: dw_mmc: add the "reset" as name of reset controller
        Documentation: synopsys-dw-mshc: add binding for reset-names
      b8b73df3
    • Linus Torvalds's avatar
      Merge tag 'pinctrl-v4.9-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl · 5c03b53c
      Linus Torvalds authored
      Pull pin control fixes from Linus Walleij:
       "All is about drivers, no core business going on.
      
         - Fix a host of runtime problems with the Intel Cherryview driver:
           suspend/resume needs to be marshalled properly, and strange effects
           from BIOS interaction during suspend/resume need to be dealt with.
      
         - A single bit was being set wrong in the Aspeed driver.
      
         - Fix an iProc probe ordering fallout resulting from v4.9
           refactorings for bus population.
      
         - Do not specify a default trigger in the ST Micro cascaded GPIO IRQ
           controller: the kernel will moan.
      
         - Make IRQs optional altogether on the STM32 driver, it turns out not
           all systems have them or want them.
      
         - Fix a re-probe bug in the i.MX driver, it will eventually crash if
           probed repeatedly, not good"
      
      * tag 'pinctrl-v4.9-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
        pinctrl-aspeed-g5: Never set SCU90[6]
        pinctrl: cherryview: Prevent possible interrupt storm on resume
        pinctrl: cherryview: Serialize register access in suspend/resume
        pinctrl: imx: reset group index on probe
        pinctrl: stm32: move gpio irqs binding to optional
        pinctrl: stm32: remove dependency with interrupt controller
        pinctrl: st: don't specify default interrupt trigger
        pinctrl: iproc: Fix iProc and NSP GPIO support
      5c03b53c
  3. 11 Nov, 2016 21 commits
    • Rafael J. Wysocki's avatar
      Merge branches 'pm-tools-fixes' and 'pm-sleep-fixes' · cd16f3dc
      Rafael J. Wysocki authored
      * pm-tools-fixes:
        cpupower: Correct return type of cpu_power_is_cpu_online() in cpufreq-set
      
      * pm-sleep-fixes:
        PM / sleep: don't suspend parent when async child suspend_{noirq, late} fails
        PM / sleep: fix device reference leak in test_suspend
      cd16f3dc
    • Rafael J. Wysocki's avatar
      Merge branch 'device-properties' · 66f5854c
      Rafael J. Wysocki authored
      * device-properties:
        ACPI / platform: Add support for build-in properties
      66f5854c
    • Linus Torvalds's avatar
      Merge branch 'maybe-uninitialized' (patches from Arnd) · 015ed943
      Linus Torvalds authored
      Merge fixes for -Wmaybe-uninitialized from Arnd Bergmann:
       "It took a while for some patches to make it into mainline through
        maintainer trees, but the 28-patch series is now reduced to 10, with
        one tiny patch added at the end.
      
        Aside from patches that are no longer required, I did these changes
        compared to version 1:
      
         - Dropped "iio: maxim_thermocouple: detect invalid storage size in
           read()", which is currently in linux-next as commit 32cb7d27.
           This is the only remaining warning I see for a couple of corner
           cases (kbuild bot reports it on blackfin, kernelci bot and arm-soc
           bot both report it on arm64)
      
         - Dropped "brcmfmac: avoid maybe-uninitialized warning in
           brcmf_cfg80211_start_ap", which is currently in net/master merge
           pending.
      
         - Dropped two x86 patches, "x86: math-emu: possible uninitialized
           variable use" and "x86: mark target address as output in 'insb'
           asm" as they do not seem to trigger for a default build, and I got
           no feedback on them. Both of these are ancient issues and seem
           harmless, I will send them again to the x86 maintainers once the
           rest is merged.
      
         - Dropped "rbd: false-postive gcc-4.9 -Wmaybe-uninitialized" based on
           feedback from Ilya Dryomov, who already has a different fix queued
           up for v4.10. The kbuild bot reports this as a warning for xtensa.
      
         - Replaced "crypto: aesni: avoid -Wmaybe-uninitialized warning" with
           a simpler patch, this one always triggers but my first solution
           would not be safe for linux-4.9 any more at this point. I'll follow
           up with the larger patch as a cleanup for 4.10.
      
         - Replaced "dib0700: fix nec repeat handling" with a better one,
           contributed by Sean Young"
      
      * -Wmaybe-uninitialized fixes:
        Kbuild: enable -Wmaybe-uninitialized warnings by default
        pcmcia: fix return value of soc_pcmcia_regulator_set
        infiniband: shut up a maybe-uninitialized warning
        crypto: aesni: shut up -Wmaybe-uninitialized warning
        rc: print correct variable for z8f0811
        dib0700: fix nec repeat handling
        s390: pci: don't print uninitialized data for debugging
        nios2: fix timer initcall return value
        x86: apm: avoid uninitialized data
        NFSv4.1: work around -Wmaybe-uninitialized warning
        Kbuild: enable -Wmaybe-uninitialized warning for "make W=1"
      015ed943
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · 968ef8de
      Linus Torvalds authored
      Merge misc fixes from Andrew Morton:
       "15 fixes"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        lib/stackdepot: export save/fetch stack for drivers
        mm: kmemleak: scan .data.ro_after_init
        memcg: prevent memcg caches to be both OFF_SLAB & OBJFREELIST_SLAB
        coredump: fix unfreezable coredumping task
        mm/filemap: don't allow partially uptodate page for pipes
        mm/hugetlb: fix huge page reservation leak in private mapping error paths
        ocfs2: fix not enough credit panic
        Revert "console: don't prefer first registered if DT specifies stdout-path"
        mm: hwpoison: fix thp split handling in memory_failure()
        swapfile: fix memory corruption via malformed swapfile
        mm/cma.c: check the max limit for cma allocation
        scripts/bloat-o-meter: fix SIGPIPE
        shmem: fix pageflags after swapping DMA32 object
        mm, frontswap: make sure allocated frontswap map is assigned
        mm: remove extra newline from allocation stall warning
      968ef8de
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · c5e4ca6d
      Linus Torvalds authored
      Pull VFS fixes from Al Viro:
       "Christoph's and Jan's aio fixes, fixup for generic_file_splice_read
        (removal of pointless detritus that actually breaks it when used for
        gfs2 ->splice_read()) and fixup for generic_file_read_iter()
        interaction with ITER_PIPE destinations."
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        splice: remove detritus from generic_file_splice_read()
        mm/filemap: don't allow partially uptodate page for pipes
        aio: fix freeze protection of aio writes
        fs: remove aio_run_iocb
        fs: remove the never implemented aio_fsync file operation
        aio: hold an extra file reference over AIO read/write operations
      c5e4ca6d
    • Linus Torvalds's avatar
      Merge tag 'ceph-for-4.9-rc5' of git://github.com/ceph/ceph-client · ef091b3c
      Linus Torvalds authored
      Pull Ceph fixes from Ilya Dryomov:
       "Ceph's ->read_iter() implementation is incompatible with the new
        generic_file_splice_read() code that went into -rc1.  Switch to the
        less efficient default_file_splice_read() for now; the proper fix is
        being held for 4.10.
      
        We also have a fix for a 4.8 regression and a trival libceph fixup"
      
      * tag 'ceph-for-4.9-rc5' of git://github.com/ceph/ceph-client:
        libceph: initialize last_linger_id with a large integer
        libceph: fix legacy layout decode with pool 0
        ceph: use default file splice read callback
      ef091b3c
    • Linus Torvalds's avatar
      Merge tag 'nfs-for-4.9-3' of git://git.linux-nfs.org/projects/anna/linux-nfs · ef5beed9
      Linus Torvalds authored
      Pull NFS client bugfixes from Anna Schumaker:
       "Most of these fix regressions in 4.9, and none are going to stable
        this time around.
      
        Bugfixes:
         - Trim extra slashes in v4 nfs_paths to fix tools that use this
         - Fix a -Wmaybe-uninitialized warnings
         - Fix suspicious RCU usages
         - Fix Oops when mounting multiple servers at once
         - Suppress a false-positive pNFS error
         - Fix a DMAR failure in NFS over RDMA"
      
      * tag 'nfs-for-4.9-3' of git://git.linux-nfs.org/projects/anna/linux-nfs:
        xprtrdma: Fix DMAR failure in frwr_op_map() after reconnect
        fs/nfs: Fix used uninitialized warn in nfs4_slot_seqid_in_use()
        NFS: Don't print a pNFS error if we aren't using pNFS
        NFS: Ignore connections that have cl_rpcclient uninitialized
        SUNRPC: Fix suspicious RCU usage
        NFSv4.1: work around -Wmaybe-uninitialized warning
        NFS: Trim extra slash in v4 nfs_path
      ef5beed9
    • Linus Torvalds's avatar
      Merge tag 'xfs-fixes-for-linus-4.9-rc5' of... · a4fac3b5
      Linus Torvalds authored
      Merge tag 'xfs-fixes-for-linus-4.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/dgc/linux-xfs
      
      Pull xfs fix from Dave Chinner:
       "This is a fix for an unmount hang (regression) when the filesystem is
        shutdown.  It was supposed to go to you for -rc3, but I accidentally
        tagged the commit prior to it in that pullreq.
      
        Summary:
      
         - fix for aborting deferred transactions on filesystem shutdown"
      
      * tag 'xfs-fixes-for-linus-4.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/dgc/linux-xfs:
        xfs: defer should abort intent items if the trans roll fails
      a4fac3b5
    • Arnd Bergmann's avatar
      Kbuild: enable -Wmaybe-uninitialized warnings by default · 4324cb23
      Arnd Bergmann authored
      Previously the warnings were added back at the W=1 level and above, this
      now turns them on again by default, assuming that we have addressed all
      warnings and again have a clean build for v4.10.
      
      I found a number of new warnings in linux-next already and submitted
      bugfixes for those.  Hopefully they are caught by the 0day builder in
      the future as soon as this patch is merged.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      4324cb23
    • Arnd Bergmann's avatar
      pcmcia: fix return value of soc_pcmcia_regulator_set · 75ed2687
      Arnd Bergmann authored
      The newly introduced soc_pcmcia_regulator_set() function sometimes
      returns without setting its return code, as shown by this warning:
      
        drivers/pcmcia/soc_common.c: In function 'soc_pcmcia_regulator_set':
        drivers/pcmcia/soc_common.c:112:5: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      
      This changes it to propagate the regulator_disable() result instead.
      
      Fixes: ac61b600 ("pcmcia: soc_common: add support for Vcc and Vpp regulators")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      75ed2687
    • Arnd Bergmann's avatar
      infiniband: shut up a maybe-uninitialized warning · c50e90d0
      Arnd Bergmann authored
      Some configurations produce this harmless warning when built with gcc
      -Wmaybe-uninitialized:
      
        infiniband/core/cma.c: In function 'cma_get_net_dev':
        infiniband/core/cma.c:1242:12: warning: 'src_addr_storage.sin_addr.s_addr' may be used uninitialized in this function [-Wmaybe-uninitialized]
      
      I previously reported this for the powerpc64 defconfig, but have now
      reproduced the same thing for x86 as well, using gcc-5 or higher.
      
      The code looks correct to me, and this change just rearranges it by
      making sure we alway initialize the entire address structure to make the
      warning disappear.  My first approach added an initialization at the
      time of the declaration, which Doug commented may be too costly, so I
      hope this version doesn't add overhead.
      
      Link: http://arm-soc.lixom.net/buildlogs/mainline/v4.7-rc6/buildall.powerpc.ppc64_defconfig.log.passed
      Link: https://patchwork.kernel.org/patch/9212825/Acked-by: default avatarHaggai Eran <haggaie@mellanox.com>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c50e90d0
    • Arnd Bergmann's avatar
      crypto: aesni: shut up -Wmaybe-uninitialized warning · beae2c9e
      Arnd Bergmann authored
      The rfc4106 encrypy/decrypt helper functions cause an annoying
      false-positive warning in allmodconfig if we turn on
      -Wmaybe-uninitialized warnings again:
      
        arch/x86/crypto/aesni-intel_glue.c: In function ‘helper_rfc4106_decrypt’:
        include/linux/scatterlist.h:67:31: warning: ‘dst_sg_walk.sg’ may be used uninitialized in this function [-Wmaybe-uninitialized]
      
      The problem seems to be that the compiler doesn't track the state of the
      'one_entry_in_sg' variable across the kernel_fpu_begin/kernel_fpu_end
      section.
      
      This takes the easy way out by adding a bogus initialization, which
      should be harmless enough to get the patch into v4.9 so we can turn on
      this warning again by default without producing useless output.  A
      follow-up patch for v4.10 rearranges the code to make the warning go
      away.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      beae2c9e
    • Arnd Bergmann's avatar
      rc: print correct variable for z8f0811 · 9cdbe14f
      Arnd Bergmann authored
      A recent rework accidentally left a debugging printk untouched while
      changing the meaning of the variables, leading to an uninitialized
      variable being printed:
      
        drivers/media/i2c/ir-kbd-i2c.c: In function 'get_key_haup_common':
        drivers/media/i2c/ir-kbd-i2c.c:62:2: error: 'toggle' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      
      This prints the correct one instead, as we did before the patch.
      
      Fixes: 00bb8207 ("[media] rc: Hauppauge z8f0811 can decode RC6")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      9cdbe14f
    • Sean Young's avatar
      dib0700: fix nec repeat handling · ba13e98f
      Sean Young authored
      When receiving a nec repeat, ensure the correct scancode is repeated
      rather than a random value from the stack.  This removes the need for
      the bogus uninitialized_var() and also fixes the warnings:
      
          drivers/media/usb/dvb-usb/dib0700_core.c: In function ‘dib0700_rc_urb_completion’:
          drivers/media/usb/dvb-usb/dib0700_core.c:679: warning: ‘protocol’ may be used uninitialized in this function
      
      [sean addon: So after writing the patch and submitting it, I've bought the
                   hardware on ebay. Without this patch you get random scancodes
                   on nec repeats, which the patch indeed fixes.]
      Signed-off-by: default avatarSean Young <sean@mess.org>
      Tested-by: default avatarSean Young <sean@mess.org>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ba13e98f
    • Arnd Bergmann's avatar
      s390: pci: don't print uninitialized data for debugging · 92dfffee
      Arnd Bergmann authored
      gcc correctly warns about an incorrect use of the 'pa' variable in case
      we pass an empty scatterlist to __s390_dma_map_sg:
      
        arch/s390/pci/pci_dma.c: In function '__s390_dma_map_sg':
        arch/s390/pci/pci_dma.c:309:13: warning: 'pa' may be used uninitialized in this function [-Wmaybe-uninitialized]
      
      This adds a bogus initialization to the function to sanitize the debug
      output.  I would have preferred a solution without the initialization,
      but I only got the report from the kbuild bot after turning on the
      warning again, and didn't manage to reproduce it myself.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Acked-by: default avatarSebastian Ott <sebott@linux.vnet.ibm.com>
      Acked-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      92dfffee
    • Arnd Bergmann's avatar
      nios2: fix timer initcall return value · 069013a9
      Arnd Bergmann authored
      When called more than twice, the nios2_time_init() function return an
      uninitialized value, as detected by gcc -Wmaybe-uninitialized
      
        arch/nios2/kernel/time.c: warning: 'ret' may be used uninitialized in this function
      
      This makes it return '0' here, matching the comment above the function.
      Acked-by: default avatarLey Foon Tan <lftan@altera.com>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      069013a9
    • Arnd Bergmann's avatar
      x86: apm: avoid uninitialized data · 3a6d8676
      Arnd Bergmann authored
      apm_bios_call() can fail, and return a status in its argument structure.
      If that status however is zero during a call from
      apm_get_power_status(), we end up using data that may have never been
      set, as reported by "gcc -Wmaybe-uninitialized":
      
        arch/x86/kernel/apm_32.c: In function ‘apm’:
        arch/x86/kernel/apm_32.c:1729:17: error: ‘bx’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
        arch/x86/kernel/apm_32.c:1835:5: error: ‘cx’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
        arch/x86/kernel/apm_32.c:1730:17: note: ‘cx’ was declared here
        arch/x86/kernel/apm_32.c:1842:27: error: ‘dx’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
        arch/x86/kernel/apm_32.c:1731:17: note: ‘dx’ was declared here
      
      This changes the function to return "APM_NO_ERROR" here, which makes the
      code more robust to broken BIOS versions, and avoids the warning.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Reviewed-by: default avatarJiri Kosina <jkosina@suse.cz>
      Reviewed-by: default avatarLuis R. Rodriguez <mcgrof@kernel.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      3a6d8676
    • Arnd Bergmann's avatar
      NFSv4.1: work around -Wmaybe-uninitialized warning · e84efa32
      Arnd Bergmann authored
      A bugfix introduced a harmless gcc warning in nfs4_slot_seqid_in_use if
      we enable -Wmaybe-uninitialized again:
      
        fs/nfs/nfs4session.c:203:54: error: 'cur_seq' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      
      gcc is not smart enough to conclude that the IS_ERR/PTR_ERR pair results
      in a nonzero return value here.  Using PTR_ERR_OR_ZERO() instead makes
      this clear to the compiler.
      
      Fixes: e09c978a ("NFSv4.1: Fix Oopsable condition in server callback races")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      e84efa32
    • Arnd Bergmann's avatar
      Kbuild: enable -Wmaybe-uninitialized warning for "make W=1" · a76bcf55
      Arnd Bergmann authored
      Traditionally, we have always had warnings about uninitialized variables
      enabled, as this is part of -Wall, and generally a good idea [1], but it
      also always produced false positives, mainly because this is a variation
      of the halting problem and provably impossible to get right in all cases
      [2].
      
      Various people have identified cases that are particularly bad for false
      positives, and in commit e74fc973 ("Turn off -Wmaybe-uninitialized
      when building with -Os"), I turned off the warning for any build that
      was done with CC_OPTIMIZE_FOR_SIZE.  This drastically reduced the number
      of false positive warnings in the default build but unfortunately had
      the side effect of turning the warning off completely in 'allmodconfig'
      builds, which in turn led to a lot of warnings (both actual bugs, and
      remaining false positives) to go in unnoticed.
      
      With commit 877417e6 ("Kbuild: change CC_OPTIMIZE_FOR_SIZE
      definition") enabled the warning again for allmodconfig builds in v4.7
      and in v4.8-rc1, I had finally managed to address all warnings I get in
      an ARM allmodconfig build and most other maybe-uninitialized warnings
      for ARM randconfig builds.
      
      However, commit 6e8d666e ("Disable "maybe-uninitialized" warning
      globally") was merged at the same time and disabled it completely for
      all configurations, because of false-positive warnings on x86 that I had
      not addressed until then.  This caused a lot of actual bugs to get
      merged into mainline, and I sent several dozen patches for these during
      the v4.9 development cycle.  Most of these are actual bugs, some are for
      correct code that is safe because it is only called under external
      constraints that make it impossible to run into the case that gcc sees,
      and in a few cases gcc is just stupid and finds something that can
      obviously never happen.
      
      I have now done a few thousand randconfig builds on x86 and collected
      all patches that I needed to address every single warning I got (I can
      provide the combined patch for the other warnings if anyone is
      interested), so I hope we can get the warning back and let people catch
      the actual bugs earlier.
      
      This reverts the change to disable the warning completely and for now
      brings it back at the "make W=1" level, so we can get it merged into
      mainline without introducing false positives.  A follow-up patch enables
      it on all levels unless some configuration option turns it off because
      of false-positives.
      
      Link: https://rusty.ozlabs.org/?p=232 [1]
      Link: https://gcc.gnu.org/wiki/Better_Uninitialized_Warnings [2]
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a76bcf55
    • Chris Wilson's avatar
      lib/stackdepot: export save/fetch stack for drivers · ae65a21f
      Chris Wilson authored
      Some drivers would like to record stacktraces in order to aide leak
      tracing.  As stackdepot already provides a facility for only storing the
      unique traces, thereby reducing the memory required, export that
      functionality for use by drivers.
      
      The code was originally created for KASAN and moved under lib in commit
      cd11016e ("mm, kasan: stackdepot implementation.  Enable stackdepot
      for SLAB") so that it could be shared with mm/.  In turn, we want to
      share it now with drivers.
      
      Link: http://lkml.kernel.org/r/20161108133209.22704-1-chris@chris-wilson.co.ukSigned-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
      Cc: Alexander Potapenko <glider@google.com>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ae65a21f
    • Jakub Kicinski's avatar
      mm: kmemleak: scan .data.ro_after_init · d7c19b06
      Jakub Kicinski authored
      Limit the number of kmemleak false positives by including
      .data.ro_after_init in memory scanning.  To achieve this we need to add
      symbols for start and end of the section to the linker scripts.
      
      The problem was been uncovered by commit 56989f6d ("genetlink: mark
      families as __ro_after_init").
      
      Link: http://lkml.kernel.org/r/1478274173-15218-1-git-send-email-jakub.kicinski@netronome.comReviewed-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Cong Wang <xiyou.wangcong@gmail.com>
      Cc: Johannes Berg <johannes@sipsolutions.net>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d7c19b06