sound fixes for 5.6-rc6
Linus,
please pull sound fixes for v5.7-rc6 from:
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git tags/sound-5.7-rc6
The topmost commit is b590b38ca305d6d7902ec7c4f7e273e0069f3bcc
----------------------------------------------------------------
sound fixes for 5.7-rc6
The things look good and calming down; the only change to ALSA core is the fix for racy rawmidi buffer accesses spotted by syzkaller, and the rest are all small device-specific quirks for HD-audio and USB-audio devices.
----------------------------------------------------------------
Andrew Oakley (1):
ALSA: usb-audio: add mapping for ASRock TRX40 Creator
Chris Chiu (1):
ALSA: hda/realtek - Enable headset mic of ASUS GL503VM with ALC295
Jesus Ramos (1):
ALSA: usb-audio: Add control message quirk delay for Kingston HyperX headset
Jian-Hong Pan (2):
ALSA: hda/realtek - Enable headset mic of ASUS UX550GE with ALC295
ALSA: hda/realtek: Enable headset mic of ASUS UX581LV with ALC295
Kai-Heng Feng (2):
Revert "ALSA: hda/realtek: Fix pop noise on ALC225"
ALSA: hda/realtek - Fix S3 pop noise on Dell Wyse
Mike Pozulp (1):
ALSA: hda/realtek: Add quirk for Samsung Notebook
Takashi Iwai (3):
ALSA: rawmidi: Fix racy buffer resize under concurrent accesses
ALSA: hda/realtek - Add COEF workaround for ASUS ZenBook UX431DA
ALSA: hda/realtek - Limit int mic boost for Thinkpad T530
Takashi Sakamoto (1):
ALSA: firewire-lib: fix 'function sizeof not defined' error of tracepoints format
--- include/sound/rawmidi.h | 1 + sound/core/rawmidi.c | 31 ++++++++++++++-- sound/firewire/amdtp-stream-trace.h | 3 +- sound/pci/hda/patch_realtek.c | 74 +++++++++++++++++++++++++++++++++++-- sound/usb/mixer_maps.c | 5 +++ sound/usb/quirks-table.h | 1 + sound/usb/quirks.c | 9 +++-- 7 files changed, 111 insertions(+), 13 deletions(-)
include/sound/rawmidi.h +1 -0
@@ -61,6 +61,7 @@ struct snd_rawmidi_runtime {size_t avail_min;/* min avail for wakeup */ size_t avail;/* max used buffer for wakeup */ size_t xruns;/* over/underruns counter */ +int buffer_ref;/* buffer reference count */ /* misc */ spinlock_t lock;wait_queue_head_t sleep;
sound/core/rawmidi.c +27 -4
@@ -120,6 +120,17 @@ static void snd_rawmidi_input_event_work(struct work_struct *work) runtime->event (runtime->substream); } +/* buffer refcount management: call with runtime->lock held */ +static inline void snd_rawmidi_buffer_ref (struct snd_rawmidi_runtime *runtime) +{ + runtime->buffer_ref++; +} + +static inline void snd_rawmidi_buffer_unref (struct snd_rawmidi_runtime *runtime) +{ + runtime->buffer_ref--; +} +static int snd_rawmidi_runtime_create (struct snd_rawmidi_substream *substream) {struct snd_rawmidi_runtime *runtime;
@@ -669,6 +680,11 @@ static int resize_runtime_buffer(struct snd_rawmidi_runtime *runtime,if (!newbuf)return -ENOMEM ;spin_lock_irq (&runtime->lock); +if (runtime->buffer_ref) { +spin_unlock_irq (&runtime->lock); +kvfree (newbuf); +return -EBUSY ; + } oldbuf = runtime->buffer; runtime->buffer = newbuf; runtime->buffer_size = params->buffer_size;
@@ -1019,8 +1035,10 @@ static long snd_rawmidi_kernel_read1(struct snd_rawmidi_substream *substream,long result =0 , count1;struct snd_rawmidi_runtime *runtime = substream->runtime;unsigned long appl_ptr; +int err =0 ;spin_lock_irqsave (&runtime->lock, flags); +snd_rawmidi_buffer_ref (runtime);while (count >0 && runtime->avail) { count1 = runtime->buffer_size - runtime->appl_ptr;if (count1 > count)
@@ -1039,16 +1057,19 @@ static long snd_rawmidi_kernel_read1(struct snd_rawmidi_substream *substream,if (userbuf) {spin_unlock_irqrestore (&runtime->lock, flags);if (copy_to_user (userbuf + result, - runtime->buffer + appl_ptr, count1)) { -return result >0 ? result : -EFAULT ; - } + runtime->buffer + appl_ptr, count1)) + err = -EFAULT ;spin_lock_irqsave (&runtime->lock, flags); +if (err) + goto out; } result += count1; count -= count1; } + out: +snd_rawmidi_buffer_unref (runtime);spin_unlock_irqrestore (&runtime->lock, flags); -return result; +return result >0 ? result : err; } long snd_rawmidi_kernel_read(struct snd_rawmidi_substream *substream,
@@ -1342,6 +1363,7 @@ static long snd_rawmidi_kernel_write1(struct snd_rawmidi_substream *substream,return -EAGAIN ; } } +snd_rawmidi_buffer_ref (runtime);while (count >0 && runtime->avail >0 ) { count1 = runtime->buffer_size - runtime->appl_ptr;if (count1 > count)
@@ -1373,6 +1395,7 @@ static long snd_rawmidi_kernel_write1(struct snd_rawmidi_substream *substream, } __end: count1 = runtime->avail < runtime->buffer_size; +snd_rawmidi_buffer_unref (runtime);spin_unlock_irqrestore (&runtime->lock, flags);if (count1)snd_rawmidi_output_trigger (substream,1 );
sound/firewire/amdtp-stream-trace.h +1 -2
@@ -66,8 +66,7 @@ TRACE_EVENT(amdtp_packet, __entry->irq, __entry->index,__print_array (__get_dynamic_array (cip_header), -__get_dynamic_array_len (cip_header), - sizeof(u8))) + __get_dynamic_array_len(cip_header), 1)) );#endif
sound/pci/hda/patch_realtek.c +71 -3
163 lines not on this page · raw message
sound/usb/mixer_maps.c +5 -0
@@ -549,6 +549,11 @@ static const struct usbmix_ctl_map usbmix_ctl_maps[] = { .map = trx40_mobo_map, .connector_map = trx40_mobo_connector_map, }, + {/* Asrock TRX40 Creator */ + .id = USB_ID(0x26ce, 0x0a01), + .map = trx40_mobo_map, + .connector_map = trx40_mobo_connector_map, + }, { 0 } /* terminator */ };
sound/usb/quirks-table.h +1 -0
@@ -3563,6 +3563,7 @@ AU0828_DEVICE(0x2040, 0x7270, "Hauppauge", "HVR-950Q"),ALC1220_VB_DESKTOP (0x0414 ,0xa002 ),/* Gigabyte TRX40 Aorus Pro WiFi */ ALC1220_VB_DESKTOP (0x0db0 ,0x0d64 ),/* MSI TRX40 Creator */ ALC1220_VB_DESKTOP (0x0db0 ,0x543d ),/* MSI TRX40 */ +ALC1220_VB_DESKTOP (0x26ce ,0x0a01 ),/* Asrock TRX40 Creator */ #undef ALC1220_VB_DESKTOP #undef USB_DEVICE_VENDOR_SPEC
sound/usb/quirks.c +5 -4
@@ -1636,13 +1636,14 @@ void snd_usb_ctl_msg_quirk(struct usb_device *dev, unsigned int pipe, && (requesttype & USB_TYPE_MASK) == USB_TYPE_CLASS)msleep (20 ); -/* Zoom R16/24, Logitech H650e, Jabra 550a needs a tiny delay here, -* otherwise requests like get/set frequency return as failed despite -* actually succeeding. +/* Zoom R16/24, Logitech H650e, Jabra 550a, Kingston HyperX needs a tiny +* delay here, otherwise requests like get/set frequency return as +* failed despite actually succeeding. */ if ((chip->usb_id ==USB_ID (0x1686 ,0x00dd ) || chip->usb_id ==USB_ID (0x046d ,0x0a46 ) || - chip->usb_id ==USB_ID (0x0b0e ,0x0349 )) && + chip->usb_id ==USB_ID (0x0b0e ,0x0349 ) || + chip->usb_id ==USB_ID (0x0951 ,0x16ad )) && (requesttype &USB_TYPE_MASK ) ==USB_TYPE_CLASS )usleep_range (1000 ,2000 ); }
The pull request you sent on Fri, 15 May 2020 13:20:38 +0200:
The pull request you sent on Fri, 15 May 2020 13:20:38 +0200:
Quoted 1 line
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.gittags/sound-5.7-rc6
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/1742bcd0cb3047d86e9d17d07fd46710c7ffad1e
Thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.wiki.kernel.org/userdoc/prtracker