Skip to content
  1. Dec 06, 2018
    • David Rientjes's avatar
      mm, thp: restore node-local hugepage allocations · 2f0799a0
      David Rientjes authored
      This is a full revert of ac5b2c18 ("mm: thp: relax __GFP_THISNODE for
      MADV_HUGEPAGE mappings") and a partial revert of 89c83fb5 ("mm, thp:
      consolidate THP gfp handling into alloc_hugepage_direct_gfpmask").
      
      By not setting __GFP_THISNODE, applications can allocate remote hugepages
      when the local node is fragmented or low on memory when either the thp
      defrag setting is "always" or the vma has been madvised with
      MADV_HUGEPAGE.
      
      Remote access to hugepages often has much higher latency than local pages
      of the native page size.  On Haswell, ac5b2c18 was shown to have a
      13.9% access regression after this commit for binaries that remap their
      text segment to be backed by transparent hugepages.
      
      The intent of ac5b2c18 is to address an issue where a local node is
      low on memory or fragmented such that a hugepage cannot be allocated.  In
      every scenario where this was described as a fix, there is abundant and
      unfragmented remote memory available to allocate from, even with a greater
      access latency.
      
      If remote memory is also low or fragmented, not setting __GFP_THISNODE was
      also measured on Haswell to have a 40% regression in allocation latency.
      
      Restore __GFP_THISNODE for thp allocations.
      
      Fixes: ac5b2c18 ("mm: thp: relax __GFP_THISNODE for MADV_HUGEPAGE mappings")
      Fixes: 89c83fb5
      
       ("mm, thp: consolidate THP gfp handling into alloc_hugepage_direct_gfpmask")
      Cc: Andrea Arcangeli <aarcange@redhat.com>
      Cc: Mel Gorman <mgorman@techsingularity.net>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Cc: Michal Hocko <mhocko@kernel.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarDavid Rientjes <rientjes@google.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      2f0799a0
    • Linus Torvalds's avatar
      Merge tag 'for-linus-20181205' of git://git.kernel.dk/linux-block · 4eaaa2b9
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
       "A bit earlier in the week as usual, but there's a fix here that should
        go in sooner rather than later.
      
        Under a combination of circumstance, the direct issue path in blk-mq
        could corrupt data. This wasn't easy to hit, but the ones that are
        affected by it, seem to hit it pretty easily. Full explanation in the
        patch. None of the regular filesystem and storage testing has
        triggered it, even though it's been around since 4.19-rc1.
      
        Outside of that, whitelist trim tweak for certain Samsung devices for
        libata"
      
      * tag 'for-linus-20181205' of git://git.kernel.dk/linux-block:
        blk-mq: fix corruption with direct issue
        libata: whitelist all SAMSUNG MZ7KM* solid-state disks
      4eaaa2b9
    • Linus Torvalds's avatar
      Merge tag 'for-4.20-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · d0897090
      Linus Torvalds authored
      Pull btrfs fix from David Sterba:
       "A patch in 4.19 introduced a sanity check that was too strict and a
        filesystem cannot be mounted.
      
        This happens for filesystems with more than 10 devices and has been
        reported by a few users so we need the fix to propagate to stable"
      
      * tag 'for-4.20-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        btrfs: tree-checker: Don't check max block group size as current max chunk size limit is unreliable
      d0897090
    • Linus Torvalds's avatar
      Merge tag 'pm-4.20-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 91dd51f6
      Linus Torvalds authored
      Pull power management fix from Rafael Wysocki:
       "Revert a problematic recent commit that attempted to fix a system-wide
        suspend issue related to the freezer"
      
      * tag 'pm-4.20-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        Revert "exec: make de_thread() freezable"
      91dd51f6
    • Linus Torvalds's avatar
      Merge tag 'mfd-fixes-4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd · 5e0dc1a7
      Linus Torvalds authored
      Pull mfd bugfix from Lee Jones:
       "Replace release function in cros_ec_dev"
      
      * tag 'mfd-fixes-4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd:
        Revert "mfd: cros_ec: Use devm_kzalloc for private data"
      5e0dc1a7
  2. Dec 05, 2018
    • Enric Balletbo i Serra's avatar
      Revert "mfd: cros_ec: Use devm_kzalloc for private data" · 48a2ca0e
      Enric Balletbo i Serra authored
      This reverts commit 3aa2177e.
      
      That commit triggered a new WARN when unloading the module (see at the
      end of the commit message). When a class_dev is embedded in a structure
      then that class_dev is the thing that controls the lifetime of that
      structure, for that reason device managed allocations can't be used here.
      See Documentation/kobject.txt.
      
      Revert the above patch, so the struct is allocated using kzalloc and we
      have a release function for it that frees the allocated memory, otherwise
      it is broken.
      
       ------------[ cut here ]------------
       Device 'cros_ec' does not have a release() function, it is broken and must be fixed.
       WARNING: CPU: 3 PID: 3675 at drivers/base/core.c:895 device_release+0x80/0x90
       Modules linked in: btusb btrtl btintel btbcm bluetooth ...
       CPU: 3 PID: 3675 Comm: rmmod Not tainted 4.20.0-rc4 #76
       Hardware name: Google Kevin (DT)
       pstate: 40000005 (nZcv daif -PAN -UAO)
       pc : device_release+0x80/0x90
       lr : device_release+0x80/0x90
       sp : ffff00000c47bc70
       x29: ffff00000c47bc70 x28: ffff8000e86b0d40
       x27: 0000000000000000 x26: 0000000000000000
       x25: 0000000056000000 x24: 0000000000000015
       x23: ffff8000f0bbf860 x22: ffff000000d320a0
       x21: ffff8000ee93e100 x20: ffff8000ed931428
       x19: ffff8000ed931418 x18: 0000000000000020
       x17: 0000000000000000 x16: 0000000000000000
       x15: 0000000000000400 x14: 0000000000000143
       x13: 0000000000000000 x12: 0000000000000400
       x11: 0000000000000157 x10: 0000000000000960
       x9 : ffff00000c47b9b0 x8 : ffff8000e86b1700
       x7 : 0000000000000000 x6 : ffff8000f7d520b8
       x5 : ffff8000f7d520b8 x4 : 0000000000000000
       x3 : ffff8000f7d58e68 x2 : ffff8000e86b0d40
       x1 : 37d859939c964800 x0 : 0000000000000000
       Call trace:
        device_release+0x80/0x90
        kobject_put+0x74/0xe8
        device_unregister+0x20/0x30
        ec_device_remove+0x34/0x48 [cros_ec_dev]
        platform_drv_remove+0x28/0x48
        device_release_driver_internal+0x1a8/0x240
        driver_detach+0x40/0x80
        bus_remove_driver+0x54/0xa8
        driver_unregister+0x2c/0x58
        platform_driver_unregister+0x10/0x18
        cros_ec_dev_exit+0x1c/0x2d8 [cros_ec_dev]
        __arm64_sys_delete_module+0x16c/0x1f8
        el0_svc_common+0x84/0xd8
        el0_svc_handler+0x2c/0x80
        el0_svc+0x8/0xc
       ---[ end trace a57c4625f3c60ae8 ]---
      
      Cc: stable@vger.kernel.org
      Fixes: 3aa2177e
      
       ("mfd: cros_ec: Use devm_kzalloc for private data")
      Signed-off-by: default avatarEnric Balletbo i Serra <enric.balletbo@collabora.com>
      Reviewed-by: default avatarGuenter Roeck <groeck@chromium.org>
      Reviewed-by: default avatarDmitry Torokhov <dtor@chromium.org>
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      48a2ca0e
    • Jens Axboe's avatar
      blk-mq: fix corruption with direct issue · ffe81d45
      Jens Axboe authored
      If we attempt a direct issue to a SCSI device, and it returns BUSY, then
      we queue the request up normally. However, the SCSI layer may have
      already setup SG tables etc for this particular command. If we later
      merge with this request, then the old tables are no longer valid. Once
      we issue the IO, we only read/write the original part of the request,
      not the new state of it.
      
      This causes data corruption, and is most often noticed with the file
      system complaining about the just read data being invalid:
      
      [  235.934465] EXT4-fs error (device sda1): ext4_iget:4831: inode #7142: comm dpkg-query: bad extra_isize 24937 (inode size 256)
      
      because most of it is garbage...
      
      This doesn't happen from the normal issue path, as we will simply defer
      the request to the hardware queue dispatch list if we fail. Once it's on
      the dispatch list, we never merge with it.
      
      Fix this from the direct issue path by flagging the request as
      REQ_NOMERGE so we don't change the size of it before issue.
      
      See also:
        https://bugzilla.kernel.org/show_bug.cgi?id=201685
      
      
      
      Tested-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Fixes: 6ce3dd6e
      
       ("blk-mq: issue directly if hw queue isn't busy in case of 'none'")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      ffe81d45
    • Linus Torvalds's avatar
      Merge branch 'parisc-4.20-4' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux · a517af52
      Linus Torvalds authored
      Pull parisc fix from Helge Deller:
       "On parisc, use -ffunction-sections compiler option when building
        32-bit kernel modules to avoid sysfs-warnings when loading such
        modules.
      
        This got broken with kernel v4.18"
      
      * 'parisc-4.20-4' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
        parisc: Enable -ffunction-sections for modules on 32-bit kernel
      a517af52
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input · adac0753
      Linus Torvalds authored
      Pull input updates from Dmitry Torokhov:
       "Mostly new IDs for Elan/Synaptics touchpads, plus a few small fixups"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
        Input: omap-keypad - fix keyboard debounce configuration
        Input: xpad - quirk all PDP Xbox One gamepads
        Input: synaptics - enable SMBus for HP 15-ay000
        Input: synaptics - add PNP ID for ThinkPad P50 to SMBus
        Input: elan_i2c - add ACPI ID for Lenovo IdeaPad 330-15ARR
        Input: elan_i2c - add support for ELAN0621 touchpad
        Input: hyper-v - fix wakeup from suspend-to-idle
        Input: atkbd - clean up indentation issue
        Input: st1232 - convert to SPDX identifiers
        Input: migor_ts - convert to SPDX identifiers
        Input: dt-bindings - fix a typo in file input-reset.txt
        Input: cros_ec_keyb - fix button/switch capability reports
        Input: elan_i2c - add ELAN0620 to the ACPI table
        Input: matrix_keypad - check for errors from of_get_named_gpio()
      adac0753
  3. Dec 04, 2018
  4. Dec 03, 2018
  5. Dec 02, 2018
    • Linus Torvalds's avatar
      Merge branch 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 4b783176
      Linus Torvalds authored
      Pull STIBP fallout fixes from Thomas Gleixner:
       "The performance destruction department finally got it's act together
        and came up with a cure for the STIPB regression:
      
         - Provide a command line option to control the spectre v2 user space
           mitigations. Default is either seccomp or prctl (if seccomp is
           disabled in Kconfig). prctl allows mitigation opt-in, seccomp
           enables the migitation for sandboxed processes.
      
         - Rework the code to handle the conditional STIBP/IBPB control and
           remove the now unused ptrace_may_access_sched() optimization
           attempt
      
         - Disable STIBP automatically when SMT is disabled
      
         - Optimize the switch_to() logic to avoid MSR writes and invocations
           of __switch_to_xtra().
      
         - Make the asynchronous speculation TIF updates synchronous to
           prevent stale mitigation state.
      
        As a general cleanup this also makes retpoline directly depend on
        compiler support and removes the 'minimal retpoline' option which just
        pretended to provide some form of security while providing none"
      
      * 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (31 commits)
        x86/speculation: Provide IBPB always command line options
        x86/speculation: Add seccomp Spectre v2 user space protection mode
        x86/speculation: Enable prctl mode for spectre_v2_user
        x86/speculation: Add prctl() control for indirect branch speculation
        x86/speculation: Prepare arch_smt_update() for PRCTL mode
        x86/speculation: Prevent stale SPEC_CTRL msr content
        x86/speculation: Split out TIF update
        ptrace: Remove unused ptrace_may_access_sched() and MODE_IBRS
        x86/speculation: Prepare for conditional IBPB in switch_mm()
        x86/speculation: Avoid __switch_to_xtra() calls
        x86/process: Consolidate and simplify switch_to_xtra() code
        x86/speculation: Prepare for per task indirect branch speculation control
        x86/speculation: Add command line control for indirect branch speculation
        x86/speculation: Unify conditional spectre v2 print functions
        x86/speculataion: Mark command line parser data __initdata
        x86/speculation: Mark string arrays const correctly
        x86/speculation: Reorder the spec_v2 code
        x86/l1tf: Show actual SMT state
        x86/speculation: Rework SMT state change
        sched/smt: Expose sched_smt_present static key
        ...
      4b783176
    • Linus Torvalds's avatar
      Merge tag 'for-linus-20181201' of git://git.kernel.dk/linux-block · 88058417
      Linus Torvalds authored
      Pull block layer fixes from Jens Axboe:
      
       - Single range elevator discard merge fix, that caused crashes (Ming)
      
       - Fix for a regression in O_DIRECT, where we could potentially lose the
         error value (Maximilian Heyne)
      
       - NVMe pull request from Christoph, with little fixes all over the map
         for NVMe.
      
      * tag 'for-linus-20181201' of git://git.kernel.dk/linux-block:
        block: fix single range discard merge
        nvme-rdma: fix double freeing of async event data
        nvme: flush namespace scanning work just before removing namespaces
        nvme: warn when finding multi-port subsystems without multipathing enabled
        fs: fix lost error code in dio_complete
        nvme-pci: fix surprise removal
        nvme-fc: initialize nvme_req(rq)->ctrl after calling __nvme_fc_init_request()
        nvme: Free ctrl device name on init failure
      88058417
    • Linus Torvalds's avatar
      Merge tag 'pci-v4.20-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci · c734b425
      Linus Torvalds authored
      Pull PCI fixes from Bjorn Helgaas:
      
       - Fix a link speed checking interface that broke PCIe gen3 cards in
         gen1 slots (Mikulas Patocka)
      
       - Fix an imx6 link training error (Trent Piepho)
      
       - Fix a layerscape outbound window accessor calling error (Hou
         Zhiqiang)
      
       - Fix a DesignWare endpoint MSI-X address calculation error (Gustavo
         Pimentel)
      
      * tag 'pci-v4.20-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
        PCI: Fix incorrect value returned from pcie_get_speed_cap()
        PCI: dwc: Fix MSI-X EP framework address calculation bug
        PCI: layerscape: Fix wrong invocation of outbound window disable accessor
        PCI: imx6: Fix link training status detection in link up check
      c734b425
  6. Dec 01, 2018
    • Bjorn Helgaas's avatar
      Merge remote-tracking branch 'lorenzo/pci/controller-fixes' into for-linus · c74eadf8
      Bjorn Helgaas authored
        - Fix DesignWare endpoint MSI-X address calculation bug (Gustavo
          Pimentel)
      
        - Fix Layerscape outbound window disable usage (Hou Zhiqiang)
      
        - Fix imx6 link up detection (Trent Piepho)
      
      * lorenzo/pci/controller-fixes:
        PCI: dwc: Fix MSI-X EP framework address calculation bug
        PCI: layerscape: Fix wrong invocation of outbound window disable accessor
        PCI: imx6: Fix link training status detection in link up check
      c74eadf8
    • Mikulas Patocka's avatar
      PCI: Fix incorrect value returned from pcie_get_speed_cap() · f1f90e25
      Mikulas Patocka authored
      The macros PCI_EXP_LNKCAP_SLS_*GB are values, not bit masks.  We must mask
      the register and compare it against them.
      
      This fixes errors like this:
      
        amdgpu: [powerplay] failed to send message 261 ret is 0
      
      when a PCIe-v3 card is plugged into a PCIe-v1 slot, because the slot is
      being incorrectly reported as PCIe-v3 capable.
      
      6cf57be0, which appeared in v4.17, added pcie_get_speed_cap() with the
      incorrect test of PCI_EXP_LNKCAP_SLS as a bitmask.  5d9a6330, which
      appeared in v4.19, changed amdgpu to use pcie_get_speed_cap(), so the
      amdgpu bug reports below are regressions in v4.19.
      
      Fixes: 6cf57be0 ("PCI: Add pcie_get_speed_cap() to find max supported link speed")
      Fixes: 5d9a6330 ("drm/amdgpu: use pcie functions for link width and speed")
      Link: https://bugs.freedesktop.org/show_bug.cgi?id=108704
      Link: https://bugs.freedesktop.org/show_bug.cgi?id=108778
      
      
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      [bhelgaas: update comment, remove use of PCI_EXP_LNKCAP_SLS_8_0GB and
      PCI_EXP_LNKCAP_SLS_16_0GB since those should be covered by PCI_EXP_LNKCAP2,
      remove test of PCI_EXP_LNKCAP for zero, since that register is required]
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Cc: stable@vger.kernel.org	# v4.17+
      f1f90e25
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · d8f190ee
      Linus Torvalds authored
      Merge misc fixes from Andrew Morton:
       "31 fixes"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (31 commits)
        ocfs2: fix potential use after free
        mm/khugepaged: fix the xas_create_range() error path
        mm/khugepaged: collapse_shmem() do not crash on Compound
        mm/khugepaged: collapse_shmem() without freezing new_page
        mm/khugepaged: minor reorderings in collapse_shmem()
        mm/khugepaged: collapse_shmem() remember to clear holes
        mm/khugepaged: fix crashes due to misaccounted holes
        mm/khugepaged: collapse_shmem() stop if punched or truncated
        mm/huge_memory: fix lockdep complaint on 32-bit i_size_read()
        mm/huge_memory: splitting set mapping+index before unfreeze
        mm/huge_memory: rename freeze_page() to unmap_page()
        initramfs: clean old path before creating a hardlink
        kernel/kcov.c: mark funcs in __sanitizer_cov_trace_pc() as notrace
        psi: make disabling/enabling easier for vendor kernels
        proc: fixup map_files test on arm
        debugobjects: avoid recursive calls with kmemleak
        userfaultfd: shmem: UFFDIO_COPY: set the page dirty if VM_WRITE is not set
        userfaultfd: shmem: add i_size checks
        userfaultfd: shmem/hugetlbfs: only allow to register VM_MAYWRITE vmas
        userfaultfd: shmem: allocate anonymous memory for MAP_PRIVATE shmem
        ...
      d8f190ee
    • Linus Torvalds's avatar
      Merge tag 'mips_fixes_4.20_4' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux · 6c7954b7
      Linus Torvalds authored
      Pull few more MIPS fixes from Paul Burton:
      
       - Fix mips_get_syscall_arg() to operate on the task specified when
         detecting o32 tasks running on MIPS64 kernels.
      
       - Fix some incorrect GPIO pin muxing for the MT7620 SoC.
      
       - Update the linux-mips mailing list address.
      
      * tag 'mips_fixes_4.20_4' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux:
        MAINTAINERS: Update linux-mips mailing list address
        MIPS: ralink: Fix mt7620 nd_sd pinmux
        mips: fix mips_get_syscall_arg o32 check
      6c7954b7
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · 868dda00
      Linus Torvalds authored
      Pull arm64 fixes from Catalin Marinas:
      
       - Cortex-A76 erratum workaround
      
       - ftrace fix to enable syscall events on arm64
      
       - Fix uninitialised pointer in iort_get_platform_device_domain()
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        ACPI/IORT: Fix iort_get_platform_device_domain() uninitialized pointer value
        arm64: ftrace: Fix to enable syscall events on arm64
        arm64: Add workaround for Cortex-A76 erratum 1286807
      868dda00
    • Linus Torvalds's avatar
      Merge tag 'gcc-plugins-v4.20-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux · 1f817429
      Linus Torvalds authored
      Pull stackleak plugin fix from Kees Cook:
       "Fix crash by not allowing kprobing of stackleak_erase() (Alexander
        Popov)"
      
      * tag 'gcc-plugins-v4.20-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
        stackleak: Disable function tracing and kprobes for stackleak_erase()
      1f817429