1. 30 Mar, 2020 29 commits
    • Linus Torvalds's avatar
      Merge tag 'pm-5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 49835c15
      Linus Torvalds authored
      Pull power management updates from Rafael Wysocki:
       "These clean up and rework the PM QoS API, address a suspend-to-idle
        wakeup regression on some ACPI-based platforms, clean up and extend a
        few cpuidle drivers, update multiple cpufreq drivers and cpufreq
        documentation, and fix a number of issues in devfreq and several other
        things all over.
      
        Specifics:
      
         - Clean up and rework the PM QoS API to simplify the code and reduce
           the size of it (Rafael Wysocki).
      
         - Fix a suspend-to-idle wakeup regression on Dell XPS13 9370 and
           similar platforms where the USB plug/unplug events are handled by
           the EC (Rafael Wysocki).
      
         - CLean up the intel_idle and PSCI cpuidle drivers (Rafael Wysocki,
           Ulf Hansson).
      
         - Extend the haltpoll cpuidle driver so that it can be forced to run
           on some systems where it refused to load (Maciej Szmigiero).
      
         - Convert several cpufreq documents to the .rst format and move the
           legacy driver documentation into one common file (Mauro Carvalho
           Chehab, Rafael Wysocki).
      
         - Update several cpufreq drivers:
      
              * Extend and fix the imx-cpufreq-dt driver (Anson Huang).
      
              * Improve the -EPROBE_DEFER handling and fix unwanted CPU
                overclocking on i.MX6ULL in imx6q-cpufreq (Anson Huang,
                Christoph Niedermaier).
      
              * Add support for Krait based SoCs to the qcom driver (Ansuel
                Smith).
      
              * Add support for OPP_PLUS to ti-cpufreq (Lokesh Vutla).
      
              * Add platform specific intermediate callbacks support to
                cpufreq-dt and update the imx6q driver (Peng Fan).
      
              * Simplify and consolidate some pieces of the intel_pstate
                driver and update its documentation (Rafael Wysocki, Alex
                Hung).
      
         - Fix several devfreq issues:
      
              * Remove unneeded extern keyword from a devfreq header file and
                use the DEVFREQ_GOV_UPDATE_INTERNAL event name instead of
                DEVFREQ_GOV_INTERNAL (Chanwoo Choi).
      
              * Fix the handling of dev_pm_qos_remove_request() result
                (Leonard Crestez).
      
              * Use constant name for userspace governor (Pierre Kuo).
      
              * Get rid of doc warnings and fix a typo (Christophe JAILLET).
      
         - Use built-in RCU list checking in some places in the PM core to
           avoid false-positive RCU usage warnings (Madhuparna Bhowmik).
      
         - Add explicit READ_ONCE()/WRITE_ONCE() annotations to low-level PM
           QoS routines (Qian Cai).
      
         - Fix removal of wakeup sources to avoid NULL pointer dereferences in
           a corner case (Neeraj Upadhyay).
      
         - Clean up the handling of hibernate compat ioctls and fix the
           related documentation (Eric Biggers).
      
         - Update the idle_inject power capping driver to use variable-length
           arrays instead of zero-length arrays (Gustavo Silva).
      
         - Fix list format in a PM QoS document (Randy Dunlap).
      
         - Make the cpufreq stats module use scnprintf() to avoid potential
           buffer overflows (Takashi Iwai).
      
         - Add pm_runtime_get_if_active() to PM-runtime API (Sakari Ailus).
      
         - Allow no domain-idle-states DT property in generic PM domains (Ulf
           Hansson).
      
         - Fix a broken y-axis scale in the intel_pstate_tracer utility (Doug
           Smythies)"
      
      * tag 'pm-5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (78 commits)
        cpufreq: intel_pstate: Simplify intel_pstate_cpu_init()
        tools/power/x86/intel_pstate_tracer: fix a broken y-axis scale
        ACPI: PM: s2idle: Refine active GPEs check
        ACPICA: Allow acpi_any_gpe_status_set() to skip one GPE
        PM: sleep: wakeup: Skip wakeup_source_sysfs_remove() if device is not there
        PM / devfreq: Get rid of some doc warnings
        PM / devfreq: Fix handling dev_pm_qos_remove_request result
        PM / devfreq: Fix a typo in a comment
        PM / devfreq: Change to DEVFREQ_GOV_UPDATE_INTERVAL event name
        PM / devfreq: Remove unneeded extern keyword
        PM / devfreq: Use constant name of userspace governor
        ACPI: PM: s2idle: Fix comment in acpi_s2idle_prepare_late()
        cpufreq: qcom: Add support for krait based socs
        cpufreq: imx6q-cpufreq: Improve the logic of -EPROBE_DEFER handling
        cpufreq: Use scnprintf() for avoiding potential buffer overflow
        cpuidle: psci: Split psci_dt_cpu_init_idle()
        PM / Domains: Allow no domain-idle-states DT property in genpd when parsing
        PM / hibernate: Remove unnecessary compat ioctl overrides
        PM: hibernate: fix docs for ioctls that return loff_t via pointer
        Documentation: intel_pstate: update links for references
        ...
      49835c15
    • Linus Torvalds's avatar
      Merge tag 'regulator-spi-v5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/misc · a231bed2
      Linus Torvalds authored
      Pull spi and regulator updates from Mark Brown:
       "At one point in the release cycle I managed to fat finger things and
        apply some SPI fixes onto a regulator branch and merge that into the
        SPI tree, then pull in a change shared with the MTD tree moving the
        Mediatek quadspi driver over to become the Mediatek spi-nor driver in
        the SPI tree.
      
        This has made a mess which I only just noticed while preparing this
        and I can't see a sensible way to unpick things due to other
        subsequent merge commits especially the pull from MTD so it looks like
        the most sensible thing to do is give up and combine the two pull
        requests.
      
        Fortunately both subsystems were fairly quiet this cycle, the
        highlights are:
      
        regulator:
      
         - Support for Monoloithic Power Systems MP5416, MP8867 and MPS8869
           and Qualcomm PMI8994 and SMB208.
      
        SPI:
      
         - Lots of enhancements for spi-fsl-dspi, including XSPI mode support,
           from Vladimir Oltean.
      
         - Support for amlogic Meson G12A, IBM FSI, Mediatek spi-nor (moved
           from MTD), NXP i.MX8Mx, Rockchip PX30, RK3308 and RK3328, and
           Qualcomm Atheros AR934x/QCA95xx"
      
      * tag 'regulator-spi-v5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/misc: (118 commits)
        spi: efm32: Convert to use GPIO descriptors
        regulator: qcom_smd: Add pmi8994 regulator support
        regulator: da9063: Fix get_mode() functions to read sleep field
        spi: spi-fsl-lpspi: Replace zero-length array with flexible-array member
        spi: spi-s3c24xx: Replace zero-length array with flexible-array member
        spi: stm32: Fix comments compilation warnings
        spi: atmel-quadspi: Add verbose debug facilities to monitor register accesses
        spi: spi-fsl-dspi: Add support for LS1028A
        spi: spi-fsl-dspi: Move invariant configs out of dspi_transfer_one_message
        spi: spi-fsl-dspi: Fix interrupt-less DMA mode taking an XSPI code path
        spi: spi-fsl-dspi: Avoid NULL pointer in dspi_slave_abort for non-DMA mode
        spi: spi-fsl-dspi: Replace interruptible wait queue with a simple completion
        spi: spi-fsl-dspi: Protect against races on dspi->words_in_flight
        spi: spi-fsl-dspi: Avoid reading more data than written in EOQ mode
        spi: spi-fsl-dspi: Fix bits-per-word acceleration in DMA mode
        spi: spi-fsl-dspi: Fix little endian access to PUSHR CMD and TXDATA
        spi: spi-fsl-dspi: Don't access reserved fields in SPI_MCR
        regulator: driver.h: fix regulator_map_* function names
        regulator: da9063: fix suspend
        spi: mxs: Drop GPIO includes
        ...
      a231bed2
    • Linus Torvalds's avatar
      Merge tag 'regmap-v5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap · e1299409
      Linus Torvalds authored
      Pull regma: update from Mark Brown:
       "Only one small documentation fix for regmap this time around"
      
      * tag 'regmap-v5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
        regmap: wrong descriptions in regmap_range_cfg
      e1299409
    • Linus Torvalds's avatar
      Merge tag 'staging-5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · 4c6ef3b1
      Linus Torvalds authored
      Pull staging and IIO driver updates from Greg KH:
       "Here is the big staging and IIO driver pull request for 5.7-rc1.
      
        We again end up deleting more code than we added here, thanks to
        finally getting rid of the old and obsolete wireless USB stuff, and
        the exfat code (which is coming in again through the vfs tree in a
        much cleaner version).
      
        But some code does come back, with the octeon drivers being found to
        actually be used in the wild, so those deletions are now reverted.
      
        Other than those major things, just loads and loads of tiny checkpatch
        cleanups all over the place, along with new IIO drivers and fixes.
      
        All have been in linux-next with no reported issues"
      
      [ Stephen Rothwell points out some reported issues due to merge conflicts ]
      
      * tag 'staging-5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (415 commits)
        staging: vt6656: Use DIV_ROUND_UP macro instead of specific code
        staging: remove hp100 driver
        staging: wilc1000: Use crc7 in lib/ rather than a private copy
        Staging: rtl8192u: ieee80211: Use netdev_alert().
        Staging: rtl8192u: ieee80211: Use netdev_info() with network devices.
        Staging: rtl8192u: ieee80211: Use netdev_warn() for network devices.
        Staging: rtl8192u: ieee80211: Use netdev_dbg() for debug messages.
        staging: wlan-ng: fix use-after-free Read in hfa384x_usbin_callback
        staging: rtl8723bs: hal: Remove NULL check before kfree
        staging: rtl8723bs: hal: Correct typos in comments
        staging: rtl8723bs: os_dep: Correct typos in comments
        staging: rtl8723bs: core: Correct typos in comments
        staging: rtl8723bs: hal: Remove unnecessary cast on void pointer
        staging: rtl8188eu: cleanup long line in odm.c
        staging: rtl8723bs: hal: Compress return logic
        staging: rtl8723bs: rtw_cmd: Compress lines for immediate return
        staging: rtl8723bs: rtw_efuse: Compress lines for immediate return
        staging: wilc1000: remove label from examples in DT binding documentation
        staging: rtl8723bs: Remove blank line before '}' brace
        Staging: rtl8188eu: hal: Add space around operators
        ...
      4c6ef3b1
    • Linus Torvalds's avatar
      Merge tag 'driver-core-5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core · 59838093
      Linus Torvalds authored
      Pull driver core updates from Greg KH:
       "Here is the "big" set of driver core changes for 5.7-rc1.
      
        Nothing huge in here, just lots of little firmware core changes and
        use of new apis, a libfs fix, a debugfs api change, and some driver
        core deferred probe rework.
      
        All of these have been in linux-next for a while with no reported
        issues"
      
      * tag 'driver-core-5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (44 commits)
        Revert "driver core: Set fw_devlink to "permissive" behavior by default"
        driver core: Set fw_devlink to "permissive" behavior by default
        driver core: Replace open-coded list_last_entry()
        driver core: Read atomic counter once in driver_probe_done()
        libfs: fix infoleak in simple_attr_read()
        driver core: Add device links from fwnode only for the primary device
        platform/x86: touchscreen_dmi: Add info for the Chuwi Vi8 Plus tablet
        platform/x86: touchscreen_dmi: Add EFI embedded firmware info support
        Input: icn8505 - Switch to firmware_request_platform for retreiving the fw
        Input: silead - Switch to firmware_request_platform for retreiving the fw
        selftests: firmware: Add firmware_request_platform tests
        test_firmware: add support for firmware_request_platform
        firmware: Add new platform fallback mechanism and firmware_request_platform()
        Revert "drivers: base: power: wakeup.c: Use built-in RCU list checking"
        drivers: base: power: wakeup.c: Use built-in RCU list checking
        component: allow missing unbind callback
        debugfs: remove return value of debugfs_create_file_size()
        debugfs: Check module state before warning in {full/open}_proxy_open()
        firmware: fix a double abort case with fw_load_sysfs_fallback
        arch_topology: Fix putting invalid cpu clk
        ...
      59838093
    • Linus Torvalds's avatar
      Merge tag 'usb-5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · db34c5ff
      Linus Torvalds authored
      Pull USB / PHY updates from Greg KH:
       "Here are the big set of USB and PHY driver patches for 5.7-rc1.
      
        Nothing huge here, some new PHY drivers, loads of USB gadget fixes and
        updates, xhci updates, usb-serial driver updates and new device ids,
        and other minor things. Full details in the shortlog.
      
        All have been in linux-next for a while with no reported issues"
      
      * tag 'usb-5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (239 commits)
        USB: cdc-acm: restore capability check order
        usb: cdns3: make signed 1 bit bitfields unsigned
        usb: gadget: fsl: remove unused variable 'driver_desc'
        usb: gadget: f_fs: Fix use after free issue as part of queue failure
        usb: typec: Correct the documentation for typec_cable_put()
        USB: serial: io_edgeport: fix slab-out-of-bounds read in edge_interrupt_callback
        USB: serial: option: add Wistron Neweb D19Q1
        USB: serial: option: add BroadMobi BM806U
        USB: serial: option: add support for ASKEY WWHC050
        usb: core: Add ACPI support for USB interface devices
        driver core: platform: Reimplement devm_platform_ioremap_resource
        usb: dwc2: convert to devm_platform_get_and_ioremap_resource
        usb: host: hisilicon: convert to devm_platform_get_and_ioremap_resource
        usb: host: xhci-plat: convert to devm_platform_get_and_ioremap_resource
        drivers: provide devm_platform_get_and_ioremap_resource()
        phy: qcom-qusb2: Add new overriding tuning parameters in QUSB2 V2 PHY
        phy: qcom-qusb2: Add support for overriding tuning parameters in QUSB2 V2 PHY
        dt-bindings: phy: qcom-qusb2: Add support for overriding Phy tuning parameters
        phy: qcom-qusb2: Add generic QUSB2 V2 PHY support
        dt-bindings: phy: qcom,qusb2: Add compatibles for QUSB2 V2 phy and SC7180
        ...
      db34c5ff
    • Linus Torvalds's avatar
      Merge tag 'media/v5.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media · 063d1942
      Linus Torvalds authored
      Pull media updates from Mauro Carvalho Chehab:
      
       - New sensor driver: imx219
      
       - Support for some new pixelformats
      
       - Support for Sun8i SoC
      
       - Added more codecs to meson vdec driver
      
       - Prepare for removing the legacy usbvision driver by moving it to
         staging. This driver has issues and use legacy core APIs. If nobody
         steps up to address those, it is time for its retirement.
      
       - Several cleanups and improvements on drivers, with the addition of
         new supported boards
      
      * tag 'media/v5.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (236 commits)
        media: venus: firmware: Ignore secure call error on first resume
        media: mtk-vpu: load vpu firmware from the new location
        media: i2c: video-i2c: fix build errors due to 'imply hwmon'
        media: MAINTAINERS: add myself to co-maintain Hantro G1/G2 for i.MX8MQ
        media: hantro: add initial i.MX8MQ support
        media: dt-bindings: Document i.MX8MQ VPU bindings
        media: vivid: fix incorrect PA assignment to HDMI outputs
        media: hantro: Add linux-rockchip mailing list to MAINTAINERS
        media: cedrus: h264: Fix 4K decoding on H6
        media: siano: Use scnprintf() for avoiding potential buffer overflow
        media: rc: Use scnprintf() for avoiding potential buffer overflow
        media: allegro: create new struct for channel parameters
        media: allegro: move mail definitions to separate file
        media: allegro: pass buffers through firmware
        media: allegro: verify source and destination buffer in VCU response
        media: allegro: handle dependency of bitrate and bitrate_peak
        media: allegro: read bitrate mode directly from control
        media: allegro: make QP configurable
        media: allegro: make frame rate configurable
        media: allegro: skip filler data if possible
        ...
      063d1942
    • Linus Torvalds's avatar
      Merge tag 'hwmon-for-v5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging · 47acac8c
      Linus Torvalds authored
      Pull hwmon updates from Guenter Roeck:
      
       - New driver for AXI fan control
      
       - Attenuator bypass support and support for inverting pwm output in
         adt7475 driver
      
       - Support for new power supply version in ibm-cffps driver
      
       - PMBus drivers:
      
           * support for multi-phase chips
      
           * ltc2978 driver: add support for LTC2972, LTC2979, LTC3884,
             LTC3889, LTC7880, LTM4664, LTM4677, LTM4678, LTM4680, and
             LTM4700/
      
           * tps53679 driver: add support for TPS53681, TPS53647, and TPS53667
      
           * isl68137 driver: support for various 2nd Gen Renesas digital
             multiphase chips added to isl68137 driver
      
       - Minor improvements and fixes in nct7904, ibmpowernv, lm73, ibmaem,
         and k10temp drivers
      
      * tag 'hwmon-for-v5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (29 commits)
        docs: hwmon: Update documentation for isl68137 pmbus driver
        hwmon: (pmbus) add support for 2nd Gen Renesas digital multiphase
        hwmon: (pmbus/ibm-cffps) Add another PSU CCIN to version detection
        hwmon: (nct7904) Fix the incorrect quantity for fan & temp attributes
        hwmon: (ibmpowernv) Use scnprintf() for avoiding potential buffer overflow
        hwmon: (adt7475) Add support for inverting pwm output
        hwmon: (adt7475) Add attenuator bypass support
        dt-bindings: hwmon: Document adt7475 pwm-active-state property
        dt-bindings: hwmon: Document adt7475 bypass-attenuator property
        dt-bindings: hwmon: Document adt7475 binding
        hwmon: (lm73) Add support for of_match_table
        dt-bindings: Add TI LM73 as a trivial device
        hwmon: (pmbus/tps53679) Add documentation
        hwmon: (pmbus/tps53679) Add support for TPS53647 and TPS53667
        hwmon: (pmbus/tps53679) Add support for TPS53681
        hwmon: (pmbus/tps53679) Add support for IIN and PIN to TPS53679 and TPS53688
        hwmon: (pmbus/tps53679) Add support for multiple chips IDs
        hwmon: (pmbus) Implement multi-phase support
        hwmon: (pmbus) Add 'phase' parameter where needed for multi-phase support
        hwmon: (pmbus) Add IC_DEVICE_ID and IC_DEVICE_REV command definitions
        ...
      47acac8c
    • Linus Torvalds's avatar
      Merge tag 'ras_updates_for_5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · ff7b862a
      Linus Torvalds authored
      Pull RAS updates from Borislav Petkov:
      
       - Do not report spurious MCEs on some Intel platforms caused by errata;
         by Prarit Bhargava.
      
       - Change dev-mcelog's hardcoded limit of 32 error records to a dynamic
         one, controlled by the number of logical CPUs, by Tony Luck.
      
       - Add support for the processor identification number (PPIN) on AMD, by
         Wei Huang.
      
      * tag 'ras_updates_for_5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/mce/amd: Add PPIN support for AMD MCE
        x86/mce/dev-mcelog: Dynamically allocate space for machine check records
        x86/mce: Do not log spurious corrected mce errors
      ff7b862a
    • Linus Torvalds's avatar
      Merge tag 'edac_updates_for_5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras · aaf985e2
      Linus Torvalds authored
      Pull EDAC updates from Borislav Petkov:
      
       - A substantial edac_mc cleanup, sanitizing object freeing,
         streamlining and simplifying code flow, and getting rid of a lot of
         needless complexity in memory controller representation code, by
         Robert Richter.
      
       - A new EDAC driver for the ARM DMC-520 memory controller, by Lei Wang,
         Shiping Ji and others.
      
       - The usual sprinkling of misc cleanups and fixes all over the
         subsystem.
      
      * tag 'edac_updates_for_5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras:
        EDAC/armada_xp: Use scnprintf() for avoiding potential buffer overflow
        EDAC/synopsys: Do not dump uninitialized pinf->col
        EDAC: Add EDAC driver for DMC520
        dt-bindings: edac: Dmc-520.yaml
        EDAC/mce_amd: Print !SMCA processor warning only once
        EDAC/mc: Remove per layer counters
        EDAC/mc: Remove detail[] string and cleanup error string generation
        EDAC/mc: Pass the error descriptor to error reporting functions
        EDAC/mc: Remove enable_per_layer_report function argument
        EDAC/mc: Report "unknown memory" on too many DIMM labels found
        EDAC/mc: Carve out error increment into a separate function
        EDAC/mc: Determine mci pointer from the error descriptor
        EDAC: Store error type in struct edac_raw_error_desc
        EDAC/mc: Reorder functions edac_mc_alloc*()
        EDAC/mc: Split edac_mc_alloc() into smaller functions
        EDAC/mc: Change mci device removal to use put_device()
      aaf985e2
    • Linus Torvalds's avatar
      Merge tag 'pstore-v5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux · c271bdbf
      Linus Torvalds authored
      Pull pstore updates from Kees Cook:
       "These mostly some minor cleanups and a bug fix for an ftrace corner
        case:
      
         - Improve failure paths (chenqiwu)
      
         - Fix ftrace position index (Vasily Averin)
      
         - Use proper flexible-array member (Gustavo A. R. Silva)"
      
      * tag 'pstore-v5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
        pstore/ram: Replace zero-length array with flexible-array member
        pstore: pstore_ftrace_seq_next should increase position index
        pstore/ram: remove unnecessary ramoops_unregister_dummy()
        pstore/platform: fix potential mem leak if pstore_init_fs failed
      c271bdbf
    • Linus Torvalds's avatar
      Merge tag 'seccomp-v5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux · 78b0dedd
      Linus Torvalds authored
      Pull seccomp updates from Kees Cook:
       "A couple of seccomp updates. They're both mostly bug fixes that I
        wanted to have sit in linux-next for a while:
      
         - allow TSYNC and USER_NOTIF together (Tycho Andersen)
      
         - add missing compat_ioctl for notify (Sven Schnelle)"
      
      * tag 'seccomp-v5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
        seccomp: Add missing compat_ioctl for notify
        seccomp: allow TSYNC and USER_NOTIF together
      78b0dedd
    • Linus Torvalds's avatar
      Merge tag 'erofs-for-5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs · 377ad0c2
      Linus Torvalds authored
      Pull erofs updates from Gao Xiang:
       "Updates with a XArray adaptation, several fixes for shrinker and
        corrupted images are ready for this cycle.
      
        All commits have been stress tested with no noticeable smoke out and
        have been in linux-next as well.
      
        Summary:
      
         - Convert radix tree usage to XArray
      
         - Fix shrink scan count on multiple filesystem instances
      
         - Better handling for specific corrupted images
      
         - Update my email address in MAINTAINERS"
      
      * tag 'erofs-for-5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs:
        MAINTAINERS: erofs: update my email address
        erofs: handle corrupted images whose decompressed size less than it'd be
        erofs: use LZ4_decompress_safe() for full decoding
        erofs: correct the remaining shrink objects
        erofs: convert workstn to XArray
      377ad0c2
    • Linus Torvalds's avatar
      Merge tag 'docs-5.7' of git://git.lwn.net/linux · 481ed297
      Linus Torvalds authored
      Pull documentation updates from Jonathan Corbet:
       "This has been a busy cycle for documentation work.
      
        Highlights include:
      
         - Lots of RST conversion work by Mauro, Daniel ALmeida, and others.
           Maybe someday we'll get to the end of this stuff...maybe...
      
         - Some organizational work to bring some order to the core-api
           manual.
      
         - Various new docs and additions to the existing documentation.
      
         - Typo fixes, warning fixes, ..."
      
      * tag 'docs-5.7' of git://git.lwn.net/linux: (123 commits)
        Documentation: x86: exception-tables: document CONFIG_BUILDTIME_TABLE_SORT
        MAINTAINERS: adjust to filesystem doc ReST conversion
        docs: deprecated.rst: Add BUG()-family
        doc: zh_CN: add translation for virtiofs
        doc: zh_CN: index files in filesystems subdirectory
        docs: locking: Drop :c:func: throughout
        docs: locking: Add 'need' to hardirq section
        docs: conf.py: avoid thousands of duplicate label warning on Sphinx
        docs: prevent warnings due to autosectionlabel
        docs: fix reference to core-api/namespaces.rst
        docs: fix pointers to io-mapping.rst and io_ordering.rst files
        Documentation: Better document the softlockup_panic sysctl
        docs: hw-vuln: tsx_async_abort.rst: get rid of an unused ref
        docs: perf: imx-ddr.rst: get rid of a warning
        docs: filesystems: fuse.rst: supress a Sphinx warning
        docs: translations: it: avoid duplicate refs at programming-language.rst
        docs: driver.rst: supress two ReSt warnings
        docs: trace: events.rst: convert some new stuff to ReST format
        Documentation: Add io_ordering.rst to driver-api manual
        Documentation: Add io-mapping.rst to driver-api manual
        ...
      481ed297
    • Linus Torvalds's avatar
      Merge tag 'for-5.7/io_uring-2020-03-29' of git://git.kernel.dk/linux-block · e59cd880
      Linus Torvalds authored
      Pull io_uring updates from Jens Axboe:
       "Here are the io_uring changes for this merge window. Light on new
        features this time around (just splice + buffer selection), lots of
        cleanups, fixes, and improvements to existing support. In particular,
        this contains:
      
         - Cleanup fixed file update handling for stack fallback (Hillf)
      
         - Re-work of how pollable async IO is handled, we no longer require
           thread offload to handle that. Instead we rely using poll to drive
           this, with task_work execution.
      
         - In conjunction with the above, allow expendable buffer selection,
           so that poll+recv (for example) no longer has to be a split
           operation.
      
         - Make sure we honor RLIMIT_FSIZE for buffered writes
      
         - Add support for splice (Pavel)
      
         - Linked work inheritance fixes and optimizations (Pavel)
      
         - Async work fixes and cleanups (Pavel)
      
         - Improve io-wq locking (Pavel)
      
         - Hashed link write improvements (Pavel)
      
         - SETUP_IOPOLL|SETUP_SQPOLL improvements (Xiaoguang)"
      
      * tag 'for-5.7/io_uring-2020-03-29' of git://git.kernel.dk/linux-block: (54 commits)
        io_uring: cleanup io_alloc_async_ctx()
        io_uring: fix missing 'return' in comment
        io-wq: handle hashed writes in chains
        io-uring: drop 'free_pfile' in struct io_file_put
        io-uring: drop completion when removing file
        io_uring: Fix ->data corruption on re-enqueue
        io-wq: close cancel gap for hashed linked work
        io_uring: make spdxcheck.py happy
        io_uring: honor original task RLIMIT_FSIZE
        io-wq: hash dependent work
        io-wq: split hashing and enqueueing
        io-wq: don't resched if there is no work
        io-wq: remove duplicated cancel code
        io_uring: fix truncated async read/readv and write/writev retry
        io_uring: dual license io_uring.h uapi header
        io_uring: io_uring_enter(2) don't poll while SETUP_IOPOLL|SETUP_SQPOLL enabled
        io_uring: Fix unused function warnings
        io_uring: add end-of-bits marker and build time verify it
        io_uring: provide means of removing buffers
        io_uring: add IOSQE_BUFFER_SELECT support for IORING_OP_RECVMSG
        ...
      e59cd880
    • Linus Torvalds's avatar
      Merge tag 'for-5.7/drivers-2020-03-29' of git://git.kernel.dk/linux-block · 15926148
      Linus Torvalds authored
      Pull block driver updates from Jens Axboe:
      
       - floppy driver cleanup series from Willy
      
       - NVMe updates and fixes (Various)
      
       - null_blk trace improvements (Chaitanya)
      
       - bcache fixes (Coly)
      
       - md fixes (via Song)
      
       - loop block size change optimizations (Martijn)
      
       - scnprintf() use (Takashi)
      
      * tag 'for-5.7/drivers-2020-03-29' of git://git.kernel.dk/linux-block: (81 commits)
        null_blk: add trace in null_blk_zoned.c
        null_blk: add tracepoint helpers for zoned mode
        block: add a zone condition debug helper
        nvme: cleanup namespace identifier reporting in nvme_init_ns_head
        nvme: rename __nvme_find_ns_head to nvme_find_ns_head
        nvme: refactor nvme_identify_ns_descs error handling
        nvme-tcp: Add warning on state change failure at nvme_tcp_setup_ctrl
        nvme-rdma: Add warning on state change failure at nvme_rdma_setup_ctrl
        nvme: Fix controller creation races with teardown flow
        nvme: Make nvme_uninit_ctrl symmetric to nvme_init_ctrl
        nvme: Fix ctrl use-after-free during sysfs deletion
        nvme-pci: Re-order nvme_pci_free_ctrl
        nvme: Remove unused return code from nvme_delete_ctrl_sync
        nvme: Use nvme_state_terminal helper
        nvme: release ida resources
        nvme: Add compat_ioctl handler for NVME_IOCTL_SUBMIT_IO
        nvmet-tcp: optimize tcp stack TX when data digest is used
        nvme-fabrics: Use scnprintf() for avoiding potential buffer overflow
        nvme-multipath: do not reset on unknown status
        nvmet-rdma: allocate RW ctxs according to mdts
        ...
      15926148
    • Linus Torvalds's avatar
      Merge tag 'for-5.7/block-2020-03-29' of git://git.kernel.dk/linux-block · 10f36b1e
      Linus Torvalds authored
      Pull block updates from Jens Axboe:
      
       - Online capacity resizing (Balbir)
      
       - Number of hardware queue change fixes (Bart)
      
       - null_blk fault injection addition (Bart)
      
       - Cleanup of queue allocation, unifying the node/no-node API
         (Christoph)
      
       - Cleanup of genhd, moving code to where it makes sense (Christoph)
      
       - Cleanup of the partition handling code (Christoph)
      
       - disk stat fixes/improvements (Konstantin)
      
       - BFQ improvements (Paolo)
      
       - Various fixes and improvements
      
      * tag 'for-5.7/block-2020-03-29' of git://git.kernel.dk/linux-block: (72 commits)
        block: return NULL in blk_alloc_queue() on error
        block: move bio_map_* to blk-map.c
        Revert "blkdev: check for valid request queue before issuing flush"
        block: simplify queue allocation
        bcache: pass the make_request methods to blk_queue_make_request
        null_blk: use blk_mq_init_queue_data
        block: add a blk_mq_init_queue_data helper
        block: move the ->devnode callback to struct block_device_operations
        block: move the part_stat* helpers from genhd.h to a new header
        block: move block layer internals out of include/linux/genhd.h
        block: move guard_bio_eod to bio.c
        block: unexport get_gendisk
        block: unexport disk_map_sector_rcu
        block: unexport disk_get_part
        block: mark part_in_flight and part_in_flight_rw static
        block: mark block_depr static
        block: factor out requeue handling from dispatch code
        block/diskstats: replace time_in_queue with sum of request times
        block/diskstats: accumulate all per-cpu counters in one pass
        block/diskstats: more accurate approximation of io_ticks for slow disks
        ...
      10f36b1e
    • Linus Torvalds's avatar
      Merge tag 'for-5.7/libata-2020-03-29' of git://git.kernel.dk/linux-block · 3a0eb192
      Linus Torvalds authored
      Pull libata updates from Jens Axboe:
      
       - Series from Bart, making the libata code smaller on PATA only setups.
         This is useful for smaller/embedded use cases, and will help us move
         some of those off drivers/ide.
      
       - Kill unused BPRINTK() (Hannes)
      
       - Add various Comet Lake ahci PCI ids (Kai-Heng, Mika)
      
       - Fix for a double scsi_host_put() in error handling (John)
      
       - Use scnprintf (Takashi)
      
       - Assign OF node to the SCSI device (Linus Walleij)
      
      * tag 'for-5.7/libata-2020-03-29' of git://git.kernel.dk/linux-block: (36 commits)
        ata: make "libata.force" kernel parameter optional
        ata: move ata_eh_analyze_ncq_error() & co. to libata-sata.c
        ata: start separating SATA specific code from libata-eh.c
        ata: move ata_sas_*() to libata-sata.c
        ata: start separating SATA specific code from libata-scsi.c
        ata: move sata_deb_timing_*() to libata-sata.c
        ata: move ata_qc_complete_multiple() to libata-sata.c
        ata: move sata_link_hardreset() to libata-sata.c
        ata: move sata_link_{debounce,resume}() to libata-sata.c
        ata: move *sata_set_spd*() to libata-sata.c
        ata: move sata_scr_*() to libata-sata.c
        ata: start separating SATA specific code from libata-core.c
        ata: let compiler optimize out ata_eh_set_lpm() on non-SATA hosts
        ata: let compiler optimize out ata_dev_config_ncq() on non-SATA hosts
        ata: add CONFIG_SATA_HOST=n version of ata_ncq_enabled()
        ata: separate PATA timings code from libata-core.c
        ata: fix CodingStyle issues in PATA timings code
        ata: remove EXPORT_SYMBOL_GPL()s not used by modules
        ata: move EXPORT_SYMBOL_GPL()s close to exported code
        ata: optimize ata_scsi_rbuf[] size
        ...
      3a0eb192
    • Linus Torvalds's avatar
      Merge tag 'i3c/for-5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux · c03cb664
      Linus Torvalds authored
      Pull i3c updates from Boris Brezillon:
      
       - Fix driver auto-probing related issues
      
       - Stop using the deprecated i2c_new_device() function
      
       - Replace zero-length array with flexible-array member
      
      * tag 'i3c/for-5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux:
        i3c: convert to use i2c_new_client_device()
        i3c: master: Replace zero-length array with flexible-array member
        i3c: Simplify i3c_device_match_id()
        i3c: Generate aliases for i3c modules
        i3c: Add a modalias sysfs attribute
        i3c: Fix MODALIAS uevents
        i3c: master: no need to iterate master device twice
      c03cb664
    • Linus Torvalds's avatar
      Merge tag 'tpmdd-next-20200316' of git://git.infradead.org/users/jjs/linux-tpmdd · 0f751396
      Linus Torvalds authored
      Pull tpm updates from Jarkko Sakkinen:
       "tpmdd updates for Linux v5.7"
      
      * tag 'tpmdd-next-20200316' of git://git.infradead.org/users/jjs/linux-tpmdd:
        KEYS: reaching the keys quotas correctly
        tpm: ibmvtpm: Add support for TPM2
        tpm: ibmvtpm: Wait for buffer to be set before proceeding
        tpm: of: Handle IBM,vtpm20 case when getting log parameters
        MAINTAINERS: adjust to trusted keys subsystem creation
        tpm: tpm_tis_spi_cr50: use new structure for SPI transfer delays
        tpm_tis_spi: use new 'delay' structure for SPI transfer delays
        tpm: tpm2_bios_measurements_next should increase position index
        tpm: tpm1_bios_measurements_next should increase position index
        tpm: Don't make log failures fatal
      0f751396
    • Rafael J. Wysocki's avatar
      Merge branches 'pm-devfreq', 'powercap' and 'pm-docs' · 2409000a
      Rafael J. Wysocki authored
      * pm-devfreq:
        PM / devfreq: Get rid of some doc warnings
        PM / devfreq: Fix handling dev_pm_qos_remove_request result
        PM / devfreq: Fix a typo in a comment
        PM / devfreq: Change to DEVFREQ_GOV_UPDATE_INTERVAL event name
        PM / devfreq: Remove unneeded extern keyword
        PM / devfreq: Use constant name of userspace governor
      
      * powercap:
        powercap: idle_inject: Replace zero-length array with flexible-array member
      
      * pm-docs:
        docs: cpu-freq: convert cpufreq-stats.txt to ReST
        docs: cpu-freq: convert cpu-drivers.txt to ReST
        docs: cpu-freq: convert core.txt to ReST
        docs: cpu-freq: convert index.txt to ReST
        docs: cpufreq: fix a broken reference
        Documentation: cpufreq: Move legacy driver documentation
      2409000a
    • Rafael J. Wysocki's avatar
      Merge branches 'pm-core', 'pm-sleep', 'pm-acpi' and 'pm-domains' · ada0629b
      Rafael J. Wysocki authored
      * pm-core:
        PM: runtime: Add pm_runtime_get_if_active()
      
      * pm-sleep:
        PM: sleep: wakeup: Skip wakeup_source_sysfs_remove() if device is not there
        PM / hibernate: Remove unnecessary compat ioctl overrides
        PM: hibernate: fix docs for ioctls that return loff_t via pointer
        PM: sleep: wakeup: Use built-in RCU list checking
        PM: sleep: core: Use built-in RCU list checking
      
      * pm-acpi:
        ACPI: PM: s2idle: Refine active GPEs check
        ACPICA: Allow acpi_any_gpe_status_set() to skip one GPE
        ACPI: PM: s2idle: Fix comment in acpi_s2idle_prepare_late()
      
      * pm-domains:
        cpuidle: psci: Split psci_dt_cpu_init_idle()
        PM / Domains: Allow no domain-idle-states DT property in genpd when parsing
      ada0629b
    • Rafael J. Wysocki's avatar
      Merge branch 'pm-cpufreq' · 0411f0d1
      Rafael J. Wysocki authored
      * pm-cpufreq:
        cpufreq: intel_pstate: Simplify intel_pstate_cpu_init()
        cpufreq: qcom: Add support for krait based socs
        cpufreq: imx6q-cpufreq: Improve the logic of -EPROBE_DEFER handling
        cpufreq: Use scnprintf() for avoiding potential buffer overflow
        Documentation: intel_pstate: update links for references
        cpufreq: intel_pstate: Consolidate policy verification
        cpufreq: dt: Allow platform specific intermediate callbacks
        cpufreq: imx-cpufreq-dt: Correct i.MX8MP's market segment fuse location
        cpufreq: imx6q: read OCOTP through nvmem for imx6q
        cpufreq: imx6q: fix error handling
        cpufreq: imx-cpufreq-dt: Add "cpu-supply" property check
        cpufreq: ti-cpufreq: Add support for OPP_PLUS
        cpufreq: imx6q: Fixes unwanted cpu overclocking on i.MX6ULL
      0411f0d1
    • Rafael J. Wysocki's avatar
      Merge branch 'pm-cpuidle' · be4f6540
      Rafael J. Wysocki authored
      * pm-cpuidle:
        cpuidle: haltpoll: allow force loading on hosts without the REALTIME hint
        intel_idle: Update copyright notice, known limitations and version
        intel_idle: Define CPUIDLE_FLAG_TLB_FLUSHED as BIT(16)
        intel_idle: Clean up kerneldoc comments for multiple functions
        intel_idle: Reorder declarations of static variables
        intel_idle: Annotate init time data structures
        intel_idle: Add __initdata annotations to init time variables
        intel_idle: Relocate definitions of cpuidle callbacks
        intel_idle: Clean up definitions of cpuidle callbacks
        intel_idle: Simplify LAPIC timer reliability checks
      be4f6540
    • Rafael J. Wysocki's avatar
      Merge branch 'pm-qos' · 8f1073ed
      Rafael J. Wysocki authored
      * pm-qos: (30 commits)
        PM: QoS: annotate data races in pm_qos_*_value()
        Documentation: power: fix pm_qos_interface.rst format warning
        PM: QoS: Make CPU latency QoS depend on CONFIG_CPU_IDLE
        Documentation: PM: QoS: Update to reflect previous code changes
        PM: QoS: Update file information comments
        PM: QoS: Drop PM_QOS_CPU_DMA_LATENCY and rename related functions
        sound: Call cpu_latency_qos_*() instead of pm_qos_*()
        drivers: usb: Call cpu_latency_qos_*() instead of pm_qos_*()
        drivers: tty: Call cpu_latency_qos_*() instead of pm_qos_*()
        drivers: spi: Call cpu_latency_qos_*() instead of pm_qos_*()
        drivers: net: Call cpu_latency_qos_*() instead of pm_qos_*()
        drivers: mmc: Call cpu_latency_qos_*() instead of pm_qos_*()
        drivers: media: Call cpu_latency_qos_*() instead of pm_qos_*()
        drivers: hsi: Call cpu_latency_qos_*() instead of pm_qos_*()
        drm: i915: Call cpu_latency_qos_*() instead of pm_qos_*()
        x86: platform: iosf_mbi: Call cpu_latency_qos_*() instead of pm_qos_*()
        cpuidle: Call cpu_latency_qos_limit() instead of pm_qos_request()
        PM: QoS: Add CPU latency QoS API wrappers
        PM: QoS: Adjust pm_qos_request() signature and reorder pm_qos.h
        PM: QoS: Simplify definitions of CPU latency QoS trace events
        ...
      8f1073ed
    • Mark Brown's avatar
      6dfae59d
    • Stanimir Varbanov's avatar
      media: venus: firmware: Ignore secure call error on first resume · 2632e7b6
      Stanimir Varbanov authored
      With the latest cleanup in qcom scm driver the secure monitor
      call for setting the remote processor state returns EINVAL when
      it is called for the first time and after another scm call
      auth_and_reset. The error returned from scm call could be ignored
      because the state transition is already done in auth_and_reset.
      Acked-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
      Signed-off-by: default avatarStanimir Varbanov <stanimir.varbanov@linaro.org>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      2632e7b6
    • Borislav Petkov's avatar
      Merge branches 'edac-mc-cleanup', 'edac-misc', 'edac-drivers' and... · 41dac9a2
      Borislav Petkov authored
      Merge branches 'edac-mc-cleanup', 'edac-misc', 'edac-drivers' and 'edac-urgent' into edac-updates-for-5.7
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      41dac9a2
    • Sven Schnelle's avatar
      seccomp: Add missing compat_ioctl for notify · 3db81afd
      Sven Schnelle authored
      Executing the seccomp_bpf testsuite under a 64-bit kernel with 32-bit
      userland (both s390 and x86) doesn't work because there's no compat_ioctl
      handler defined. Add the handler.
      Signed-off-by: default avatarSven Schnelle <svens@linux.ibm.com>
      Fixes: 6a21cc50 ("seccomp: add a return code to trap to userspace")
      Cc: stable@vger.kernel.org
      Link: https://lore.kernel.org/r/20200310123332.42255-1-svens@linux.ibm.comSigned-off-by: default avatarKees Cook <keescook@chromium.org>
      3db81afd
  2. 29 Mar, 2020 11 commits
    • Linus Torvalds's avatar
      Linux 5.6 · 7111951b
      Linus Torvalds authored
      7111951b
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · 570203ec
      Linus Torvalds authored
      Merge vm fixes from Andrew Morton:
       "5 fixes"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        mm/sparse: fix kernel crash with pfn_section_valid check
        mm: fork: fix kernel_stack memcg stats for various stack implementations
        hugetlb_cgroup: fix illegal access to memory
        drivers/base/memory.c: indicate all memory blocks as removable
        mm/swapfile.c: move inode_lock out of claim_swapfile
      570203ec
    • Linus Torvalds's avatar
      Merge tag 'timers-urgent-2020-03-29' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · ab93e984
      Linus Torvalds authored
      Pull timer fix from Thomas Gleixner:
       "A single fix for the Hyper-V clocksource driver to make sched clock
        actually return nanoseconds and not the virtual clock value which
        increments at 10e7 HZ (100ns)"
      
      * tag 'timers-urgent-2020-03-29' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        clocksource/drivers/hyper-v: Make sched clock return nanoseconds correctly
      ab93e984
    • Linus Torvalds's avatar
      Merge tag 'irq-urgent-2020-03-29' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 01af08bd
      Linus Torvalds authored
      Pull irq fix from Thomas Gleixner:
       "A single bugfix to prevent reference leaks in irq affinity notifiers"
      
      * tag 'irq-urgent-2020-03-29' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        genirq: Fix reference leaks on irq affinity notifiers
      01af08bd
    • Aneesh Kumar K.V's avatar
      mm/sparse: fix kernel crash with pfn_section_valid check · b943f045
      Aneesh Kumar K.V authored
      Fix the crash like this:
      
          BUG: Kernel NULL pointer dereference on read at 0x00000000
          Faulting instruction address: 0xc000000000c3447c
          Oops: Kernel access of bad area, sig: 11 [#1]
          LE PAGE_SIZE=64K MMU=Hash SMP NR_CPUS=2048 NUMA pSeries
          CPU: 11 PID: 7519 Comm: lt-ndctl Not tainted 5.6.0-rc7-autotest #1
          ...
          NIP [c000000000c3447c] vmemmap_populated+0x98/0xc0
          LR [c000000000088354] vmemmap_free+0x144/0x320
          Call Trace:
             section_deactivate+0x220/0x240
             __remove_pages+0x118/0x170
             arch_remove_memory+0x3c/0x150
             memunmap_pages+0x1cc/0x2f0
             devm_action_release+0x30/0x50
             release_nodes+0x2f8/0x3e0
             device_release_driver_internal+0x168/0x270
             unbind_store+0x130/0x170
             drv_attr_store+0x44/0x60
             sysfs_kf_write+0x68/0x80
             kernfs_fop_write+0x100/0x290
             __vfs_write+0x3c/0x70
             vfs_write+0xcc/0x240
             ksys_write+0x7c/0x140
             system_call+0x5c/0x68
      
      The crash is due to NULL dereference at
      
      	test_bit(idx, ms->usage->subsection_map);
      
      due to ms->usage = NULL in pfn_section_valid()
      
      With commit d41e2f3b ("mm/hotplug: fix hot remove failure in
      SPARSEMEM|!VMEMMAP case") section_mem_map is set to NULL after
      depopulate_section_mem().  This was done so that pfn_page() can work
      correctly with kernel config that disables SPARSEMEM_VMEMMAP.  With that
      config pfn_to_page does
      
      	__section_mem_map_addr(__sec) + __pfn;
      
      where
      
        static inline struct page *__section_mem_map_addr(struct mem_section *section)
        {
      	unsigned long map = section->section_mem_map;
      	map &= SECTION_MAP_MASK;
      	return (struct page *)map;
        }
      
      Now with SPASEMEM_VMEMAP enabled, mem_section->usage->subsection_map is
      used to check the pfn validity (pfn_valid()).  Since section_deactivate
      release mem_section->usage if a section is fully deactivated,
      pfn_valid() check after a subsection_deactivate cause a kernel crash.
      
        static inline int pfn_valid(unsigned long pfn)
        {
        ...
      	return early_section(ms) || pfn_section_valid(ms, pfn);
        }
      
      where
      
        static inline int pfn_section_valid(struct mem_section *ms, unsigned long pfn)
        {
      	int idx = subsection_map_index(pfn);
      
      	return test_bit(idx, ms->usage->subsection_map);
        }
      
      Avoid this by clearing SECTION_HAS_MEM_MAP when mem_section->usage is
      freed.  For architectures like ppc64 where large pages are used for
      vmmemap mapping (16MB), a specific vmemmap mapping can cover multiple
      sections.  Hence before a vmemmap mapping page can be freed, the kernel
      needs to make sure there are no valid sections within that mapping.
      Clearing the section valid bit before depopulate_section_memap enables
      this.
      
      [aneesh.kumar@linux.ibm.com: add comment]
        Link: http://lkml.kernel.org/r/20200326133235.343616-1-aneesh.kumar@linux.ibm.comLink: http://lkml.kernel.org/r/20200325031914.107660-1-aneesh.kumar@linux.ibm.com
      Fixes: d41e2f3b ("mm/hotplug: fix hot remove failure in SPARSEMEM|!VMEMMAP case")
      Reported-by: default avatarSachin Sant <sachinp@linux.vnet.ibm.com>
      Signed-off-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Tested-by: default avatarSachin Sant <sachinp@linux.vnet.ibm.com>
      Reviewed-by: default avatarBaoquan He <bhe@redhat.com>
      Reviewed-by: default avatarWei Yang <richard.weiyang@gmail.com>
      Acked-by: default avatarMichal Hocko <mhocko@suse.com>
      Acked-by: default avatarPankaj Gupta <pankaj.gupta.linux@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: Oscar Salvador <osalvador@suse.de>
      Cc: Mike Rapoport <rppt@linux.ibm.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b943f045
    • Roman Gushchin's avatar
      mm: fork: fix kernel_stack memcg stats for various stack implementations · 8380ce47
      Roman Gushchin authored
      Depending on CONFIG_VMAP_STACK and the THREAD_SIZE / PAGE_SIZE ratio the
      space for task stacks can be allocated using __vmalloc_node_range(),
      alloc_pages_node() and kmem_cache_alloc_node().
      
      In the first and the second cases page->mem_cgroup pointer is set, but
      in the third it's not: memcg membership of a slab page should be
      determined using the memcg_from_slab_page() function, which looks at
      page->slab_cache->memcg_params.memcg .  In this case, using
      mod_memcg_page_state() (as in account_kernel_stack()) is incorrect:
      page->mem_cgroup pointer is NULL even for pages charged to a non-root
      memory cgroup.
      
      It can lead to kernel_stack per-memcg counters permanently showing 0 on
      some architectures (depending on the configuration).
      
      In order to fix it, let's introduce a mod_memcg_obj_state() helper,
      which takes a pointer to a kernel object as a first argument, uses
      mem_cgroup_from_obj() to get a RCU-protected memcg pointer and calls
      mod_memcg_state().  It allows to handle all possible configurations
      (CONFIG_VMAP_STACK and various THREAD_SIZE/PAGE_SIZE values) without
      spilling any memcg/kmem specifics into fork.c .
      
      Note: This is a special version of the patch created for stable
      backports.  It contains code from the following two patches:
        - mm: memcg/slab: introduce mem_cgroup_from_obj()
        - mm: fork: fix kernel_stack memcg stats for various stack implementations
      
      [guro@fb.com: introduce mem_cgroup_from_obj()]
        Link: http://lkml.kernel.org/r/20200324004221.GA36662@carbon.dhcp.thefacebook.com
      Fixes: 4d96ba35 ("mm: memcg/slab: stop setting page->mem_cgroup pointer for slab pages")
      Signed-off-by: default avatarRoman Gushchin <guro@fb.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Reviewed-by: default avatarShakeel Butt <shakeelb@google.com>
      Acked-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
      Cc: Michal Hocko <mhocko@kernel.org>
      Cc: Bharata B Rao <bharata@linux.ibm.com>
      Cc: Shakeel Butt <shakeelb@google.com>
      Cc: <stable@vger.kernel.org>
      Link: http://lkml.kernel.org/r/20200303233550.251375-1-guro@fb.comSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      8380ce47
    • Mina Almasry's avatar
      hugetlb_cgroup: fix illegal access to memory · 726b7bbe
      Mina Almasry authored
      This appears to be a mistake in commit faced7e0 ("mm: hugetlb
      controller for cgroups v2").
      
      Essentially that commit does a hugetlb_cgroup_from_counter assuming that
      page_counter_try_charge has initialized counter.
      
      But if that has failed then it seems will not initialize counter, so
      hugetlb_cgroup_from_counter(counter) ends up pointing to random memory,
      causing kasan to complain.
      
      The solution is to simply use 'h_cg', instead of
      hugetlb_cgroup_from_counter(counter), since that is a reference to the
      hugetlb_cgroup anyway.  After this change kasan ceases to complain.
      
      Fixes: faced7e0 ("mm: hugetlb controller for cgroups v2")
      Reported-by: syzbot+cac0c4e204952cf449b1@syzkaller.appspotmail.com
      Signed-off-by: default avatarMina Almasry <almasrymina@google.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarGiuseppe Scrivano <gscrivan@redhat.com>
      Acked-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Mike Kravetz <mike.kravetz@oracle.com>
      Cc: David Rientjes <rientjes@google.com>
      Link: http://lkml.kernel.org/r/20200313223920.124230-1-almasrymina@google.comSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      726b7bbe
    • David Hildenbrand's avatar
      drivers/base/memory.c: indicate all memory blocks as removable · 53cdc1cb
      David Hildenbrand authored
      We see multiple issues with the implementation/interface to compute
      whether a memory block can be offlined (exposed via
      /sys/devices/system/memory/memoryX/removable) and would like to simplify
      it (remove the implementation).
      
      1. It runs basically lockless. While this might be good for performance,
         we see possible races with memory offlining that will require at
         least some sort of locking to fix.
      
      2. Nowadays, more false positives are possible. No arch-specific checks
         are performed that validate if memory offlining will not be denied
         right away (and such check will require locking). For example, arm64
         won't allow to offline any memory block that was added during boot -
         which will imply a very high error rate. Other archs have other
         constraints.
      
      3. The interface is inherently racy. E.g., if a memory block is detected
         to be removable (and was not a false positive at that time), there is
         still no guarantee that offlining will actually succeed. So any
         caller already has to deal with false positives.
      
      4. It is unclear which performance benefit this interface actually
         provides. The introducing commit 5c755e9f ("memory-hotplug: add
         sysfs removable attribute for hotplug memory remove") mentioned
      
      	"A user-level agent must be able to identify which sections
      	 of memory are likely to be removable before attempting the
      	 potentially expensive operation."
      
         However, no actual performance comparison was included.
      
      Known users:
      
       - lsmem: Will group memory blocks based on the "removable" property. [1]
      
       - chmem: Indirect user. It has a RANGE mode where one can specify
                removable ranges identified via lsmem to be offlined. However,
                it also has a "SIZE" mode, which allows a sysadmin to skip the
                manual "identify removable blocks" step. [2]
      
       - powerpc-utils: Uses the "removable" attribute to skip some memory
                blocks right away when trying to find some to offline+remove.
                However, with ballooning enabled, it already skips this
                information completely (because it once resulted in many false
                negatives). Therefore, the implementation can deal with false
                positives properly already. [3]
      
      According to Nathan Fontenot, DLPAR on powerpc is nowadays no longer
      driven from userspace via the drmgr command (powerpc-utils).  Nowadays
      it's managed in the kernel - including onlining/offlining of memory
      blocks - triggered by drmgr writing to /sys/kernel/dlpar.  So the
      affected legacy userspace handling is only active on old kernels.  Only
      very old versions of drmgr on a new kernel (unlikely) might execute
      slower - totally acceptable.
      
      With CONFIG_MEMORY_HOTREMOVE, always indicating "removable" should not
      break any user space tool.  We implement a very bad heuristic now.
      Without CONFIG_MEMORY_HOTREMOVE we cannot offline anything, so report
      "not removable" as before.
      
      Original discussion can be found in [4] ("[PATCH RFC v1] mm:
      is_mem_section_removable() overhaul").
      
      Other users of is_mem_section_removable() will be removed next, so that
      we can remove is_mem_section_removable() completely.
      
      [1] http://man7.org/linux/man-pages/man1/lsmem.1.html
      [2] http://man7.org/linux/man-pages/man8/chmem.8.html
      [3] https://github.com/ibm-power-utilities/powerpc-utils
      [4] https://lkml.kernel.org/r/20200117105759.27905-1-david@redhat.com
      
      Also, this patch probably fixes a crash reported by Steve.
      http://lkml.kernel.org/r/CAPcyv4jpdaNvJ67SkjyUJLBnBnXXQv686BiVW042g03FUmWLXw@mail.gmail.comReported-by: default avatar"Scargall, Steve" <steve.scargall@intel.com>
      Suggested-by: default avatarMichal Hocko <mhocko@kernel.org>
      Signed-off-by: default avatarDavid Hildenbrand <david@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Reviewed-by: default avatarNathan Fontenot <ndfont@gmail.com>
      Acked-by: default avatarMichal Hocko <mhocko@suse.com>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: "Rafael J. Wysocki" <rafael@kernel.org>
      Cc: Badari Pulavarty <pbadari@us.ibm.com>
      Cc: Robert Jennings <rcj@linux.vnet.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Karel Zak <kzak@redhat.com>
      Cc: <stable@vger.kernel.org>
      Link: http://lkml.kernel.org/r/20200128093542.6908-1-david@redhat.comSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      53cdc1cb
    • Naohiro Aota's avatar
      mm/swapfile.c: move inode_lock out of claim_swapfile · d795a90e
      Naohiro Aota authored
      claim_swapfile() currently keeps the inode locked when it is successful,
      or the file is already swapfile (with -EBUSY).  And, on the other error
      cases, it does not lock the inode.
      
      This inconsistency of the lock state and return value is quite confusing
      and actually causing a bad unlock balance as below in the "bad_swap"
      section of __do_sys_swapon().
      
      This commit fixes this issue by moving the inode_lock() and IS_SWAPFILE
      check out of claim_swapfile().  The inode is unlocked in
      "bad_swap_unlock_inode" section, so that the inode is ensured to be
      unlocked at "bad_swap".  Thus, error handling codes after the locking now
      jumps to "bad_swap_unlock_inode" instead of "bad_swap".
      
          =====================================
          WARNING: bad unlock balance detected!
          5.5.0-rc7+ #176 Not tainted
          -------------------------------------
          swapon/4294 is trying to release lock (&sb->s_type->i_mutex_key) at: __do_sys_swapon+0x94b/0x3550
          but there are no more locks to release!
      
          other info that might help us debug this:
          no locks held by swapon/4294.
      
          stack backtrace:
          CPU: 5 PID: 4294 Comm: swapon Not tainted 5.5.0-rc7-BTRFS-ZNS+ #176
          Hardware name: ASUS All Series/H87-PRO, BIOS 2102 07/29/2014
          Call Trace:
           dump_stack+0xa1/0xea
           print_unlock_imbalance_bug.cold+0x114/0x123
           lock_release+0x562/0xed0
           up_write+0x2d/0x490
           __do_sys_swapon+0x94b/0x3550
           __x64_sys_swapon+0x54/0x80
           do_syscall_64+0xa4/0x4b0
           entry_SYSCALL_64_after_hwframe+0x49/0xbe
          RIP: 0033:0x7f15da0a0dc7
      
      Fixes: 1638045c ("mm: set S_SWAPFILE on blockdev swap devices")
      Signed-off-by: default avatarNaohiro Aota <naohiro.aota@wdc.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Tested-by: default avatarQais Youef <qais.yousef@arm.com>
      Reviewed-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: <stable@vger.kernel.org>
      Link: http://lkml.kernel.org/r/20200206090132.154869-1-naohiro.aota@wdc.comSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d795a90e
    • Chaitanya Kulkarni's avatar
      block: return NULL in blk_alloc_queue() on error · 654a3667
      Chaitanya Kulkarni authored
      This patch fixes follwoing warning:
      
      block/blk-core.c: In function ‘blk_alloc_queue’:
      block/blk-core.c:558:10: warning: returning ‘int’ from a function with return type ‘struct request_queue *’ makes pointer from integer without a cast [-Wint-conversion]
         return -EINVAL;
      
      Fixes: 3d745ea5 ("block: simplify queue allocation")
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      654a3667
    • Wolfram Sang's avatar