1. Oct 15, 2021
  2. Oct 14, 2021
  3. Oct 13, 2021
    • Jonas Hahnfeld's avatar
      ALSA: usb-audio: Add quirk for VF0770 · 48827e1d
      Jonas Hahnfeld authored
      
      
      The device advertises 8 formats, but only a rate of 48kHz is honored
      by the hardware and 24 bits give chopped audio, so only report the
      one working combination. This fixes out-of-the-box audio experience
      with PipeWire which otherwise attempts to choose S24_3LE (while
      PulseAudio defaulted to S16_LE).
      
      Signed-off-by: default avatarJonas Hahnfeld <hahnjo@hahnjo.de>
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20211012200906.3492-1-hahnjo@hahnjo.de
      
      
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      48827e1d
    • Kai Vehmanen's avatar
      ALSA: hda: avoid write to STATESTS if controller is in reset · b37a1518
      Kai Vehmanen authored
      The snd_hdac_bus_reset_link() contains logic to clear STATESTS register
      before performing controller reset. This code dates back to an old
      bugfix in commit e8a7f136 ("[ALSA] hda-intel - Improve HD-audio
      codec probing robustness"). Originally the code was added to
      azx_reset().
      
      The code was moved around in commit a41d1224
      
       ("ALSA: hda - Embed bus
      into controller object") and ended up to snd_hdac_bus_reset_link() and
      called primarily via snd_hdac_bus_init_chip().
      
      The logic to clear STATESTS is correct when snd_hdac_bus_init_chip() is
      called when controller is not in reset. In this case, STATESTS can be
      cleared. This can be useful e.g. when forcing a controller reset to retry
      codec probe. A normal non-power-on reset will not clear the bits.
      
      However, this old logic is problematic when controller is already in
      reset. The HDA specification states that controller must be taken out of
      reset before writing to registers other than GCTL.CRST (1.0a spec,
      3.3.7). The write to STATESTS in snd_hdac_bus_reset_link() will be lost
      if the controller is already in reset per the HDA specification mentioned.
      
      This has been harmless on older hardware. On newer generation of Intel
      PCIe based HDA controllers, if configured to report issues, this write
      will emit an unsupported request error. If ACPI Platform Error Interface
      (APEI) is enabled in kernel, this will end up to kernel log.
      
      Fix the code in snd_hdac_bus_reset_link() to only clear the STATESTS if
      the function is called when controller is not in reset. Otherwise
      clearing the bits is not possible and should be skipped.
      
      Signed-off-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
      Link: https://lore.kernel.org/r/20211012142935.3731820-1-kai.vehmanen@linux.intel.com
      
      
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      b37a1518
  4. Oct 12, 2021
    • Hui Wang's avatar
      ALSA: hda/realtek: Fix the mic type detection issue for ASUS G551JW · a3fd1a98
      Hui Wang authored
      We need to define the codec pin 0x1b to be the mic, but somehow
      the mic doesn't support hot plugging detection, and Windows also has
      this issue, so we set it to phantom headset-mic.
      
      Also the determine_headset_type() often returns the omtp type by a
      mistake when we plug a ctia headset, this makes the mic can't record
      sound at all. Because most of the headset are ctia type nowadays and
      some machines have the fixed ctia type audio jack, it is possible this
      machine has the fixed ctia jack too. Here we set this mic jack to
      fixed ctia type, this could avoid the mic type detection mistake and
      make the ctia headset work stable.
      
      BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=214537
      
      
      Reported-and-tested-by: default avatarmsd <msd.mmq@gmail.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarHui Wang <hui.wang@canonical.com>
      Link: https://lore.kernel.org/r/20211012114748.5238-1-hui.wang@canonical.com
      
      
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      a3fd1a98
    • Takashi Iwai's avatar
      ALSA: pcm: Workaround for a wrong offset in SYNC_PTR compat ioctl · 228af5a4
      Takashi Iwai authored
      Michael Forney reported an incorrect padding type that was defined in
      the commit 80fe7430 ("ALSA: add new 32-bit layout for
      snd_pcm_mmap_status/control") for PCM control mmap data.
      His analysis is correct, and this caused the misplacements of PCM
      control data on 32bit arch and 32bit compat mode.
      
      The bug is that the __pad2 definition in __snd_pcm_mmap_control64
      struct was wrongly with __pad_before_uframe, which should have been
      __pad_after_uframe instead.  This struct is used in SYNC_PTR ioctl and
      control mmap.  Basically this bug leads to two problems:
      
      - The offset of avail_min field becomes wrong, it's placed right after
        appl_ptr without padding on little-endian
      
      - When appl_ptr and avail_min are read as 64bit values in kernel side,
        the values become either zero or corrupted (mixed up)
      
      One good news is that, because both user-space and kernel
      misunderstand the wrong offset, at least, 32bit application running on
      32bit kernel works as is.  Also, 64bit applications are unaffected
      because the padding size is zero.  The remaining problem is the 32bit
      compat mode; as mentioned in the above, avail_min is placed right
      after appl_ptr on little-endian archs, 64bit kernel reads bogus values
      for appl_ptr updates, which may lead to streaming bugs like jumping,
      XRUN or whatever unexpected.
      (However, we haven't heard any serious bug reports due to this over
      years, so practically seen, it's fairly safe to assume that the impact
      by this bug is limited.)
      
      Ideally speaking, we should correct the wrong mmap status control
      definition.  But this would cause again incompatibility with the
      existing binaries, and fixing it (e.g. by renumbering ioctls) would be
      really messy.
      
      So, as of this patch, we only correct the behavior of 32bit compat
      mode and keep the rest as is.  Namely, the SYNC_PTR ioctl is now
      handled differently in compat mode to read/write the 32bit values at
      the right offsets.  The control mmap of 32bit apps on 64bit kernels
      has been already disabled (which is likely rather an overlook, but
      this worked fine at this time :), so covering SYNC_PTR ioctl should
      suffice as a fallback.
      
      Fixes: 80fe7430
      
       ("ALSA: add new 32-bit layout for snd_pcm_mmap_status/control")
      Reported-by: default avatarMichael Forney <mforney@mforney.org>
      Reviewed-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: <stable@vger.kernel.org>
      Cc: Rich Felker <dalias@libc.org>
      Link: https://lore.kernel.org/r/29QBMJU8DE71E.2YZSH8IHT5HMH@mforney.org
      Link: https://lore.kernel.org/r/20211010075546.23220-1-tiwai@suse.de
      
      
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      228af5a4
  5. Oct 11, 2021
  6. Oct 07, 2021
    • Takashi Iwai's avatar
      ALSA: hda: intel: Allow repeatedly probing on codec configuration errors · c0f1886d
      Takashi Iwai authored
      It seems that a few recent AMD systems show the codec configuration
      errors at the early boot, while loading the driver at a later stage
      works magically.  Although the root cause of the error isn't clear,
      it's certainly not bad to allow retrying the codec probe in such a
      case if that helps.
      
      This patch adds the capability for retrying the probe upon codec probe
      errors on the certain AMD platforms.  The probe_work is changed to a
      delayed work, and at the secondary call, it'll jump to the codec
      probing.
      
      Note that, not only adding the re-probing, this includes the behavior
      changes in the codec configuration function.  Namely,
      snd_hda_codec_configure() won't unregister the codec at errors any
      longer.  Instead, its caller, azx_codec_configure() unregisters the
      codecs with the probe failures *if* any codec has been successfully
      configured.  If all codec probe failed, it doesn't unregister but let
      it re-probed -- which is the most case we're seeing and this patch
      tries to improve.
      
      Even if the driver doesn't re-probe or give up, it will go to the
      "free-all" error path, hence the leftover codecs shall be disabled /
      deleted in anyway.
      
      BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1190801
      Link: https://lore.kernel.org/r/20211006141940.2897-1-tiwai@suse.de
      
      
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      c0f1886d
  7. Oct 06, 2021
  8. Oct 05, 2021
  9. Oct 04, 2021
  10. Oct 01, 2021
  11. Sep 30, 2021
  12. Sep 28, 2021
    • Thomas Gleixner's avatar
      ALSA: pcsp: Make hrtimer forwarding more robust · f2ff7147
      Thomas Gleixner authored
      The hrtimer callback pcsp_do_timer() prepares rearming of the timer with
      hrtimer_forward(). hrtimer_forward() is intended to provide a mechanism to
      forward the expiry time of the hrtimer by a multiple of the period argument
      so that the expiry time greater than the time provided in the 'now'
      argument.
      
      pcsp_do_timer() invokes hrtimer_forward() with the current timer expiry
      time as 'now' argument. That's providing a periodic timer expiry, but is
      not really robust when the timer callback is delayed so that the resulting
      new expiry time is already in the past which causes the callback to be
      invoked immediately again. If the timer is delayed then the back to back
      invocation is not really making it better than skipping the missed
      periods. Sound is distorted in any case.
      
      Use hrtimer_forward_now() which ensures that the next expiry is in the
      future. This prevents hogging the CPU in the timer expiry code and allows
      later on to remove hrtimer_forward() from the publi...
      f2ff7147
  13. Sep 23, 2021
  14. Sep 22, 2021
  15. Sep 17, 2021
  16. Sep 16, 2021
  17. Sep 15, 2021
  18. Sep 14, 2021
  19. Sep 13, 2021
    • Takashi Iwai's avatar
      ALSA: usb-audio: Unify mixer resume and reset_resume procedure · 7b9cf903
      Takashi Iwai authored
      
      
      USB-audio driver assumes that the normal resume would preserve the
      device configuration while reset_resume wouldn't, and tries to restore
      the mixer elements only at reset_resume callback.  However, this seems
      too naive, and some devices do behave differently, resetting the
      volume at the normal resume; this resulted in the inconsistent volume
      that surprised users.
      
      This patch changes the mixer resume code to handle both the normal and
      reset resume in the same way, always restoring the original mixer
      element values.  This allows us to unify the both callbacks as well as
      dropping the no longer used reset_resume field, which ends up with a
      good code reduction.
      
      A slight behavior change by this patch is that now we assign
      restore_mixer_value() as the default resume callback, and the function
      is no longer called at reset-resume when the resume callback is
      overridden by the quirk function.  That is, if needed, the quirk
      resume function would have to handle similarly as
      restore_mixer_value() by itself.
      
      Reported-by: default avatarEn-Shuo Hsu <enshuo@chromium.org>
      Cc: Yu-Hsuan Hsu <yuhsuan@chromium.org>
      Link: https://lore.kernel.org/r/CADDZ45UPsbpAAqP6=ZkTT8BE-yLii4Y7xSDnjK550G2DhQsMew@mail.gmail.com
      Link: https://lore.kernel.org/r/20210910105155.12862-1-tiwai@suse.de
      
      
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      7b9cf903
    • Takashi Iwai's avatar
      Revert "ALSA: hda: Drop workaround for a hang at shutdown again" · 6f445784
      Takashi Iwai authored
      This reverts commit 8fc8e903.
      
      It was expected that the fixes in HD-audio codec side would make the
      workaround redundant, but unfortunately it doesn't seem sufficing.
      Resurrect the workaround for now.
      
      Fixes: 8fc8e903 ("ALSA: hda: Drop workaround for a hang at shutdown again")
      BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=214045
      Link: https://lore.kernel.org/r/20210913124330.24530-1-tiwai@suse.de
      
      
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      6f445784
    • Takashi Sakamoto's avatar
      ALSA: oxfw: fix transmission method for Loud models based on OXFW971 · 64794d6d
      Takashi Sakamoto authored
      
      
      Loud Technologies Mackie Onyx 1640i (former model) is identified as
      the model which uses OXFW971. The analysis of packet dump shows that
      it transfers events in blocking method of IEC 61883-6, however the
      default behaviour of ALSA oxfw driver is for non-blocking method.
      
      This commit adds code to detect it assuming that all of loud models
      based on OXFW971 have such quirk. It brings no functional change
      except for alignment rule of PCM buffer.
      
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Link: https://lore.kernel.org/r/20210913021042.10085-1-o-takashi@sakamocchi.jp
      
      
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      64794d6d
    • Linus Torvalds's avatar
      Linux 5.15-rc1 · 6880fa6c
      Linus Torvalds authored
      6880fa6c
    • Linus Torvalds's avatar
      Merge tag 'perf-tools-for-v5.15-2021-09-11' of... · b5b65f13
      Linus Torvalds authored
      Merge tag 'perf-tools-for-v5.15-2021-09-11' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
      
      Pull more perf tools updates from Arnaldo Carvalho de Melo:
      
       - Add missing fields and remove some duplicate fields when printing a
         perf_event_attr.
      
       - Fix hybrid config terms list corruption.
      
       - Update kernel header copies, some resulted in new kernel features
         being automagically added to 'perf trace' syscall/tracepoint argument
         id->string translators.
      
       - Add a file generated during the documentation build to .gitignore.
      
       - Add an option to build without libbfd, as some distros, like Debian
         consider its ABI unstable.
      
       - Add support to print a textual representation of IBS raw sample data
         in 'perf report'.
      
       - Fix bpf 'perf test' sample mismatch reporting
      
       - Fix passing arguments to stackcollapse report in a 'perf script'
         python script.
      
       - Allow build-id with trailing zeros.
      
       - Look for ImageBase in PE file to compute .text offset.
      
      * tag 'perf-tools-for-v5.15-2021-09-11' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: (25 commits)
        tools headers UAPI: Update tools's copy of drm.h headers
        tools headers UAPI: Sync drm/i915_drm.h with the kernel sources
        tools headers UAPI: Sync linux/fs.h with the kernel sources
        tools headers UAPI: Sync linux/in.h copy with the kernel sources
        perf tools: Add an option to build without libbfd
        perf tools: Allow build-id with trailing zeros
        perf tools: Fix hybrid config terms list corruption
        perf tools: Factor out copy_config_terms() and free_config_terms()
        perf tools: Fix perf_event_attr__fprintf() missing/dupl. fields
        perf tools: Ignore Documentation dependency file
        perf bpf: Provide a weak btf__load_from_kernel_by_id() for older libbpf versions
        tools include UAPI: Update linux/mount.h copy
        perf beauty: Cover more flags in the  move_mount syscall argument beautifier
        tools headers UAPI: Sync linux/prctl.h with the kernel sources
        tools include UAPI: Sync sound/asound.h copy with the kernel sources
        tools headers UAPI: Sync linux/kvm.h with the kernel sources
        tools headers UAPI: Sync x86's asm/kvm.h with the kernel sources
        perf report: Add support to print a textual representation of IBS raw sample data
        perf report: Add tools/arch/x86/include/asm/amd-ibs.h
        perf env: Add perf_env__cpuid, perf_env__{nr_}pmu_mappings
        ...
      b5b65f13
    • Linus Torvalds's avatar
      Merge tag 'compiler-attributes-for-linus-v5.15-rc1-v2' of git://github.com/ojeda/linux · c3e46874
      Linus Torvalds authored
      Pull compiler attributes updates from Miguel Ojeda:
      
       - Fix __has_attribute(__no_sanitize_coverage__) for GCC 4 (Marco Elver)
      
       - Add Nick as Reviewer for compiler_attributes.h (Nick Desaulniers)
      
       - Move __compiletime_{error|warning} (Nick Desaulniers)
      
      * tag 'compiler-attributes-for-linus-v5.15-rc1-v2' of git://github.com/ojeda/linux:
        compiler_attributes.h: move __compiletime_{error|warning}
        MAINTAINERS: add Nick as Reviewer for compiler_attributes.h
        Compiler Attributes: fix __has_attribute(__no_sanitize_coverage__) for GCC 4
      c3e46874
    • Linus Torvalds's avatar
      Merge tag 'auxdisplay-for-linus-v5.15-rc1' of git://github.com/ojeda/linux · d41adc4e
      Linus Torvalds authored
      Pull auxdisplay updates from Miguel Ojeda:
       "An assortment of improvements for auxdisplay:
      
         - Replace symbolic permissions with octal permissions (Jinchao Wang)
      
         - ks0108: Switch to use module_parport_driver() (Andy Shevchenko)
      
         - charlcd: Drop unneeded initializers and switch to C99 style (Andy
           Shevchenko)
      
         - hd44780: Fix oops on module unloading (Lars Poeschel)
      
         - Add I2C gpio expander example (Ralf Schlatterbeck)"
      
      * tag 'auxdisplay-for-linus-v5.15-rc1' of git://github.com/ojeda/linux:
        auxdisplay: Replace symbolic permissions with octal permissions
        auxdisplay: ks0108: Switch to use module_parport_driver()
        auxdisplay: charlcd: Drop unneeded initializers and switch to C99 style
        auxdisplay: hd44780: Fix oops on module unloading
        auxdisplay: Add I2C gpio expander example
      d41adc4e