Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'sound-5.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
"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"

* tag 'sound-5.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
ALSA: hda/realtek - Limit int mic boost for Thinkpad T530
ALSA: hda/realtek - Add COEF workaround for ASUS ZenBook UX431DA
ALSA: hda/realtek: Enable headset mic of ASUS UX581LV with ALC295
ALSA: hda/realtek - Enable headset mic of ASUS UX550GE with ALC295
ALSA: hda/realtek - Enable headset mic of ASUS GL503VM with ALC295
ALSA: hda/realtek: Add quirk for Samsung Notebook
ALSA: rawmidi: Fix racy buffer resize under concurrent accesses
ALSA: usb-audio: add mapping for ASRock TRX40 Creator
ALSA: hda/realtek - Fix S3 pop noise on Dell Wyse
Revert "ALSA: hda/realtek: Fix pop noise on ALC225"
ALSA: firewire-lib: fix 'function sizeof not defined' error of tracepoints format
ALSA: usb-audio: Add control message quirk delay for Kingston HyperX headset

+111 -13
+1
include/sound/rawmidi.h
··· 61 61 size_t avail_min; /* min avail for wakeup */ 62 62 size_t avail; /* max used buffer for wakeup */ 63 63 size_t xruns; /* over/underruns counter */ 64 + int buffer_ref; /* buffer reference count */ 64 65 /* misc */ 65 66 spinlock_t lock; 66 67 wait_queue_head_t sleep;
+27 -4
sound/core/rawmidi.c
··· 120 120 runtime->event(runtime->substream); 121 121 } 122 122 123 + /* buffer refcount management: call with runtime->lock held */ 124 + static inline void snd_rawmidi_buffer_ref(struct snd_rawmidi_runtime *runtime) 125 + { 126 + runtime->buffer_ref++; 127 + } 128 + 129 + static inline void snd_rawmidi_buffer_unref(struct snd_rawmidi_runtime *runtime) 130 + { 131 + runtime->buffer_ref--; 132 + } 133 + 123 134 static int snd_rawmidi_runtime_create(struct snd_rawmidi_substream *substream) 124 135 { 125 136 struct snd_rawmidi_runtime *runtime; ··· 680 669 if (!newbuf) 681 670 return -ENOMEM; 682 671 spin_lock_irq(&runtime->lock); 672 + if (runtime->buffer_ref) { 673 + spin_unlock_irq(&runtime->lock); 674 + kvfree(newbuf); 675 + return -EBUSY; 676 + } 683 677 oldbuf = runtime->buffer; 684 678 runtime->buffer = newbuf; 685 679 runtime->buffer_size = params->buffer_size; ··· 1035 1019 long result = 0, count1; 1036 1020 struct snd_rawmidi_runtime *runtime = substream->runtime; 1037 1021 unsigned long appl_ptr; 1022 + int err = 0; 1038 1023 1039 1024 spin_lock_irqsave(&runtime->lock, flags); 1025 + snd_rawmidi_buffer_ref(runtime); 1040 1026 while (count > 0 && runtime->avail) { 1041 1027 count1 = runtime->buffer_size - runtime->appl_ptr; 1042 1028 if (count1 > count) ··· 1057 1039 if (userbuf) { 1058 1040 spin_unlock_irqrestore(&runtime->lock, flags); 1059 1041 if (copy_to_user(userbuf + result, 1060 - runtime->buffer + appl_ptr, count1)) { 1061 - return result > 0 ? result : -EFAULT; 1062 - } 1042 + runtime->buffer + appl_ptr, count1)) 1043 + err = -EFAULT; 1063 1044 spin_lock_irqsave(&runtime->lock, flags); 1045 + if (err) 1046 + goto out; 1064 1047 } 1065 1048 result += count1; 1066 1049 count -= count1; 1067 1050 } 1051 + out: 1052 + snd_rawmidi_buffer_unref(runtime); 1068 1053 spin_unlock_irqrestore(&runtime->lock, flags); 1069 - return result; 1054 + return result > 0 ? result : err; 1070 1055 } 1071 1056 1072 1057 long snd_rawmidi_kernel_read(struct snd_rawmidi_substream *substream, ··· 1363 1342 return -EAGAIN; 1364 1343 } 1365 1344 } 1345 + snd_rawmidi_buffer_ref(runtime); 1366 1346 while (count > 0 && runtime->avail > 0) { 1367 1347 count1 = runtime->buffer_size - runtime->appl_ptr; 1368 1348 if (count1 > count) ··· 1395 1373 } 1396 1374 __end: 1397 1375 count1 = runtime->avail < runtime->buffer_size; 1376 + snd_rawmidi_buffer_unref(runtime); 1398 1377 spin_unlock_irqrestore(&runtime->lock, flags); 1399 1378 if (count1) 1400 1379 snd_rawmidi_output_trigger(substream, 1);
+1 -2
sound/firewire/amdtp-stream-trace.h
··· 66 66 __entry->irq, 67 67 __entry->index, 68 68 __print_array(__get_dynamic_array(cip_header), 69 - __get_dynamic_array_len(cip_header), 70 - sizeof(u8))) 69 + __get_dynamic_array_len(cip_header), 1)) 71 70 ); 72 71 73 72 #endif
+71 -3
sound/pci/hda/patch_realtek.c
··· 5856 5856 } 5857 5857 } 5858 5858 5859 + static void alc225_fixup_s3_pop_noise(struct hda_codec *codec, 5860 + const struct hda_fixup *fix, int action) 5861 + { 5862 + if (action != HDA_FIXUP_ACT_PRE_PROBE) 5863 + return; 5864 + 5865 + codec->power_save_node = 1; 5866 + } 5867 + 5859 5868 /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */ 5860 5869 static void alc274_fixup_bind_dacs(struct hda_codec *codec, 5861 5870 const struct hda_fixup *fix, int action) ··· 5969 5960 ALC269_FIXUP_HP_LINE1_MIC1_LED, 5970 5961 ALC269_FIXUP_INV_DMIC, 5971 5962 ALC269_FIXUP_LENOVO_DOCK, 5963 + ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, 5972 5964 ALC269_FIXUP_NO_SHUTUP, 5973 5965 ALC286_FIXUP_SONY_MIC_NO_PRESENCE, 5974 5966 ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT, ··· 6055 6045 ALC233_FIXUP_ACER_HEADSET_MIC, 6056 6046 ALC294_FIXUP_LENOVO_MIC_LOCATION, 6057 6047 ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, 6048 + ALC225_FIXUP_S3_POP_NOISE, 6058 6049 ALC700_FIXUP_INTEL_REFERENCE, 6059 6050 ALC274_FIXUP_DELL_BIND_DACS, 6060 6051 ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, ··· 6091 6080 ALC294_FIXUP_ASUS_DUAL_SPK, 6092 6081 ALC285_FIXUP_THINKPAD_HEADSET_JACK, 6093 6082 ALC294_FIXUP_ASUS_HPE, 6083 + ALC294_FIXUP_ASUS_COEF_1B, 6094 6084 ALC285_FIXUP_HP_GPIO_LED, 6095 6085 ALC285_FIXUP_HP_MUTE_LED, 6096 6086 ALC236_FIXUP_HP_MUTE_LED, 6087 + ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, 6088 + ALC295_FIXUP_ASUS_MIC_NO_PRESENCE, 6097 6089 }; 6098 6090 6099 6091 static const struct hda_fixup alc269_fixups[] = { ··· 6293 6279 }, 6294 6280 .chained = true, 6295 6281 .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT 6282 + }, 6283 + [ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST] = { 6284 + .type = HDA_FIXUP_FUNC, 6285 + .v.func = alc269_fixup_limit_int_mic_boost, 6286 + .chained = true, 6287 + .chain_id = ALC269_FIXUP_LENOVO_DOCK, 6296 6288 }, 6297 6289 [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = { 6298 6290 .type = HDA_FIXUP_FUNC, ··· 6952 6932 { } 6953 6933 }, 6954 6934 .chained = true, 6935 + .chain_id = ALC225_FIXUP_S3_POP_NOISE 6936 + }, 6937 + [ALC225_FIXUP_S3_POP_NOISE] = { 6938 + .type = HDA_FIXUP_FUNC, 6939 + .v.func = alc225_fixup_s3_pop_noise, 6940 + .chained = true, 6955 6941 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC 6956 6942 }, 6957 6943 [ALC700_FIXUP_INTEL_REFERENCE] = { ··· 7230 7204 .chained = true, 7231 7205 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC 7232 7206 }, 7207 + [ALC294_FIXUP_ASUS_COEF_1B] = { 7208 + .type = HDA_FIXUP_VERBS, 7209 + .v.verbs = (const struct hda_verb[]) { 7210 + /* Set bit 10 to correct noisy output after reboot from 7211 + * Windows 10 (due to pop noise reduction?) 7212 + */ 7213 + { 0x20, AC_VERB_SET_COEF_INDEX, 0x1b }, 7214 + { 0x20, AC_VERB_SET_PROC_COEF, 0x4e4b }, 7215 + { } 7216 + }, 7217 + }, 7233 7218 [ALC285_FIXUP_HP_GPIO_LED] = { 7234 7219 .type = HDA_FIXUP_FUNC, 7235 7220 .v.func = alc285_fixup_hp_gpio_led, ··· 7252 7215 [ALC236_FIXUP_HP_MUTE_LED] = { 7253 7216 .type = HDA_FIXUP_FUNC, 7254 7217 .v.func = alc236_fixup_hp_mute_led, 7218 + }, 7219 + [ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = { 7220 + .type = HDA_FIXUP_VERBS, 7221 + .v.verbs = (const struct hda_verb[]) { 7222 + { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc5 }, 7223 + { } 7224 + }, 7225 + }, 7226 + [ALC295_FIXUP_ASUS_MIC_NO_PRESENCE] = { 7227 + .type = HDA_FIXUP_PINS, 7228 + .v.pins = (const struct hda_pintbl[]) { 7229 + { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 7230 + { } 7231 + }, 7232 + .chained = true, 7233 + .chain_id = ALC269_FIXUP_HEADSET_MODE 7255 7234 }, 7256 7235 }; 7257 7236 ··· 7436 7383 SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC), 7437 7384 SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC), 7438 7385 SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE), 7386 + SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE), 7439 7387 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), 7440 7388 SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC), 7389 + SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B), 7441 7390 SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC), 7442 7391 SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), 7443 7392 SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), ··· 7465 7410 SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE), 7466 7411 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE), 7467 7412 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC), 7413 + SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), 7414 + SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), 7468 7415 SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8), 7469 7416 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC), 7470 7417 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC), ··· 7483 7426 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE), 7484 7427 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE), 7485 7428 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE), 7486 - SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK), 7429 + SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST), 7487 7430 SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK), 7488 7431 SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK), 7489 7432 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK), ··· 7622 7565 {.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"}, 7623 7566 {.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"}, 7624 7567 {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"}, 7568 + {.id = ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, .name = "lenovo-dock-limit-boost"}, 7625 7569 {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, 7626 7570 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"}, 7627 7571 {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, ··· 8051 7993 {0x12, 0x90a60130}, 8052 7994 {0x17, 0x90170110}, 8053 7995 {0x21, 0x03211020}), 7996 + SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE, 7997 + {0x12, 0x90a60120}, 7998 + {0x17, 0x90170110}, 7999 + {0x21, 0x04211030}), 8000 + SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE, 8001 + {0x12, 0x90a60130}, 8002 + {0x17, 0x90170110}, 8003 + {0x21, 0x03211020}), 8004 + SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE, 8005 + {0x12, 0x90a60130}, 8006 + {0x17, 0x90170110}, 8007 + {0x21, 0x03211020}), 8054 8008 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, 8055 8009 {0x14, 0x90170110}, 8056 8010 {0x21, 0x04211020}), ··· 8279 8209 spec->gen.mixer_nid = 0; 8280 8210 break; 8281 8211 case 0x10ec0225: 8282 - codec->power_save_node = 1; 8283 - /* fall through */ 8284 8212 case 0x10ec0295: 8285 8213 case 0x10ec0299: 8286 8214 spec->codec_variant = ALC269_TYPE_ALC225;
+5
sound/usb/mixer_maps.c
··· 549 549 .map = trx40_mobo_map, 550 550 .connector_map = trx40_mobo_connector_map, 551 551 }, 552 + { /* Asrock TRX40 Creator */ 553 + .id = USB_ID(0x26ce, 0x0a01), 554 + .map = trx40_mobo_map, 555 + .connector_map = trx40_mobo_connector_map, 556 + }, 552 557 { 0 } /* terminator */ 553 558 }; 554 559
+1
sound/usb/quirks-table.h
··· 3563 3563 ALC1220_VB_DESKTOP(0x0414, 0xa002), /* Gigabyte TRX40 Aorus Pro WiFi */ 3564 3564 ALC1220_VB_DESKTOP(0x0db0, 0x0d64), /* MSI TRX40 Creator */ 3565 3565 ALC1220_VB_DESKTOP(0x0db0, 0x543d), /* MSI TRX40 */ 3566 + ALC1220_VB_DESKTOP(0x26ce, 0x0a01), /* Asrock TRX40 Creator */ 3566 3567 #undef ALC1220_VB_DESKTOP 3567 3568 3568 3569 #undef USB_DEVICE_VENDOR_SPEC
+5 -4
sound/usb/quirks.c
··· 1636 1636 && (requesttype & USB_TYPE_MASK) == USB_TYPE_CLASS) 1637 1637 msleep(20); 1638 1638 1639 - /* Zoom R16/24, Logitech H650e, Jabra 550a needs a tiny delay here, 1640 - * otherwise requests like get/set frequency return as failed despite 1641 - * actually succeeding. 1639 + /* Zoom R16/24, Logitech H650e, Jabra 550a, Kingston HyperX needs a tiny 1640 + * delay here, otherwise requests like get/set frequency return as 1641 + * failed despite actually succeeding. 1642 1642 */ 1643 1643 if ((chip->usb_id == USB_ID(0x1686, 0x00dd) || 1644 1644 chip->usb_id == USB_ID(0x046d, 0x0a46) || 1645 - chip->usb_id == USB_ID(0x0b0e, 0x0349)) && 1645 + chip->usb_id == USB_ID(0x0b0e, 0x0349) || 1646 + chip->usb_id == USB_ID(0x0951, 0x16ad)) && 1646 1647 (requesttype & USB_TYPE_MASK) == USB_TYPE_CLASS) 1647 1648 usleep_range(1000, 2000); 1648 1649 }