Skip to content
  1. Jun 11, 2020
    • Aneesh Kumar K.V's avatar
      mm/debug_vm_pgtable: fix kernel crash by checking for THP support · 787d563b
      Aneesh Kumar K.V authored
      Architectures can have CONFIG_TRANSPARENT_HUGEPAGE enabled but no THP
      support enabled based on platforms.  For ex: with 4K PAGE_SIZE ppc64
      supports THP only with radix translation.
      
      This results in below crash when running with hash translation and 4K
      PAGE_SIZE.
      
          kernel BUG at arch/powerpc/include/asm/book3s/64/hash-4k.h:140!
          cpu 0x61: Vector: 700 (Program Check) at [c000000ff948f860]
              pc: debug_vm_pgtable+0x480/0x8b0
              lr: debug_vm_pgtable+0x474/0x8b0
          ...
              debug_vm_pgtable+0x374/0x8b0 (unreliable)
              do_one_initcall+0x98/0x4f0
              kernel_init_freeable+0x330/0x3fc
              kernel_init+0x24/0x148
      
      Check for THP support correctly
      
      Link: http://lkml.kernel.org/r/20200608125252.407659-1-aneesh.kumar@linux.ibm.com
      
      
      Fixes: 399145f9 ("mm/debug: add tests validating architecture page table helpers")
      Signed-off-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
      Reviewed-by: default avatarAnshuman Khandual <anshuman.khandual@arm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      787d563b
    • Alexander Gordeev's avatar
      lib: fix bitmap_parse() on 64-bit big endian archs · 81c4f4d9
      Alexander Gordeev authored
      Commit 2d626158 ("lib: rework bitmap_parse()") does not take into
      account order of halfwords on 64-bit big endian architectures.  As
      result (at least) Receive Packet Steering, IRQ affinity masks and
      runtime kernel test "test_bitmap" get broken on s390.
      
      [andriy.shevchenko@linux.intel.com: convert infinite while loop to a for loop]
        Link: http://lkml.kernel.org/r/20200609140535.87160-1-andriy.shevchenko@linux.intel.com
      
      
      
      Fixes: 2d626158 ("lib: rework bitmap_parse()")
      Signed-off-by: default avatarAlexander Gordeev <agordeev@linux.ibm.com>
      Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
      Cc: Yury Norov <yury.norov@gmail.com>
      Cc: Amritha Nambiar <amritha.nambiar@intel.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Miklos Szeredi <mszeredi@redhat.com>
      Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
      Cc: Steffen Klassert <steffen.klassert@secunet.com>
      Cc: "Tobin C . Harding" <tobin@kernel.org>
      Cc: Vineet Gupta <vineet.gupta1@synopsys.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Willem de Bruijn <willemb@google.com>
      Cc: <stable@vger.kernel.org>
      Link: http://lkml.kernel.org/r/1591634471-17647-1-git-send-email-agordeev@linux.ibm.com
      
      
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      81c4f4d9
    • Tim Froidcoeur's avatar
      checkpatch: correct check for kernel parameters doc · 2581ac7c
      Tim Froidcoeur authored
      
      
      Adding a new kernel parameter with documentation makes checkpatch complain
      
        __setup appears un-documented -- check Documentation/admin-guide/kernel-parameters.rst
      
      The list of kernel parameters has moved to a separate txt file, but
      checkpatch has not been updated for this.
      
      Make checkpatch.pl look for the documentation for new kernel parameters
      in kernel-parameters.txt instead of kernel-parameters.rst.
      
      Fixes: e52347bd ("Documentation/admin-guide: split the kernel parameter list to a separate file")
      Signed-off-by: default avatarTim Froidcoeur <tim.froidcoeur@tessares.net>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarJoe Perches <joe@perches.com>
      Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      2581ac7c
    • Ryusuke Konishi's avatar
      nilfs2: fix null pointer dereference at nilfs_segctor_do_construct() · 8301c719
      Ryusuke Konishi authored
      
      
      After commit c3aab9a0 ("mm/filemap.c: don't initiate writeback if
      mapping has no dirty pages"), the following null pointer dereference has
      been reported on nilfs2:
      
        BUG: kernel NULL pointer dereference, address: 00000000000000a8
        #PF: supervisor read access in kernel mode
        #PF: error_code(0x0000) - not-present page
        PGD 0 P4D 0
        Oops: 0000 [#1] SMP PTI
        ...
        RIP: 0010:percpu_counter_add_batch+0xa/0x60
        ...
        Call Trace:
          __test_set_page_writeback+0x2d3/0x330
          nilfs_segctor_do_construct+0x10d3/0x2110 [nilfs2]
          nilfs_segctor_construct+0x168/0x260 [nilfs2]
          nilfs_segctor_thread+0x127/0x3b0 [nilfs2]
          kthread+0xf8/0x130
          ...
      
      This crash turned out to be caused by set_page_writeback() call for
      segment summary buffers at nilfs_segctor_prepare_write().
      
      set_page_writeback() can call inc_wb_stat(inode_to_wb(inode),
      WB_WRITEBACK) where inode_to_wb(inode) is NULL if the inode of
      underlying block device does not have an associated wb.
      
      This fixes the issue by calling inode_attach_wb() in advance to ensure
      to associate the bdev inode with its wb.
      
      Fixes: c3aab9a0 ("mm/filemap.c: don't initiate writeback if mapping has no dirty pages")
      Reported-by: default avatarWalton Hoops <me@waltonhoops.com>
      Reported-by: default avatarTomas Hlavaty <tom@logand.com>
      Reported-by: default avatarARAI Shun-ichi <hermes@ceres.dti.ne.jp>
      Reported-by: default avatarHideki EIRAKU <hdk1983@gmail.com>
      Signed-off-by: default avatarRyusuke Konishi <konishi.ryusuke@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Tested-by: default avatarRyusuke Konishi <konishi.ryusuke@gmail.com>
      Cc: <stable@vger.kernel.org>	[5.4+]
      Link: http://lkml.kernel.org/r/20200608.011819.1399059588922299158.konishi.ryusuke@gmail.com
      
      
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      8301c719
    • Joe Perches's avatar
      lib/lz4/lz4_decompress.c: document deliberate use of `&' · e8ec0493
      Joe Perches authored
      
      
      This operation was intentional, but tools such as smatch will warn that it
      might not have been.
      
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Cc: Yann Collet <cyan@fb.com>
      Cc: Vasily Averin <vvs@virtuozzo.com>
      Cc: Gao Xiang <hsiangkao@aol.com>
      Link: http://lkml.kernel.org/r/3bf931c6ea0cae3e23f3485801986859851b4f04.camel@perches.com
      
      
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      e8ec0493
    • Andrey Konovalov's avatar
      kcov: check kcov_softirq in kcov_remote_stop() · 3021e692
      Andrey Konovalov authored
      
      
      kcov_remote_stop() should check that the corresponding kcov_remote_start()
      actually found the specified remote handle and started collecting
      coverage.  This is done by checking the per thread kcov_softirq flag.
      
      A particular failure scenario where this was observed involved a softirq
      with a remote coverage collection section coming between check_kcov_mode()
      and the access to t->kcov_area in __sanitizer_cov_trace_pc().  In that
      softirq kcov_remote_start() bailed out after kcov_remote_find() check, but
      the matching kcov_remote_stop() didn't check if kcov_remote_start()
      succeeded, and overwrote per thread kcov parameters with invalid (zero)
      values.
      
      Fixes: 5ff3b30a ("kcov: collect coverage from interrupts")
      Signed-off-by: default avatarAndrey Konovalov <andreyknvl@google.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Reviewed-by: default avatarDmitry Vyukov <dvyukov@google.com>
      Cc: Alexander Potapenko <glider@google.com>
      Cc: Marco Elver <elver@google.com>
      Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
      Link: http://lkml.kernel.org/r/fcd1cd16eac1d2c01a66befd8ea4afc6f8d09833.1591576806.git.andreyknvl@google.com
      
      
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      3021e692
    • SeongJae Park's avatar
      scripts/spelling: add a few more typos · 40590660
      SeongJae Park authored
      
      
      This commit adds typos I found from another work.
      
      Signed-off-by: default avatarSeongJae Park <sjpark@amazon.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Reviewed-by: default avatarDavid Hildenbrand <david@redhat.com>
      Cc: Joe Perches <joe@perches.com>
      Link: http://lkml.kernel.org/r/20200605092502.18018-3-sjpark@amazon.com
      
      
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      40590660
    • Dan Carpenter's avatar
      khugepaged: selftests: fix timeout condition in wait_for_scan() · 9f267a17
      Dan Carpenter authored
      
      
      The loop exits with "timeout" set to -1 and not to 0 so the test needs to
      be fixed.
      
      Fixes: e7b592f6caca ("khugepaged: add self test")
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Cc: Zi Yan <ziy@nvidia.com>
      Cc: William Kucharski <william.kucharski@oracle.com>
      Cc: Yang Shi <yang.shi@linux.alibaba.com>
      Cc: John Hubbard <jhubbard@nvidia.com>
      Link: http://lkml.kernel.org/r/20200605110736.GH978434@mwanda
      
      
      Acked-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      9f267a17
    • Linus Torvalds's avatar
      Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux · 6f630784
      Linus Torvalds authored
      Pull clk updates from Stephen Boyd:
       "This time around we have four lines of diff in the core framework,
        removing a function that isn't used anymore. Otherwise the main new
        thing for the common clk framework is that it is selectable in the
        Kconfig language now. Hopefully this will let clk drivers and clk
        consumers be testable on more than the architectures that support the
        clk framework. The goal is to introduce some Kunit tests for the
        framework.
      
        Outside of the core framework we have the usual set of various driver
        updates and non-critical fixes. The dirstat shows that the new
        Baikal-T1 driver is the largest addition this time around in terms of
        lines of code. After that the x86 (Intel), Qualcomm, and Mediatek
        drivers introduce many lines to support new or upcoming SoCs. After
        that the dirstat shows the usual suspects working on their SoC support
        by fixing minor bugs, correcting data and converting some of their DT
        bindings to YAML.
      
        Core:
         - Allow the COMMON_CLK config to be selectable
      
        New Drivers:
         - Clk driver for Baikal-T1 SoCs
         - Mediatek MT6765 clock support
         - Support for Intel Agilex clks
         - Add support for X1830 and X1000 Ingenic SoC clk controllers
         - Add support for the new Renesas RZ/G1H (R8A7742) SoC
         - Add support for Qualcomm's MSM8939 Generic Clock Controller
      
        Updates:
         - Support IDT VersaClock 5P49V5925
         - Bunch of updates for HSDK clock generation unit (CGU) driver
         - Start making audio and GPU clks work on Marvell MMP2/MMP3 SoCs
         - Add some GPU, NPU, and UFS clks to Qualcomm SM8150 driver
         - Enable supply regulators for GPU gdscs on Qualcomm SoCs
         - Add support for Si5342, Si5344 and Si5345 chips
         - Support custom flags in Xilinx zynq firmware
         - Various small fixes to the Xilinx clk driver
         - A single minor rounding fix for the legacy Allwinner clock support
         - A few patches from Abel Vesa as preparation of adding audiomix
           clock support on i.MX
         - A couple of cleanups from Anson Huang for i.MX clk-sscg-pll and
           clk-pllv3 drivers
         - Drop dependency on ARM64 for i.MX8M clock driver, to support
           aarch32 mode on aarch64 hardware
         - A series from Peng Fan to improve i.MX8M clock drivers, using
           composite clock for core and bus clk slice
         - Set a better parent clock for flexcan on i.MX6UL to support CiA102
           defined bit rates
         - A couple changes for EMC frequency scaling on Tegra210
         - Support for CPU frequency scaling on Tegra20/Tegra30
         - New clk gate for CSI test pattern generator on Tegra210
         - Regression fixes for Samsung exynos542x and exynos5433 SoCs
         - Use of fallthrough; attribute for Samsung s3c24xx
         - Updates and fixup HDMI and video clocks on Meson8b
         - Fixup reset polarity on Meson8b
         - Fix GPU glitch free mux switch on Meson gx and g12
         - A minor fix for the currently unused suspend/resume handling on
           Renesas RZ/A1 and RZ/A2
         - Two more conversions of Renesas DT bindings to json-schema
         - Add support for the USB 2.0 clock selector on Renesas R-Car M3-W+"
      
      * tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: (155 commits)
        clk: mediatek: Remove ifr{0,1}_cfg_regs structures
        clk: baikal-t1: remove redundant assignment to variable 'divider'
        clk: baikal-t1: fix spelling mistake "Uncompatible" -> "Incompatible"
        dt-bindings: clock: Add a missing include to MMP Audio Clock binding
        dt: Add bindings for IDT VersaClock 5P49V5925
        clk: vc5: Add support for IDT VersaClock 5P49V6965
        clk: Add Baikal-T1 CCU Dividers driver
        clk: Add Baikal-T1 CCU PLLs driver
        dt-bindings: clk: Add Baikal-T1 CCU Dividers binding
        dt-bindings: clk: Add Baikal-T1 CCU PLLs binding
        clk: mediatek: assign the initial value to clk_init_data of mtk_mux
        clk: mediatek: Add MT6765 clock support
        clk: mediatek: add mt6765 clock IDs
        dt-bindings: clock: mediatek: document clk bindings vcodecsys for Mediatek MT6765 SoC
        dt-bindings: clock: mediatek: document clk bindings mipi0a for Mediatek MT6765 SoC
        dt-bindings: clock: mediatek: document clk bindings for Mediatek MT6765 SoC
        CLK: HSDK: CGU: add support for 148.5MHz clock
        CLK: HSDK: CGU: support PLL bypassing
        CLK: HSDK: CGU: check if PLL is bypassed first
        clk: clk-si5341: Add support for the Si5345 series
        ...
      6f630784
    • Linus Torvalds's avatar
      Merge tag 'for-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply · 3a2a8751
      Linus Torvalds authored
      Pull power supply and reset updates from Sebastian Reichel:
       "This time there are lots of changes. Quite a few changes to the core,
        lots of driver changes and one change to kobject core (with Ack from
        Greg).
      
        Summary:
      
        kobject:
         - Increase number of allowed uevent variables
      
        power-supply core:
         - Add power-supply type in uevent
         - Cleanup property handling in core
         - Make property and usb_type pointers const
         - Convert core power-supply DT binding to YAML
         - Cleanup HWMON code
         - Add new health status "calibration required"
         - Add new properties for manufacture date and capacity error margin
      
        battery drivers:
         - new cw2015 battery driver used by pine64 Pinebook Pro laptop
         - axp22: blacklist on Meegopad T02
         - sc27xx: support current/voltage reading
         - max17042: support time-to-empty reading
         - simple-battery: add more battery parameters
         - bq27xxx: convert DT binding document to YAML
         - sbs-battery: add TI BQ20Z65 support, fix technology property,
               convert DT binding to YAML, add option to disable charger
               broadcasts, add new properties: manufacture date, capacity
               error margin, average current, charge current and voltage and
               support calibration required health status
         - misc fixes
      
        charger drivers:
         - bq25890: cleanup, implement charge type, precharge current and
               input current limiting properties
         - bd70528: use new linear range helper library
         - bd99954: new charger driver
         - mp2629: new charger driver
         - misc fixes
      
        reboot drivers:
         - oxnas-restart: introduce new driver
         - syscon-reboot: convert DT binding to YAML, add parent syscon device
               support
         - misc fixes"
      
      * tag 'for-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (85 commits)
        power: supply: cw2015: Attach OF ID table to the driver
        power: reset: gpio-poweroff: add missing '\n' in dev_err()
        Revert "power: supply: sbs-battery: simplify read_read_string_data"
        Revert "power: supply: sbs-battery: add PEC support"
        dt-bindings: power: sbs-battery: Convert to yaml
        power: supply: sbs-battery: constify power-supply property array
        power: supply: sbs-battery: switch to i2c's probe_new
        power: supply: sbs-battery: switch from of_property_* to device_property_*
        power: supply: sbs-battery: add ability to disable charger broadcasts
        power: supply: sbs-battery: fix idle battery status
        power: supply: sbs-battery: add POWER_SUPPLY_HEALTH_CALIBRATION_REQUIRED support
        power: supply: sbs-battery: add MANUFACTURE_DATE support
        power: supply: sbs-battery: add POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT/VOLTAGE_MAX support
        power: supply: sbs-battery: Improve POWER_SUPPLY_PROP_TECHNOLOGY support
        power: supply: sbs-battery: add POWER_SUPPLY_PROP_CURRENT_AVG support
        power: supply: sbs-battery: add PEC support
        power: supply: sbs-battery: simplify read_read_string_data
        power: supply: sbs-battery: add POWER_SUPPLY_PROP_CAPACITY_ERROR_MARGIN support
        power: supply: sbs-battery: Add TI BQ20Z65 support
        power: supply: core: add POWER_SUPPLY_HEALTH_CALIBRATION_REQUIRED
        ...
      3a2a8751
    • Linus Torvalds's avatar
      Merge tag 'dmaengine-5.8-rc1' of git://git.infradead.org/users/vkoul/slave-dma · c90e7945
      Linus Torvalds authored
      Pull dmaengine updates from Vinod Koul:
       "A fairly small dmaengine update which includes mostly driver updates
        (dmatest, dw-edma, ioat, mmp-tdma and k3-udma) along with Renesas
        binding update to json-schema"
      
      * tag 'dmaengine-5.8-rc1' of git://git.infradead.org/users/vkoul/slave-dma: (39 commits)
        dmaengine: imx-sdma: initialize all script addresses
        dmaengine: ti: k3-udma: Use proper return code in alloc_chan_resources
        dmaengine: ti: k3-udma: Remove udma_chan.in_ring_cnt
        dmaengine: ti: k3-udma: Add missing dma_sync call for rx flush descriptor
        dmaengine: at_xdmac: Replace zero-length array with flexible-array
        dmaengine: at_hdmac: Replace zero-length array with flexible-array
        dmaengine: qcom: bam_dma: Replace zero-length array with flexible-array
        dmaengine: ti: k3-udma: Use PTR_ERR_OR_ZERO() to simplify code
        dmaengine: moxart-dma: Drop pointless static qualifier in moxart_probe()
        dmaengine: sf-pdma: Simplify the error handling path in 'sf_pdma_probe()'
        dmaengine: qcom_hidma: use true,false for bool variable
        dmaengine: dw-edma: support local dma device transfer semantics
        dmaengine: Fix doc strings to satisfy validation script
        dmaengine: Include dmaengine.h into dmaengine.c
        dmaengine: dmatest: Describe members of struct dmatest_info
        dmaengine: dmatest: Describe members of struct dmatest_params
        dmaengine: dmatest: Allow negative timeout value to specify infinite wait
        Revert "dmaengine: dmatest: timeout value of -1 should specify infinite wait"
        dmaengine: stm32-dma: direct mode support through device tree
        dt-bindings: dma: add direct mode support through device tree in stm32-dma
        ...
      c90e7945
    • Geert Uytterhoeven's avatar
      Documentation/CodingStyle: Fix duplicate "are" typo · 77d22a43
      Geert Uytterhoeven authored
      
      
      The improved paragraph about line lengths contains a sentence with a
      duplicate word: there is one "are" at the end of a line, followed by a
      second one at the beginning of the next line.
      
      Drop the first one, as that one is part of the longest line.
      
      Fixes: bdc48fa1 ("checkpatch/coding-style: deprecate 80-column warning")
      Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      77d22a43
    • Andrew Morton's avatar
      arch/sparc/mm/srmmu.c: fix build · f7579007
      Andrew Morton authored
      
      
      "mm: consolidate pte_index() and pte_offset_*() definitions" was supposed
      to remove arch/sparc/mm/srmmu.c:pte_offset_kernel().
      
      Fixes: 974b9b2c ("mm: consolidate pte_index() and pte_offset_*() definitions")
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Cc: Mike Rapoport <rppt@linux.ibm.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f7579007
  2. Jun 10, 2020