1. 07 Jul, 2019 8 commits
    • Takashi Iwai's avatar
      Merge branch 'topic/hda-refresh-cleanup' into for-next · b89b889a
      Takashi Iwai authored
      Merge a cleanup for HD-audio widget refresh code
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      b89b889a
    • Nicola Lunghi's avatar
      ALSA: usb-audio: fix Line6 Helix audio format rates · d4bd3053
      Nicola Lunghi authored
      Line6 Helix and HX stomp devices don't support retrieving
      the number of clock sample rate.
      
      Add a quirk to set it to 48Khz by default.
      
      [ fixed wrong variable initialization changes by tiwai ]
      Signed-off-by: default avatarNicola Lunghi <nick83ola@gmail.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      d4bd3053
    • Takashi Sakamoto's avatar
      firewire-motu: fix wrong reference count for stream functionality at error... · ba18ca2b
      Takashi Sakamoto authored
      firewire-motu: fix wrong reference count for stream functionality at error path of rawmidi interface
      
      In IEC 61883-6, several types of sampling data can be multiplexed into
      payload of common isochronous packet (CIP). For typical audio and music
      units, PCM samples and MIDI messages are multiplexed into one packet
      streaming.
      
      ALSA firewire-motu driver allows applications of rawmidi interface to
      start packet streaming for transmission of MIDI messages. However at
      error path, the reference count of stream functionality is not operated
      correctly. This can brings a bug that packet streaming is not stopped
      when all referrers release the count.
      
      This commit fixes the bug.
      
      Fixes: 8edc56ec ("ALSA: firewire-motu: reserve/release isochronous resources in pcm.hw_params/hw_free callbacks")
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      ba18ca2b
    • Takashi Sakamoto's avatar
      ALSA: firewire-digi00x: fix wrong reference count for stream functionality at... · 64582c56
      Takashi Sakamoto authored
      ALSA: firewire-digi00x: fix wrong reference count for stream functionality at error path of rawmidi interface
      
      In IEC 61883-6, several types of sampling data can be multiplexed into
      payload of common isochronous packet (CIP). For typical audio and music
      units, PCM samples and MIDI messages are multiplexed into one packet
      streaming.
      
      ALSA firewire-digi00x driver allows applications of rawmidi interface to
      start packet streaming for transmission of MIDI messages. However at
      error path, the reference count of stream functionality is not operated
      correctly. This can brings a bug that packet streaming is not stopped
      when all referrers release the count.
      
      This commit fixes the bug.
      
      Fixes: ae8ffbb2 ("ALSA: firewire-digi00x: reserve/release isochronous resources in pcm.hw_params/hw_free callbacks")
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      64582c56
    • Takashi Sakamoto's avatar
      ALSA: dice: fix wrong reference count for stream functionality at error path of rawmidi interface · e79c3f0c
      Takashi Sakamoto authored
      In IEC 61883-6, several types of sampling data can be multiplexed into
      payload of common isochronous packet (CIP). For typical audio and music
      units, PCM samples and MIDI messages are multiplexed into one packet
      streaming.
      
      ALSA dice driver allows applications of rawmidi interface to start
      packet streaming for transmission of MIDI messages. However at error
      path, the reference count of stream functionality is not operated
      correctly. This can brings a bug that packet streaming is not stopped
      when all referrers release the count.
      
      This commit fixes the bug.
      
      Fixes: 3cd2c2d7 ("ALSA: dice: reserve/release isochronous resources in pcm.hw_params/hw_free callbacks")
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      e79c3f0c
    • Takashi Sakamoto's avatar
      ALSA: oxfw: fix wrong reference count for stream functionality at error path of rawmidi interface · 03a954ae
      Takashi Sakamoto authored
      In IEC 61883-6, several types of sampling data can be multiplexed into
      payload of common isochronous packet (CIP). For typical audio and music
      units, PCM samples and MIDI messages are multiplexed into one packet
      streaming.
      
      ALSA oxfw driver allows applications of rawmidi interface to start
      packet streaming for transmission of MIDI messages. However at error
      path, the reference count of stream functionality is not operated
      correctly. This can brings a bug that packet streaming is not stopped
      when all referrers release the count.
      
      This commit fixes the bug.
      
      Fixes: 4f380d00 ("ALSA: oxfw: configure packet format in pcm.hw_params callback")
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      03a954ae
    • Takashi Sakamoto's avatar
      ALSA: fireworks: fix wrong reference count for stream functionality at error... · 2e9f17e3
      Takashi Sakamoto authored
      ALSA: fireworks: fix wrong reference count for stream functionality at error path of rawmidi interface
      
      In IEC 61883-6, several types of sampling data can be multiplexed into
      payload of common isochronous packet (CIP). For typical audio and music
      units, PCM samples and MIDI messages are multiplexed into one packet
      streaming.
      
      ALSA fireworks driver allows applications of rawmidi interface to start
      packet streaming for transmission of MIDI messages. However at error
      path, the reference count of stream functionality is not operated
      correctly. This can brings a bug that packet streaming is not stopped
      when all referrers release the count.
      
      This commit fixes the bug.
      
      Fixes: 3d725066 ("ALSA: fireworks: configure sampling transfer frequency in pcm.hw_params callback")
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      2e9f17e3
    • Takashi Sakamoto's avatar
      ALSA: bebob: fix wrong reference count for stream functionality at error path of rawmidi interface · 097f8ba3
      Takashi Sakamoto authored
      In IEC 61883-6, several types of sampling data can be multiplexed into
      payload of common isochronous packet (CIP). For typical audio and music
      units, PCM samples and MIDI messages are multiplexed into one packet
      streaming.
      
      ALSA bebob driver allows applications of rawmidi interface to start
      packet streaming for transmission of MIDI messages. However at error
      path, the reference count of stream functionality is not operated
      correctly. This can brings a bug that packet streaming is not stopped
      when all referrers release the count.
      
      This commit fixes the bug.
      
      Fixes: ac2888b9 ("ALSA: bebob: configure sampling transfer frequency in pcm.hw_params callback")
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      097f8ba3
  2. 05 Jul, 2019 4 commits
    • Colin Ian King's avatar
      ALSA: cs4281: remove redundant assignment to variable val and remove a goto · 388b00f0
      Colin Ian King authored
      The variable val is being assigned with a value that is never
      read and it is being updated later with a new value. The
      assignment is redundant and can be removed.  Also remove a
      goto statement and a label and replace with a break statement.
      
      Addresses-Coverity: ("Unused value")
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      388b00f0
    • Takashi Iwai's avatar
      ALSA: hda: Simplify snd_hdac_refresh_widgets() · 774a075a
      Takashi Iwai authored
      Along with the recent fix for the races of snd_hdac_refresh_widgets()
      it turned out that the instantiation of widgets sysfs at
      snd_hdac_sysfs_reinit() could cause a race.  The race itself was
      already covered later by extending the mutex protection range, the
      commit 98482377 ("ALSA: hda: Fix widget_mutex incomplete
      protection"), but this also indicated that the call of *_reinit() is
      basically superfluous, as the widgets shall be created sooner or later
      from snd_hdac_device_register().
      
      This patch removes the redundant call of snd_hdac_sysfs_reinit() at
      first.  By this removal, the sysfs argument itself in
      snd_hdac_refresh_widgets() becomes superfluous, too, because the only
      case sysfs=false is always with codec->widgets=NULL.  So, we drop this
      redundant argument as well.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      774a075a
    • Hariprasad Kelam's avatar
      ALSA: asihpi: Remove unneeded variable change · bb26e0c6
      Hariprasad Kelam authored
      this patch fixes below issue reported by coccicheck
      sound/pci/asihpi/asihpi.c:1558:5-11: Unneeded variable: "change". Return
      "1" on line 1564
      Signed-off-by: default avatarHariprasad Kelam <hariprasad.kelam@gmail.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      bb26e0c6
    • Takashi Iwai's avatar
      ALSA: usb-audio: Fix parse of UAC2 Extension Units · ca95c7bf
      Takashi Iwai authored
      Extension Unit (XU) is used to have a compatible layout with
      Processing Unit (PU) on UAC1, and the usb-audio driver code assumed it
      for parsing the descriptors.  Meanwhile, on UAC2, XU became slightly
      incompatible with PU; namely, XU has a one-byte bmControls bitmap
      while PU has two bytes bmControls bitmap.  This incompatibility
      results in the read of a wrong address for the last iExtension field,
      which ended up with an incorrect string for the mixer element name, as
      recently reported for Focusrite Scarlett 18i20 device.
      
      This patch corrects this misalignment by introducing a couple of new
      macros and calling them depending on the descriptor type.
      
      Fixes: 23caaf19 ("ALSA: usb-mixer: Add support for Audio Class v2.0")
      Reported-by: default avatarStefan Sauer <ensonic@hora-obscura.de>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      ca95c7bf
  3. 04 Jul, 2019 2 commits
  4. 02 Jul, 2019 1 commit
    • Takashi Iwai's avatar
      ALSA: line6: Fix write on zero-sized buffer · 34501219
      Takashi Iwai authored
      LINE6 drivers allocate the buffers based on the value returned from
      usb_maxpacket() calls.  The manipulated device may return zero for
      this, and this results in the kmalloc() with zero size (and it may
      succeed) while the other part of the driver code writes the packet
      data with the fixed size -- which eventually overwrites.
      
      This patch adds a simple sanity check for the invalid buffer size for
      avoiding that problem.
      
      Reported-by: syzbot+219f00fb49874dcaea17@syzkaller.appspotmail.com
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      34501219
  5. 01 Jul, 2019 4 commits
    • Evan Green's avatar
      ALSA: hda: Fix widget_mutex incomplete protection · 98482377
      Evan Green authored
      The widget_mutex was introduced to serialize callers to
      hda_widget_sysfs_{re}init. However, its protection of the sysfs widget array
      is incomplete. For example, it is acquired around the call to
      hda_widget_sysfs_reinit(), which actually creates the new array, but isn't
      still acquired when codec->num_nodes and codec->start_nid is updated. So
      the lock ensures one thread sets up the new array at a time, but doesn't
      ensure which thread's value will end up in codec->num_nodes. If a larger
      num_nodes wins but a smaller array was set up, the next call to
      refresh_widgets() will touch free memory as it iterates over codec->num_nodes
      that aren't there.
      
      The widget_lock really protects both the tree as well as codec->num_nodes,
      start_nid, and end_nid, so make sure it's held across that update. It should
      also be held during snd_hdac_get_sub_nodes(), so that a very old read from that
      function doesn't end up clobbering a later update.
      
      Fixes: ed180abb ("ALSA: hda: Fix race between creating and refreshing sysfs entries")
      Signed-off-by: default avatarEvan Green <evgreen@chromium.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      98482377
    • Takashi Iwai's avatar
      Merge branch 'for-linus' into for-next · b5c21c84
      Takashi Iwai authored
      This back-merge is necessary for adjusting the latest FireWire fix
      with the recent refactoring in 5.3 development branch.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      b5c21c84
    • Takashi Sakamoto's avatar
      ALSA: firewire-lib/fireworks: fix miss detection of received MIDI messages · 7fbd1753
      Takashi Sakamoto authored
      In IEC 61883-6, 8 MIDI data streams are multiplexed into single
      MIDI conformant data channel. The index of stream is calculated by
      modulo 8 of the value of data block counter.
      
      In fireworks, the value of data block counter in CIP header has a quirk
      with firmware version v5.0.0, v5.7.3 and v5.8.0. This brings ALSA
      IEC 61883-1/6 packet streaming engine to miss detection of MIDI
      messages.
      
      This commit fixes the miss detection to modify the value of data block
      counter for the modulo calculation.
      
      For maintainers, this bug exists since a commit 18f5ed36 ("ALSA:
      fireworks/firewire-lib: add support for recent firmware quirk") in Linux
      kernel v4.2. There're many changes since the commit.  This fix can be
      backported to Linux kernel v4.4 or later. I tagged a base commit to the
      backport for your convenience.
      
      Besides, my work for Linux kernel v5.3 brings heavy code refactoring and
      some structure members are renamed in 'sound/firewire/amdtp-stream.h'.
      The content of this patch brings conflict when merging -rc tree with
      this patch and the latest tree. I request maintainers to solve the
      conflict to replace 'tx_first_dbc' with 'ctx_data.tx.first_dbc'.
      
      Fixes: df075fee ("ALSA: firewire-lib: complete AM824 data block processing layer")
      Cc: <stable@vger.kernel.org> # v4.4+
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      7fbd1753
    • Rander Wang's avatar
      ALSA: hda: Fix a headphone detection issue when using SOF · 7c2b3629
      Rander Wang authored
      To save power, the hda hdmi driver in ASoC invokes snd_hdac_ext_bus_link_put
      to disable CORB/RIRB buffers DMA if there is no user of bus and invokes
      snd_hdac_ext_bus_link_get to set up CORB/RIRB buffers when it is used.
      Unsolicited responses is disabled in snd_hdac_bus_stop_cmd_io called by
      snd_hdac_ext_bus_link_put , but it is not enabled in snd_hdac_bus_init_cmd_io
      called by snd_hdac_ext_bus_link_get. So for put-get sequence, Unsolicited
      responses is disabled and headphone can't be detected by hda codecs.
      
      Now unsolicited responses is only enabled in snd_hdac_bus_reset_link
      which resets controller. The function is only called for setup of
      controller. This patch enables Unsolicited responses after RIRB is
      initialized in snd_hdac_bus_init_cmd_io which works together with
      snd_hdac_bus_reset_link to set up controller.
      
      Tested legacy hda driver and SOF driver on intel whiskeylake.
      Reviewed-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarRander Wang <rander.wang@linux.intel.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      7c2b3629
  6. 28 Jun, 2019 6 commits
  7. 25 Jun, 2019 1 commit
    • Richard Sailer's avatar
      ALSA: hda/realtek: Add quirks for several Clevo notebook barebones · 503d90b3
      Richard Sailer authored
      This adds 4 SND_PCI_QUIRK(...) lines for several barebone models of the ODM
      Clevo. The model names are written in regex syntax to describe/match all clevo
      models that are similar enough and use the same PCI SSID that this fixup works
      for them.
      
      Additionally the lines regarding SSID 0x96e1 and 0x97e1 didn't fix audio for the
      all our Clevo notebooks using these SSIDs (models Clevo P960* and P970*) since
      ALC1220_FIXP_CLEVO_PB51ED_PINS swapped pins that are not necesarry to be
      swapped. This patch initiates ALC1220_FIXUP_CLEVO_P950 instead for these model
      and fixes the audio.
      
      Fixes: 80690a27 ("ALSA: hda/realtek - Add quirk for Tuxedo XC 1509")
      Signed-off-by: default avatarRichard Sailer <rs@tuxedocomputers.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      503d90b3
  8. 24 Jun, 2019 3 commits
  9. 21 Jun, 2019 8 commits
  10. 18 Jun, 2019 3 commits