1. 17 Sep, 2018 5 commits
  2. 13 Sep, 2018 4 commits
    • Takashi Iwai's avatar
      ALSA: hda - Enable runtime PM only for discrete GPU · 37a3a98e
      Takashi Iwai authored
      The recent change of vga_switcheroo allowed the runtime PM for
      HD-audio on AMD GPUs, but this also resulted in a regression.  When
      the HD-audio controller driver gets runtime-suspended, HD-audio link
      is turned off, and the hotplug notification is ignored.  This leads to
      the inconsistent audio state (the connection isn't notified and ELD is
      ignored).
      
      The best fix would be to implement the proper ELD notification via the
      audio component, but it's still not ready.  As a quick workaround,
      this patch adds the check of runtime_idle and allows the runtime
      suspend only when the vga_switcheroo is bound with discrete GPU.
      That is, a system with a single GPU and APU would be again without
      runtime PM to keep the HD-audio link for the hotplug notification and
      ELD read out.
      
      Also, the codec->auto_runtime_pm flag is set only for the discrete GPU
      at the time GPU gets bound via vga_switcheroo (i.e. only dGPU is
      forcibly runtime-PM enabled), so that APU can still get the ELD
      notification.
      
      For identifying which GPU is bound, a new vga_switcheroo client
      callback, gpu_bound, is implemented.  The vga_switcheroo simply calls
      this when GPU is bound, and tells whether it's dGPU or APU.
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=200945
      Fixes: 07f4f97d ("vga_switcheroo: Use device link for HDA controller")
      Reported-by: default avatarJian-Hong Pan <jian-hong@endlessm.com>
      Tested-by: default avatarJian-Hong Pan <jian-hong@endlessm.com>
      Acked-by: default avatarLukas Wunner <lukas@wunner.de>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      37a3a98e
    • Takashi Sakamoto's avatar
      ALSA: oxfw: fix memory leak of private data · 498fe23a
      Takashi Sakamoto authored
      Although private data of sound card instance is usually allocated in the
      tail of the instance, drivers in ALSA firewire stack allocate the private
      data before allocating the instance. In this case, the private data
      should be released explicitly at .private_free callback of the instance.
      
      This commit fixes memory leak following to the above design.
      
      Fixes: 6c29230e ('ALSA: oxfw: delayed registration of sound card')
      Cc: <stable@vger.kernel.org> # v4.7+
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      498fe23a
    • Takashi Sakamoto's avatar
      ALSA: firewire-tascam: fix memory leak of private data · 8d28277c
      Takashi Sakamoto authored
      Although private data of sound card instance is usually allocated in the
      tail of the instance, drivers in ALSA firewire stack allocate the private
      data before allocating the instance. In this case, the private data
      should be released explicitly at .private_free callback of the instance.
      
      This commit fixes memory leak following to the above design.
      
      Fixes: b610386c ('ALSA: firewire-tascam: deleyed registration of sound card')
      Cc: <stable@vger.kernel.org> # v4.7+
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      8d28277c
    • Takashi Sakamoto's avatar
      ALSA: firewire-digi00x: fix memory leak of private data · a49a83ab
      Takashi Sakamoto authored
      Although private data of sound card instance is usually allocated in the
      tail of the instance, drivers in ALSA firewire stack allocate the private
      data before allocating the instance. In this case, the private data
      should be released explicitly at .private_free callback of the instance.
      
      This commit fixes memory leak following to the above design.
      
      Fixes: 86c8dd7f ('ALSA: firewire-digi00x: delayed registration of sound card')
      Cc: <stable@vger.kernel.org> # v4.7+
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      a49a83ab
  3. 12 Sep, 2018 3 commits
    • Yu Zhao's avatar
      sound: don't call skl_init_chip() to reset intel skl soc · 75383f8d
      Yu Zhao authored
      Internally, skl_init_chip() calls snd_hdac_bus_init_chip() which
      1) sets bus->chip_init to prevent multiple entrances before device
      is stopped; 2) enables interrupt.
      
      We shouldn't use it for the purpose of resetting device only because
      1) when we really want to initialize device, we won't be able to do
      so; 2) we are ready to handle interrupt yet, and kernel crashes when
      interrupt comes in.
      
      Rename azx_reset() to snd_hdac_bus_reset_link(), and use it to reset
      device properly.
      
      Fixes: 60767abc ("ASoC: Intel: Skylake: Reset the controller in probe")
      Reviewed-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarYu Zhao <yuzhao@google.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      75383f8d
    • Yu Zhao's avatar
      sound: enable interrupt after dma buffer initialization · b61749a8
      Yu Zhao authored
      In snd_hdac_bus_init_chip(), we enable interrupt before
      snd_hdac_bus_init_cmd_io() initializing dma buffers. If irq has
      been acquired and irq handler uses the dma buffer, kernel may crash
      when interrupt comes in.
      
      Fix the problem by postponing enabling irq after dma buffer
      initialization. And warn once on null dma buffer pointer during the
      initialization.
      Reviewed-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarYu Zhao <yuzhao@google.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      b61749a8
    • Yu Zhao's avatar
      Revert "ASoC: Intel: Skylake: Acquire irq after RIRB allocation" · 542cedec
      Yu Zhao authored
      This reverts commit 12eeeb4f.
      
      The patch doesn't fix accessing memory with null pointer in
      skl_interrupt().
      
      There are two problems: 1) skl_init_chip() is called twice, before
      and after dma buffer is allocate. The first call sets bus->chip_init
      which prevents the second from initializing bus->corb.buf and
      rirb.buf from bus->rb.area. 2) snd_hdac_bus_init_chip() enables
      interrupt before snd_hdac_bus_init_cmd_io() initializing dma buffers.
      There is a small window which skl_interrupt() can be called if irq
      has been acquired. If so, it crashes when using null dma buffer
      pointers.
      
      Will fix the problems in the following patches. Also attaching the
      crash for future reference.
      
      [   16.949148] general protection fault: 0000 [#1] PREEMPT SMP KASAN PTI
      <snipped>
      [   16.950903] Call Trace:
      [   16.950906]  <IRQ>
      [   16.950918]  skl_interrupt+0x19e/0x2d6 [snd_soc_skl]
      [   16.950926]  ? dma_supported+0xb5/0xb5 [snd_soc_skl]
      [   16.950933]  __handle_irq_event_percpu+0x27a/0x6c8
      [   16.950937]  ? __irq_wake_thread+0x1d1/0x1d1
      [   16.950942]  ? __do_softirq+0x57a/0x69e
      [   16.950944]  handle_irq_event_percpu+0x95/0x1ba
      [   16.950948]  ? _raw_spin_unlock+0x65/0xdc
      [   16.950951]  ? __handle_irq_event_percpu+0x6c8/0x6c8
      [   16.950953]  ? _raw_spin_unlock+0x65/0xdc
      [   16.950957]  ? time_cpufreq_notifier+0x483/0x483
      [   16.950959]  handle_irq_event+0x89/0x123
      [   16.950962]  handle_fasteoi_irq+0x16f/0x425
      [   16.950965]  handle_irq+0x1fe/0x28e
      [   16.950969]  do_IRQ+0x6e/0x12e
      [   16.950972]  common_interrupt+0x7a/0x7a
      [   16.950974]  </IRQ>
      <snipped>
      [   16.951031] RIP: snd_hdac_bus_update_rirb+0x19b/0x4cf [snd_hda_core] RSP: ffff88015c807c08
      [   16.951036] ---[ end trace 58bf9ece1775bc92 ]---
      
      Fixes: 2eeeb4f4733b ("ASoC: Intel: Skylake: Acquire irq after RIRB allocation")
      Signed-off-by: default avatarYu Zhao <yuzhao@google.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      542cedec
  4. 10 Sep, 2018 5 commits
  5. 06 Sep, 2018 2 commits
  6. 05 Sep, 2018 1 commit
  7. 03 Sep, 2018 4 commits
    • Keyon Jie's avatar
      ALSA: hda: Fix several mismatch for register mask and value · f7c50fa6
      Keyon Jie authored
      E.g. for snd_hdac_ext_link_clear_stream_id(), we should set (1 << stream)
      as mask, and 0 as value, here correct it and several similar mismatches.
      
      And, here also remove unreadable register_mask usage for those mask value
      updating.
      Signed-off-by: default avatarKeyon Jie <yang.jie@linux.intel.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      f7c50fa6
    • Jiada Wang's avatar
      ASoC: rsnd: fixup not to call clk_get/set under non-atomic · 4d230d12
      Jiada Wang authored
      Clocking operations clk_get/set_rate, are non-atomic,
      they shouldn't be called in soc_pcm_trigger() which is atomic.
      
      Following issue was found due to execution of clk_get_rate() causes
      sleep in soc_pcm_trigger(), which shouldn't be blocked.
      
      We can reproduce this issue by following
      	> enable CONFIG_DEBUG_ATOMIC_SLEEP=y
      	> compile, and boot
      	> mount -t debugfs none /sys/kernel/debug
      	> while true; do cat /sys/kernel/debug/clk/clk_summary > /dev/null; done &
      	> while true; do aplay xxx; done
      
      This patch adds support to .prepare callback, and moves non-atomic
      clocking operations to it. As .prepare is non-atomic, it is always
      called before trigger_start/trigger_stop.
      
      	BUG: sleeping function called from invalid context at kernel/locking/mutex.c:620
      	in_atomic(): 1, irqs_disabled(): 128, pid: 2242, name: aplay
      	INFO: lockdep is turned off.
      	irq event stamp: 5964
      	hardirqs last enabled at (5963): [<ffff200008e59e40>] mutex_lock_nested+0x6e8/0x6f0
      	hardirqs last disabled at (5964): [<ffff200008e623f0>] _raw_spin_lock_irqsave+0x24/0x68
      	softirqs last enabled at (5502): [<ffff200008081838>] __do_softirq+0x560/0x10c0
      	softirqs last disabled at (5495): [<ffff2000080c2e78>] irq_exit+0x160/0x25c
      	Preemption disabled at:[ 62.904063] [<ffff200008be4d48>] snd_pcm_stream_lock+0xb4/0xc0
      	CPU: 2 PID: 2242 Comm: aplay Tainted: G B C 4.9.54+ #186
      	Hardware name: Renesas Salvator-X board based on r8a7795 (DT)
      	Call trace:
      	[<ffff20000808fe48>] dump_backtrace+0x0/0x37c
      	[<ffff2000080901d8>] show_stack+0x14/0x1c
      	[<ffff2000086f4458>] dump_stack+0xfc/0x154
      	[<ffff2000081134a0>] ___might_sleep+0x57c/0x58c
      	[<ffff2000081136b8>] __might_sleep+0x208/0x21c
      	[<ffff200008e5980c>] mutex_lock_nested+0xb4/0x6f0
      	[<ffff2000087cac74>] clk_prepare_lock+0xb0/0x184
      	[<ffff2000087cb094>] clk_core_get_rate+0x14/0x54
      	[<ffff2000087cb0f4>] clk_get_rate+0x20/0x34
      	[<ffff20000113aa00>] rsnd_adg_ssi_clk_try_start+0x158/0x4f8 [snd_soc_rcar]
      	[<ffff20000113da00>] rsnd_ssi_init+0x668/0x7a0 [snd_soc_rcar]
      	[<ffff200001133ff4>] rsnd_soc_dai_trigger+0x4bc/0xcf8 [snd_soc_rcar]
      	[<ffff200008c1af24>] soc_pcm_trigger+0x2a4/0x2d4
      
      Fixes: e7d850dd ("ASoC: rsnd: use mod base common method on SSI-parent")
      Signed-off-by: default avatarJiada Wang <jiada_wang@mentor.com>
      Signed-off-by: default avatarTimo Wischer <twischer@de.adit-jv.com>
      [Kuninori: tidyup for upstream]
      Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Tested-by: default avatarHiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Cc: stable@vger.kernel.org
      4d230d12
    • Takashi Iwai's avatar
      ALSA: rawmidi: Initialize allocated buffers · 5a7b44a8
      Takashi Iwai authored
      syzbot reported the uninitialized value exposure in certain situations
      using virmidi loop.  It's likely a very small race at writing and
      reading, and the influence is almost negligible.  But it's safer to
      paper over this just by replacing the existing kvmalloc() with
      kvzalloc().
      
      Reported-by: syzbot+194dffdb8b22fc5d207a@syzkaller.appspotmail.com
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      5a7b44a8
    • Srinivas Kandagatla's avatar
      ASoC: q6routing: initialize data correctly · 7aa09ff2
      Srinivas Kandagatla authored
      Some of the router data fields are left as default zeros which are
      valid dai ids, so initialize these to invalid value of -1.
      
      Without intializing these correctly get_session_from_id() can return
      incorrect session resulting in not closing the opened copp and messing
      up with the copp ref count.
      
      Fixes: e3a33673 ("ASoC: qdsp6: q6routing: Add q6routing driver")
      Signed-off-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      7aa09ff2
  8. 31 Aug, 2018 1 commit
    • Andrew F. Davis's avatar
      ASoC: tas6424: Save last fault register even when clear · d40e3e9e
      Andrew F. Davis authored
      When there is no fault bit set in a fault register we skip the fault
      reporting section for that register. This also skips over saving that
      registers value. We save the value so we will not double report an
      error, but if an error clears then returns we will also not report it
      as we did not save the all cleared register value. Fix this by saving
      the fault register value in the all clear path.
      Signed-off-by: default avatarAndrew F. Davis <afd@ti.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Cc: stable@vger.kernel.org
      d40e3e9e
  9. 30 Aug, 2018 1 commit
    • Takashi Iwai's avatar
      ALSA: hda - Fix cancel_work_sync() stall from jackpoll work · 16037643
      Takashi Iwai authored
      On AMD/ATI controllers, the HD-audio controller driver allows a bus
      reset upon the error recovery, and its procedure includes the
      cancellation of pending jack polling work as found in
      snd_hda_bus_codec_reset().  This works usually fine, but it becomes a
      problem when the reset happens from the jack poll work itself; then
      calling cancel_work_sync() from the work being processed tries to wait
      the finish endlessly.
      
      As a workaround, this patch adds the check of current_work() and
      applies the cancel_work_sync() only when it's not from the
      jackpoll_work.
      
      This doesn't fix the root cause of the reported error below, but at
      least, it eases the unexpected stall of the whole system.
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=200937
      Cc: <stable@vger.kernel.org>
      Cc: Lukas Wunner <lukas@wunner.de>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      16037643
  10. 28 Aug, 2018 4 commits
  11. 26 Aug, 2018 10 commits
    • Linus Torvalds's avatar
      Linux 4.19-rc1 · 5b394b2d
      Linus Torvalds authored
      5b394b2d
    • Linus Torvalds's avatar
      Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · b933d6eb
      Linus Torvalds authored
      Pull timer update from Thomas Gleixner:
       "New defines for the compat time* types so they can be shared between
        32bit and 64bit builds. Not used yet, but merging them now allows the
        actual conversions to be merged through different maintainer trees
        without dependencies
      
        We still have compat interfaces for 32bit on 64bit even with the new
        2038 safe timespec/val variants because pointer size is different. And
        for the old style timespec/val interfaces we need yet another 'compat'
        interface for both 32bit native and 32bit on 64bit"
      
      * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        y2038: Provide aliases for compat helpers
      b933d6eb
    • Linus Torvalds's avatar
      Merge branch 'ida-4.19' of git://git.infradead.org/users/willy/linux-dax · aba16dc5
      Linus Torvalds authored
      Pull IDA updates from Matthew Wilcox:
       "A better IDA API:
      
            id = ida_alloc(ida, GFP_xxx);
            ida_free(ida, id);
      
        rather than the cumbersome ida_simple_get(), ida_simple_remove().
      
        The new IDA API is similar to ida_simple_get() but better named.  The
        internal restructuring of the IDA code removes the bitmap
        preallocation nonsense.
      
        I hope the net -200 lines of code is convincing"
      
      * 'ida-4.19' of git://git.infradead.org/users/willy/linux-dax: (29 commits)
        ida: Change ida_get_new_above to return the id
        ida: Remove old API
        test_ida: check_ida_destroy and check_ida_alloc
        test_ida: Convert check_ida_conv to new API
        test_ida: Move ida_check_max
        test_ida: Move ida_check_leaf
        idr-test: Convert ida_check_nomem to new API
        ida: Start new test_ida module
        target/iscsi: Allocate session IDs from an IDA
        iscsi target: fix session creation failure handling
        drm/vmwgfx: Convert to new IDA API
        dmaengine: Convert to new IDA API
        ppc: Convert vas ID allocation to new IDA API
        media: Convert entity ID allocation to new IDA API
        ppc: Convert mmu context allocation to new IDA API
        Convert net_namespace to new IDA API
        cb710: Convert to new IDA API
        rsxx: Convert to new IDA API
        osd: Convert to new IDA API
        sd: Convert to new IDA API
        ...
      aba16dc5
    • Linus Torvalds's avatar
      Merge tag 'gcc-plugins-v4.19-rc1-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux · c4726e77
      Linus Torvalds authored
      Pull gcc plugin fix from Kees Cook:
       "Lift gcc test into Kconfig. This is for better behavior when the
        kernel is built with Clang, reported by Stefan Agner"
      
      * tag 'gcc-plugins-v4.19-rc1-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
        gcc-plugins: Disable when building under Clang
      c4726e77
    • Linus Torvalds's avatar
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · d207ea8e
      Linus Torvalds authored
      Pull perf updates from Thomas Gleixner:
       "Kernel:
         - Improve kallsyms coverage
         - Add x86 entry trampolines to kcore
         - Fix ARM SPE handling
         - Correct PPC event post processing
      
        Tools:
         - Make the build system more robust
         - Small fixes and enhancements all over the place
         - Update kernel ABI header copies
         - Preparatory work for converting libtraceevnt to a shared library
         - License cleanups"
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (100 commits)
        tools arch: Update arch/x86/lib/memcpy_64.S copy used in 'perf bench mem memcpy'
        tools arch x86: Update tools's copy of cpufeatures.h
        perf python: Fix pyrf_evlist__read_on_cpu() interface
        perf mmap: Store real cpu number in 'struct perf_mmap'
        perf tools: Remove ext from struct kmod_path
        perf tools: Add gzip_is_compressed function
        perf tools: Add lzma_is_compressed function
        perf tools: Add is_compressed callback to compressions array
        perf tools: Move the temp file processing into decompress_kmodule
        perf tools: Use compression id in decompress_kmodule()
        perf tools: Store compression id into struct dso
        perf tools: Add compression id into 'struct kmod_path'
        perf tools: Make is_supported_compression() static
        perf tools: Make decompress_to_file() function static
        perf tools: Get rid of dso__needs_decompress() call in __open_dso()
        perf tools: Get rid of dso__needs_decompress() call in symbol__disassemble()
        perf tools: Get rid of dso__needs_decompress() call in read_object_code()
        tools lib traceevent: Change to SPDX License format
        perf llvm: Allow passing options to llc in addition to clang
        perf parser: Improve error message for PMU address filters
        ...
      d207ea8e
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 2a8a2b7c
      Linus Torvalds authored
      Pull x86 fixes from Thomas Gleixner:
      
       - Correct the L1TF fallout on 32bit and the off by one in the 'too much
         RAM for protection' calculation.
      
       - Add a helpful kernel message for the 'too much RAM' case
      
       - Unbreak the VDSO in case that the compiler desides to use indirect
         jumps/calls and emits retpolines which cannot be resolved because the
         kernel uses its own thunks, which does not work for the VDSO. Make it
         use the builtin thunks.
      
       - Re-export start_thread() which was unexported when the 32/64bit
         implementation was unified. start_thread() is required by modular
         binfmt handlers.
      
       - Trivial cleanups
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/speculation/l1tf: Suggest what to do on systems with too much RAM
        x86/speculation/l1tf: Fix off-by-one error when warning that system has too much RAM
        x86/kvm/vmx: Remove duplicate l1d flush definitions
        x86/speculation/l1tf: Fix overflow in l1tf_pfn_limit() on 32bit
        x86/process: Re-export start_thread()
        x86/mce: Add notifier_block forward declaration
        x86/vdso: Fix vDSO build if a retpoline is emitted
      2a8a2b7c
    • Linus Torvalds's avatar
      Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · de375035
      Linus Torvalds authored
      Pull irq update from Thomas Gleixner:
       "A small set of updats/fixes for the irq subsystem:
      
         - Allow GICv3 interrupts to be configured as wake-up sources to
           enable wakeup from suspend
      
         - Make the error handling of the STM32 irqchip init function work
      
         - A set of small cleanups and improvements"
      
      * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        irqchip/gic-v3: Allow interrupt to be configured as wake-up sources
        irqchip/tango: Set irq handler and data in one go
        dt-bindings: irqchip: renesas-irqc: Document r8a774a1 support
        irqchip/s3c24xx: Remove unneeded comparison of unsigned long to 0
        irqchip/stm32: Fix init error handling
        irqchip/bcm7038-l1: Hide cpu offline callback when building for !SMP
      de375035
    • Linus Torvalds's avatar
      Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · a9ce3233
      Linus Torvalds authored
      Pull licking update from Thomas Gleixner:
       "Mark the switch cases which fall through to the next case with the
        proper comment so the fallthrough compiler checks can be enabled"
      
      * 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        futex: Mark expected switch fall-throughs
      a9ce3233
    • Linus Torvalds's avatar
      Merge tag 'libnvdimm-for-4.19_dax-memory-failure' of... · 2923b27e
      Linus Torvalds authored
      Merge tag 'libnvdimm-for-4.19_dax-memory-failure' of gitolite.kernel.org:pub/scm/linux/kernel/git/nvdimm/nvdimm
      
      Pull libnvdimm memory-failure update from Dave Jiang:
       "As it stands, memory_failure() gets thoroughly confused by dev_pagemap
        backed mappings. The recovery code has specific enabling for several
        possible page states and needs new enabling to handle poison in dax
        mappings.
      
        In order to support reliable reverse mapping of user space addresses:
      
         1/ Add new locking in the memory_failure() rmap path to prevent races
            that would typically be handled by the page lock.
      
         2/ Since dev_pagemap pages are hidden from the page allocator and the
            "compound page" accounting machinery, add a mechanism to determine
            the size of the mapping that encompasses a given poisoned pfn.
      
         3/ Given pmem errors can be repaired, change the speculatively
            accessed poison protection, mce_unmap_kpfn(), to be reversible and
            otherwise allow ongoing access from the kernel.
      
        A side effect of this enabling is that MADV_HWPOISON becomes usable
        for dax mappings, however the primary motivation is to allow the
        system to survive userspace consumption of hardware-poison via dax.
        Specifically the current behavior is:
      
           mce: Uncorrected hardware memory error in user-access at af34214200
           {1}[Hardware Error]: It has been corrected by h/w and requires no further action
           mce: [Hardware Error]: Machine check events logged
           {1}[Hardware Error]: event severity: corrected
           Memory failure: 0xaf34214: reserved kernel page still referenced by 1 users
           [..]
           Memory failure: 0xaf34214: recovery action for reserved kernel page: Failed
           mce: Memory error not recovered
           <reboot>
      
        ...and with these changes:
      
           Injecting memory failure for pfn 0x20cb00 at process virtual address 0x7f763dd00000
           Memory failure: 0x20cb00: Killing dax-pmd:5421 due to hardware memory corruption
           Memory failure: 0x20cb00: recovery action for dax page: Recovered
      
        Given all the cross dependencies I propose taking this through
        nvdimm.git with acks from Naoya, x86/core, x86/RAS, and of course dax
        folks"
      
      * tag 'libnvdimm-for-4.19_dax-memory-failure' of gitolite.kernel.org:pub/scm/linux/kernel/git/nvdimm/nvdimm:
        libnvdimm, pmem: Restore page attributes when clearing errors
        x86/memory_failure: Introduce {set, clear}_mce_nospec()
        x86/mm/pat: Prepare {reserve, free}_memtype() for "decoy" addresses
        mm, memory_failure: Teach memory_failure() about dev_pagemap pages
        filesystem-dax: Introduce dax_lock_mapping_entry()
        mm, memory_failure: Collect mapping size in collect_procs()
        mm, madvise_inject_error: Let memory_failure() optionally take a page reference
        mm, dev_pagemap: Do not clear ->mapping on final put
        mm, madvise_inject_error: Disable MADV_SOFT_OFFLINE for ZONE_DEVICE pages
        filesystem-dax: Set page->index
        device-dax: Set page->index
        device-dax: Enable page_mapping()
        device-dax: Convert to vmf_insert_mixed and vm_fault_t
      2923b27e
    • Linus Torvalds's avatar
      Merge tag 'libnvdimm-for-4.19_misc' of gitolite.kernel.org:pub/scm/linux/kernel/git/nvdimm/nvdimm · 828bf6e9
      Linus Torvalds authored
      Pull libnvdimm updates from Dave Jiang:
       "Collection of misc libnvdimm patches for 4.19 submission:
      
         - Adding support to read locked nvdimm capacity.
      
         - Change test code to make DSM failure code injection an override.
      
         - Add support for calculate maximum contiguous area for namespace.
      
         - Add support for queueing a short ARS when there is on going ARS for
           nvdimm.
      
         - Allow NULL to be passed in to ->direct_access() for kaddr and pfn
           params.
      
         - Improve smart injection support for nvdimm emulation testing.
      
         - Fix test code that supports for emulating controller temperature.
      
         - Fix hang on error before devm_memremap_pages()
      
         - Fix a bug that causes user memory corruption when data returned to
           user for ars_status.
      
         - Maintainer updates for Ross Zwisler emails and adding Jan Kara to
           fsdax"
      
      * tag 'libnvdimm-for-4.19_misc' of gitolite.kernel.org:pub/scm/linux/kernel/git/nvdimm/nvdimm:
        libnvdimm: fix ars_status output length calculation
        device-dax: avoid hang on error before devm_memremap_pages()
        tools/testing/nvdimm: improve emulation of smart injection
        filesystem-dax: Do not request kaddr and pfn when not required
        md/dm-writecache: Don't request pointer dummy_addr when not required
        dax/super: Do not request a pointer kaddr when not required
        tools/testing/nvdimm: kaddr and pfn can be NULL to ->direct_access()
        s390, dcssblk: kaddr and pfn can be NULL to ->direct_access()
        libnvdimm, pmem: kaddr and pfn can be NULL to ->direct_access()
        acpi/nfit: queue issuing of ars when an uc error notification comes in
        libnvdimm: Export max available extent
        libnvdimm: Use max contiguous area for namespace size
        MAINTAINERS: Add Jan Kara for filesystem DAX
        MAINTAINERS: update Ross Zwisler's email address
        tools/testing/nvdimm: Fix support for emulating controller temperature
        tools/testing/nvdimm: Make DSM failure code injection an override
        acpi, nfit: Prefer _DSM over _LSR for namespace label reads
        libnvdimm: Introduce locked DIMM capacity support
      828bf6e9