Skip to content
  1. Feb 02, 2021
    • Hui Wang's avatar
      ALSA: jack: implement software jack injection via debugfs · 2d670ea2
      Hui Wang authored
      
      
      This change adds audio jack injection feature through debugfs, with
      this feature, we could validate alsa userspace changes by injecting
      plugin or plugout events to the non-phantom audio jacks.
      
      With this change, the sound core will build the folders
      $debugfs_mount_dir/sound/cardN if SND_DEBUG and DEBUG_FS are enabled.
      And if users also enable the SND_JACK_INJECTION_DEBUG, the jack
      injection nodes will be built in the folder cardN like below:
      
      $tree $debugfs_mount_dir/sound
      $debugfs_mount_dir/sound
      ├── card0
      │   ├── HDMI_DP_pcm_10_Jack
      │   │   ├── jackin_inject
      │   │   ├── kctl_id
      │   │   ├── mask_bits
      │   │   ├── status
      │   │   ├── sw_inject_enable
      │   │   └── type
      ...
      │   └── HDMI_DP_pcm_9_Jack
      │       ├── jackin_inject
      │       ├── kctl_id
      │       ├── mask_bits
      │       ├── status
      │       ├── sw_inject_enable
      │       └── type
      └── card1
          ├── HDMI_DP_pcm_5_Jack
          │   ├── jackin_inject
          │   ├── kctl_id
          │   ├── mask_bits
          │   ├── status
          │   ├── sw_inject_enable
          │   └── type
          ...
          ├── Headphone_Jack
          │   ├── jackin_inject
          │   ├── kctl_id
          │   ├── mask_bits
          │   ├── status
          │   ├── sw_inject_enable
          │   └── type
          └── Headset_Mic_Jack
              ├── jackin_inject
              ├── kctl_id
              ├── mask_bits
              ├── status
              ├── sw_inject_enable
              └── type
      
      The nodes kctl_id, mask_bits, status and type are read-only, users
      could check jack or jack_kctl's information through them.
      
      The nodes sw_inject_enable and jackin_inject are directly used for
      injection. The sw_inject_enable is read-write, users could check if
      software injection is enabled or not on this jack, and users could
      echo 1 or 0 to enable or disable software injection on this jack. Once
      the injection is enabled, the jack will not change by hardware events
      anymore, once the injection is disabled, the jack will restore the
      last reported hardware events to the jack. The jackin_inject is
      write-only, if the injection is enabled, users could echo 1 or 0 to
      this node to inject plugin or plugout events to this jack.
      
      For the detailed usage information on these nodes, please refer to
      Documentation/sound/designs/jack-injection.rst.
      
      Reviewed-by: default avatarTakashi Iwai <tiwai@suse.de>
      Reviewed-by: default avatarJaroslav Kysela <perex@perex.cz>
      Reviewed-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
      Signed-off-by: default avatarHui Wang <hui.wang@canonical.com>
      Link: https://lore.kernel.org/r/20210127085639.74954-2-hui.wang@canonical.com
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      2d670ea2
    • Jasmin Fazlic's avatar
      ALSA: hdsp: hardware output loopback · da2a040e
      Jasmin Fazlic authored
      
      
      Output loopback is a feature where you can record what you hear.
      The HDSP series of the RME interfaces provides this functionality
      at the hardware level and this patch exposes controls to enable or
      disable it per output (playback) channel.
      
      This probably works on other cards but due to a lack of hardware
      it is only tested and enabled for the HDSP9632 card with this patch.
      
      Should this patch be accepted a separate patch will be posted to
      https://github.com/alsa-project/alsa-tools/tree/master/hdspmixer
      which adds "LPBK" buttons to each output in the playback strip for
      the user to be able to control this feature from the user land.
      Users from Windows tool TotalMixFX should be familiar with this.
      
      Signed-off-by: default avatarJasmin Fazlic <superfassl@gmail.com>
      Link: https://lore.kernel.org/r/95cb3117-e85a-51a6-c2ce-bf736e70fc4c@gmail.com
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      da2a040e
  2. Feb 01, 2021
  3. Jan 31, 2021
  4. Jan 26, 2021
  5. Jan 25, 2021
  6. Jan 24, 2021
  7. Jan 21, 2021
    • Takashi Iwai's avatar
      ALSA: usb-audio: Fix "RANGE setting not yet supported" errors · 85db1cfb
      Takashi Iwai authored
      
      
      At probing a UAC2/UAC3 device like NUX MG-300 USB interface, we get
      error messages "RANGE setting not yet supported".  It comes the place
      where the driver tries to determine the resolution of mixer volumes
      via SET_CUR_RES and GET_CUR_RES verbs.  Those verbs aren't supported
      on UAC2 and UAC3, hence the driver warns like the above.  Although the
      driver handles this error and works as expected, it's still ugly to
      show such errors unnecessarily.
      
      This patch papers over the errors by applying the resolution detection
      only for UAC1 and skipping it for UAC2/UAC3.
      
      Reported-by: default avatarMike Oliphant <oliphant@nostatic.org>
      Link: https://lore.kernel.org/r/20210120213932.1971-2-tiwai@suse.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      85db1cfb
    • Takashi Iwai's avatar
      ALSA: usb-audio: Skip the clock selector inquiry for single connections · 086b957c
      Takashi Iwai authored
      
      
      The current USB-audio driver gets an error at probing NUX MG-300 about
      parsing the clocks.  This is because the firmware doesn't return the
      proper connection of the clock selector that is connected to a single
      clock; it's likely that the firmware was lazy^w optimized and the
      inquiry wasn't handled.  Actually it makes little sense to inquire and
      set up the single connection explicitly.
      
      This patch fixes the issue by simply skipping the clock selector
      inquiry if it's a single connection.
      
      Reported-by: default avatarMike Oliphant <oliphant@nostatic.org>
      Link: https://lore.kernel.org/r/20210120213932.1971-1-tiwai@suse.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      086b957c
  8. Jan 19, 2021
  9. Jan 18, 2021
    • Takashi Iwai's avatar
      ALSA: usb-audio: Avoid implicit feedback on Pioneer devices · 532a208a
      Takashi Iwai authored
      For addressing the regression on Pioneer devices, we recently
      corrected the quirk code to enable the implicit feedback mode on those
      devices properly.  However, the devices still showed problems with the
      full duplex operations with JACK, and after debug sessions, we figured
      out that the older kernels that had worked with JACK also didn't use
      the implicit feedback mode at all although they had the quirk code to
      enable it; instead, the old code worked just to skip the normal sync
      endpoint setup that would have been detected without it.  IOW, what
      broke without the implicit-fb quirk in the past was the application of
      the normal sync endpoint that is actually the capture data endpoint on
      these devices.
      
      This patch covers the overseen piece: it modifies the quirk code again
      not to enable the implicit feedback mode but just to make the driver
      skipping the sync endpoint detection.  This made the driver working
      with JACK full-duplex mode again.
      
      Still it's not quite clear why the implicit feedback doesn't work on
      those devices yet; maybe it's about some issues in the URB setup.  But
      at least, with this patch, the driver should work in the level of the
      older kernels again.
      
      Fixes: 167c9dc8
      
       ("ALSA: usb-audio: Fix implicit feedback sync setup for Pioneer devices")
      Link: https://lore.kernel.org/r/20210118075816.25068-4-tiwai@suse.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      532a208a
    • Takashi Iwai's avatar
      ALSA: usb-audio: Set sample rate for all sharing EPs on UAC1 · 3784d449
      Takashi Iwai authored
      The UAC2/3 sample rate setup is based on the clock node, which is
      usually shared in the interface, and can't be re-setup without
      deselecting the interface once, and that's how the current code
      behaves.  OTOH, the sample rate setup of UAC1 is per endpoint, hence
      we basically need to call for each endpoint usage even if those share
      the same interface.
      
      This patch fixes the behavior of UAC1 to call always
      snd_usb_init_sample_rate() in snd_usb_endpoint_configure().
      
      Fixes: bf6313a0
      
       ("ALSA: usb-audio: Refactor endpoint management")
      Link: https://lore.kernel.org/r/20210118075816.25068-3-tiwai@suse.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      3784d449
    • Takashi Iwai's avatar
      ALSA: usb-audio: Fix UAC1 rate setup for secondary endpoints · 87cb9af9
      Takashi Iwai authored
      
      
      The current sample rate setup function for UAC1 assumes only the first
      endpoint retrieved from the interface:altset pair, but the rate set up
      may be needed also for the secondary endpoint.  Also, retrieving the
      endpoint number from the interface descriptor is redundant; we have
      already the target endpoint in the given audioformat object.
      
      This patch simplifies the code and corrects the target endpoint as
      described in the above.  It simply refers to fmt->endpoint directly.
      
      Also, this patch drops the pioneer_djm_set_format_quirk() that is
      caleld from snd_usb_set_format_quirk(); this function does the sample
      rate setup but for the capture endpoint (0x82), and that's exactly
      what the change above fixes.
      
      Link: https://lore.kernel.org/r/20210118075816.25068-2-tiwai@suse.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      87cb9af9
    • Linus Torvalds's avatar
      Linux 5.11-rc4 · 19c329f6
      Linus Torvalds authored
      v5.11-rc4
      19c329f6
    • Linus Torvalds's avatar
      Merge tag 'perf-tools-fixes-2021-01-17' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux · e2da7836
      Linus Torvalds authored
      Pull perf tools fixes from Arnaldo Carvalho de Melo:
      
       - Fix 'CPU too large' error in Intel PT
      
       - Correct event attribute sizes in 'perf inject'
      
       - Sync build_bug.h and kvm.h kernel copies
      
       - Fix bpf.h header include directive in 5sec.c 'perf trace' bpf example
      
       - libbpf tests fixes
      
       - Fix shadow stat 'perf test' for non-bash shells
      
       - Take cgroups into account for shadow stats in 'perf stat'
      
      * tag 'perf-tools-fixes-2021-01-17' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux:
        perf inject: Correct event attribute sizes
        perf intel-pt: Fix 'CPU too large' error
        perf stat: Take cgroups into account for shadow stats
        perf stat: Introduce struct runtime_stat_data
        libperf tests: Fail when failing to get a tracepoint id
        libperf tests: If a test fails return non-zero
        libperf tests: Avoid uninitialized variable warning
        perf test: Fix shadow stat test for non-bash shells
        tools headers: Syncronize linux/build_bug.h with the kernel sources
        tools headers UAPI: Sync kvm.h headers with the kernel sources
        perf bpf examples: Fix bpf.h header include directive in 5sec.c example
      e2da7836
    • Linus Torvalds's avatar
      Merge tag 'powerpc-5.11-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · a1339d63
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
       "One fix for a lack of alignment in our linker script, that can lead to
        crashes depending on configuration etc.
      
        One fix for the 32-bit VDSO after the C VDSO conversion.
      
        Thanks to Andreas Schwab, Ariel Marcovitch, and Christophe Leroy"
      
      * tag 'powerpc-5.11-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc/vdso: Fix clock_gettime_fallback for vdso32
        powerpc: Fix alignment bug within the init sections
      a1339d63
    • Linus Torvalds's avatar
      Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · a527a2b3
      Linus Torvalds authored
      Pull misc vfs fixes from Al Viro:
       "Several assorted fixes.
      
        I still think that audit ->d_name race is better fixed this way for
        the benefit of backports, with any possibly fancier variants done on
        top of it"
      
      * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        dump_common_audit_data(): fix racy accesses to ->d_name
        iov_iter: fix the uaccess area in copy_compat_iovec_from_user
        umount(2): move the flag validity checks first
      a527a2b3
    • Linus Torvalds's avatar
      mm: don't put pinned pages into the swap cache · feb889fb
      Linus Torvalds authored
      So technically there is nothing wrong with adding a pinned page to the
      swap cache, but the pinning obviously means that the page can't actually
      be free'd right now anyway, so it's a bit pointless.
      
      However, the real problem is not with it being a bit pointless: the real
      issue is that after we've added it to the swap cache, we'll try to unmap
      the page.  That will succeed, because the code in mm/rmap.c doesn't know
      or care about pinned pages.
      
      Even the unmapping isn't fatal per se, since the page will stay around
      in memory due to the pinning, and we do hold the connection to it using
      the swap cache.  But when we then touch it next and take a page fault,
      the logic in do_swap_page() will map it back into the process as a
      possibly read-only page, and we'll then break the page association on
      the next COW fault.
      
      Honestly, this issue could have been fixed in any of those other places:
      (a) we could refuse to unmap a pinned page (which makes conceptual
      sense), or (b) we could make sure to re-map a pinned page writably in
      do_swap_page(), or (c) we could just make do_wp_page() not COW the
      pinned page (which was what we historically did before that "mm:
      do_wp_page() simplification" commit).
      
      But while all of them are equally valid models for breaking this chain,
      not putting pinned pages into the swap cache in the first place is the
      simplest one by far.
      
      It's also the safest one: the reason why do_wp_page() was changed in the
      first place was that getting the "can I re-use this page" wrong is so
      fraught with errors.  If you do it wrong, you end up with an incorrectly
      shared page.
      
      As a result, using "page_maybe_dma_pinned()" in either do_wp_page() or
      do_swap_page() would be a serious bug since it is only a (very good)
      heuristic.  Re-using the page requires a hard black-and-white rule with
      no room for ambiguity.
      
      In contrast, saying "this page is very likely dma pinned, so let's not
      add it to the swap cache and try to unmap it" is an obviously safe thing
      to do, and if the heuristic might very rarely be a false positive, no
      harm is done.
      
      Fixes: 09854ba9
      
       ("mm: do_wp_page() simplification")
      Reported-and-tested-by: default avatarMartin Raiber <martin@urbackup.org>
      Cc: Pavel Begunkov <asml.silence@gmail.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Peter Xu <peterx@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      feb889fb
  10. Jan 17, 2021
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 0da0a8a0
      Linus Torvalds authored
      
      
      Pull SCSI fixes from James Bottomley:
       "Nine minor fixes, seven in drivers and two in the core SCSI disk
        driver (sd) which should be harmless involving removing an unused
        variable and quietening a spurious warning"
      
      Signed-off-by: default avatarJames E.J. Bottomley <jejb@linux.ibm.com>
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: sd: Remove obsolete variable in sd_remove()
        scsi: sd: Suppress spurious errors when WRITE SAME is being disabled
        scsi: scsi_debug: Fix memleak in scsi_debug_init()
        scsi: mpt3sas: Fix spelling mistake in Kconfig "compatiblity" -> "compatibility"
        scsi: qedi: Correct max length of CHAP secret
        scsi: ufs: Correct the LUN used in eh_device_reset_handler() callback
        scsi: ufs: Relocate flush of exceptional event
        scsi: ufs: Relax the condition of UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL
        scsi: ufs: Fix possible power drain during system suspend
      0da0a8a0
    • Al Viro's avatar
      dump_common_audit_data(): fix racy accesses to ->d_name · d36a1dd9
      Al Viro authored
      
      
      We are not guaranteed the locking environment that would prevent
      dentry getting renamed right under us.  And it's possible for
      old long name to be freed after rename, leading to UAF here.
      
      Cc: stable@kernel.org # v2.6.2+
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      d36a1dd9
    • Linus Torvalds's avatar
      Merge tag 'block-5.11-2021-01-16' of git://git.kernel.dk/linux-block · 54c6247d
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
       "Just an nvme pull request via Christoph:
      
         - don't initialize hwmon for discover controllers (Sagi Grimberg)
      
         - fix iov_iter handling in nvme-tcp (Sagi Grimberg)
      
         - fix a preempt warning in nvme-tcp (Sagi Grimberg)
      
         - fix a possible NULL pointer dereference in nvme (Israel Rukshin)"
      
      * tag 'block-5.11-2021-01-16' of git://git.kernel.dk/linux-block:
        nvme: don't intialize hwmon for discovery controllers
        nvme-tcp: fix possible data corruption with bio merges
        nvme-tcp: Fix warning with CONFIG_DEBUG_PREEMPT
        nvmet-rdma: Fix NULL deref when setting pi_enable and traddr INADDR_ANY
      54c6247d
    • Linus Torvalds's avatar
      Merge tag 'io_uring-5.11-2021-01-16' of git://git.kernel.dk/linux-block · 11c0239a
      Linus Torvalds authored
      Pull io_uring fixes from Jens Axboe:
       "We still have a pending fix for a cancelation issue, but it's still
        being investigated. In the meantime:
      
         - Dead mm handling fix (Pavel)
      
         - SQPOLL setup error handling (Pavel)
      
         - Flush timeout sequence fix (Marcelo)
      
         - Missing finish_wait() for one exit case"
      
      * tag 'io_uring-5.11-2021-01-16' of git://git.kernel.dk/linux-block:
        io_uring: ensure finish_wait() is always called in __io_uring_task_cancel()
        io_uring: flush timeouts that should already have expired
        io_uring: do sqo disable on install_fd error
        io_uring: fix null-deref in io_disable_sqo_submit
        io_uring: don't take files/mm for a dead task
        io_uring: drop mm and files after task_work_run
      11c0239a
    • Linus Torvalds's avatar
      Merge tag 'riscv-for-linus-5.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux · acda701b
      Linus Torvalds authored
      Pull RISC-V fixes from Palmer Dabbelt:
       "There are a few more fixes than a normal rc4, largely due to the
        bubble introduced by the holiday break:
      
         - return -ENOSYS for syscall number -1, which previously returned an
           uninitialized value.
      
         - ensure of_clk_init() has been called in time_init(), without which
           clock drivers may not be initialized.
      
         - fix sifive,uart0 driver to properly display the baud rate. A fix to
           initialize MPIE that allows interrupts to be processed during
           system calls.
      
         - avoid erronously begin tracing IRQs when interrupts are disabled,
           which at least triggers suprious lockdep failures.
      
         - workaround for a warning related to calling smp_processor_id()
           while preemptible. The warning itself is suprious on currently
           availiable systems.
      
         - properly include the generic time VDSO calls. A fix to our kasan
           address mapping. A fix to the HiFive Unleashed device tree, which
           allows the Ethernet PHY to be properly initialized by Linux (as
           opposed to relying on the bootloader).
      
         - defconfig update to include SiFive's GPIO driver, which is present
           on the HiFive Unleashed and necessary to initialize the PHY.
      
         - avoid allocating memory while initializing reserved memory.
      
         - avoid allocating the last 4K of memory, as pointers there alias
           with syscall errors.
      
        There are also two cleanups that should have no functional effect but
        do fix build warnings:
      
         - drop a duplicated definition of PAGE_KERNEL_EXEC.
      
         - properly declare the asm register SP shim.
      
         - cleanup the rv32 memory size Kconfig entry, to reflect the actual
           size of memory availiable"
      
      * tag 'riscv-for-linus-5.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
        RISC-V: Fix maximum allowed phsyical memory for RV32
        RISC-V: Set current memblock limit
        RISC-V: Do not allocate memblock while iterating reserved memblocks
        riscv: stacktrace: Move register keyword to beginning of declaration
        riscv: defconfig: enable gpio support for HiFive Unleashed
        dts: phy: add GPIO number and active state used for phy reset
        dts: phy: fix missing mdio device and probe failure of vsc8541-01 device
        riscv: Fix KASAN memory mapping.
        riscv: Fixup CONFIG_GENERIC_TIME_VSYSCALL
        riscv: cacheinfo: Fix using smp_processor_id() in preemptible
        riscv: Trace irq on only interrupt is enabled
        riscv: Drop a duplicated PAGE_KERNEL_EXEC
        riscv: Enable interrupts during syscalls with M-Mode
        riscv: Fix sifive serial driver
        riscv: Fix kernel time_init()
        riscv: return -ENOSYS for syscall -1
      acda701b
    • Linus Torvalds's avatar
      mm: don't play games with pinned pages in clear_page_refs · 9348b73c
      Linus Torvalds authored
      
      
      Turning a pinned page read-only breaks the pinning after COW.  Don't do it.
      
      The whole "track page soft dirty" state doesn't work with pinned pages
      anyway, since the page might be dirtied by the pinning entity without
      ever being noticed in the page tables.
      
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      9348b73c
    • Linus Torvalds's avatar
      mm: fix clear_refs_write locking · 29a951df
      Linus Torvalds authored
      
      
      Turning page table entries read-only requires the mmap_sem held for
      writing.
      
      So stop doing the odd games with turning things from read locks to write
      locks and back.  Just get the write lock.
      
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      29a951df
  11. Jan 16, 2021