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

Merge tag 'sound-fix-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
"A collection of small fixes that came up recently for 5.11.

The majority of fixes are usual HD-audio and USB-audio quirks, with a
few PCM core fixes for addressing the information leak and yet more
UBSAN fixes in the core side"

* tag 'sound-fix-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
ALSA/hda: apply jack fixup for the Acer Veriton N4640G/N6640G/N2510G
ALSA: hda/realtek: Apply jack fixup for Quanta NL3
ALSA: usb-audio: Add implicit feeback support for the BOSS GT-1
ALSA: usb-audio: Add alias entry for ASUS PRIME TRX40 PRO-S
ALSA: core: Remove redundant comments
ALSA: hda/realtek: Add quirk for MSI-GP73
ALSA: pcm: oss: Fix a few more UBSAN fixes
ALSA: pcm: Clear the full allocated memory at hw_params
ALSA: memalloc: Align buffer allocations in page size
ALSA: usb-audio: Disable sample read check if firmware doesn't give back
ALSA: pcm: Remove snd_pcm_lib_preallocate_dma_free()
ALSA: usb-audio: Add VID to support native DSD reproduction on FiiO devices
ALSA: core: memalloc: add page alignment for iram
ALSA: hda/realtek - Supported Dell fixed type headset
ALSA: hda/realtek: Remove dummy lineout on Acer TravelMate P648/P658

+70 -22
-2
sound/core/init.c
··· 149 149 * @extra_size: allocate this extra size after the main soundcard structure 150 150 * @card_ret: the pointer to store the created card instance 151 151 * 152 - * Creates and initializes a soundcard structure. 153 - * 154 152 * The function allocates snd_card instance via kzalloc with the given 155 153 * space for the driver to use freely. The allocated struct is stored 156 154 * in the given card_ret pointer.
+3 -1
sound/core/memalloc.c
··· 77 77 /* Assign the pool into private_data field */ 78 78 dmab->private_data = pool; 79 79 80 - dmab->area = gen_pool_dma_alloc(pool, size, &dmab->addr); 80 + dmab->area = gen_pool_dma_alloc_align(pool, size, &dmab->addr, 81 + PAGE_SIZE); 81 82 } 82 83 83 84 /** ··· 133 132 if (WARN_ON(!dmab)) 134 133 return -ENXIO; 135 134 135 + size = PAGE_ALIGN(size); 136 136 dmab->dev.type = type; 137 137 dmab->dev.dev = device; 138 138 dmab->bytes = 0;
+14 -8
sound/core/oss/pcm_oss.c
··· 693 693 694 694 oss_buffer_size = snd_pcm_plug_client_size(substream, 695 695 snd_pcm_hw_param_value_max(slave_params, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, NULL)) * oss_frame_size; 696 + if (!oss_buffer_size) 697 + return -EINVAL; 696 698 oss_buffer_size = rounddown_pow_of_two(oss_buffer_size); 697 699 if (atomic_read(&substream->mmap_count)) { 698 700 if (oss_buffer_size > runtime->oss.mmap_bytes) ··· 730 728 731 729 min_period_size = snd_pcm_plug_client_size(substream, 732 730 snd_pcm_hw_param_value_min(slave_params, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, NULL)); 733 - min_period_size *= oss_frame_size; 734 - min_period_size = roundup_pow_of_two(min_period_size); 735 - if (oss_period_size < min_period_size) 736 - oss_period_size = min_period_size; 731 + if (min_period_size) { 732 + min_period_size *= oss_frame_size; 733 + min_period_size = roundup_pow_of_two(min_period_size); 734 + if (oss_period_size < min_period_size) 735 + oss_period_size = min_period_size; 736 + } 737 737 738 738 max_period_size = snd_pcm_plug_client_size(substream, 739 739 snd_pcm_hw_param_value_max(slave_params, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, NULL)); 740 - max_period_size *= oss_frame_size; 741 - max_period_size = rounddown_pow_of_two(max_period_size); 742 - if (oss_period_size > max_period_size) 743 - oss_period_size = max_period_size; 740 + if (max_period_size) { 741 + max_period_size *= oss_frame_size; 742 + max_period_size = rounddown_pow_of_two(max_period_size); 743 + if (oss_period_size > max_period_size) 744 + oss_period_size = max_period_size; 745 + } 744 746 745 747 oss_periods = oss_buffer_size / oss_period_size; 746 748
+1 -9
sound/core/pcm_memory.c
··· 89 89 return 0; 90 90 } 91 91 92 - /* 93 - * release the preallocated buffer if not yet done. 94 - */ 95 - static void snd_pcm_lib_preallocate_dma_free(struct snd_pcm_substream *substream) 96 - { 97 - do_free_pages(substream->pcm->card, &substream->dma_buffer); 98 - } 99 - 100 92 /** 101 93 * snd_pcm_lib_preallocate_free - release the preallocated buffer of the specified substream. 102 94 * @substream: the pcm substream instance ··· 97 105 */ 98 106 void snd_pcm_lib_preallocate_free(struct snd_pcm_substream *substream) 99 107 { 100 - snd_pcm_lib_preallocate_dma_free(substream); 108 + do_free_pages(substream->pcm->card, &substream->dma_buffer); 101 109 } 102 110 103 111 /**
+7 -2
sound/core/pcm_native.c
··· 755 755 runtime->boundary *= 2; 756 756 757 757 /* clear the buffer for avoiding possible kernel info leaks */ 758 - if (runtime->dma_area && !substream->ops->copy_user) 759 - memset(runtime->dma_area, 0, runtime->dma_bytes); 758 + if (runtime->dma_area && !substream->ops->copy_user) { 759 + size_t size = runtime->dma_bytes; 760 + 761 + if (runtime->info & SNDRV_PCM_INFO_MMAP) 762 + size = PAGE_ALIGN(size); 763 + memset(runtime->dma_area, 0, size); 764 + } 760 765 761 766 snd_pcm_timer_resolution_change(substream); 762 767 snd_pcm_set_state(substream, SNDRV_PCM_STATE_SETUP);
+33
sound/pci/hda/patch_realtek.c
··· 2516 2516 SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_CLEVO_P950), 2517 2517 SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950), 2518 2518 SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950), 2519 + SND_PCI_QUIRK(0x1462, 0x1229, "MSI-GP73", ALC1220_FIXUP_CLEVO_P950), 2519 2520 SND_PCI_QUIRK(0x1462, 0x1275, "MSI-GL63", ALC1220_FIXUP_CLEVO_P950), 2520 2521 SND_PCI_QUIRK(0x1462, 0x1276, "MSI-GL73", ALC1220_FIXUP_CLEVO_P950), 2521 2522 SND_PCI_QUIRK(0x1462, 0x1293, "MSI-GP65", ALC1220_FIXUP_CLEVO_P950), ··· 6369 6368 ALC287_FIXUP_HP_GPIO_LED, 6370 6369 ALC256_FIXUP_HP_HEADSET_MIC, 6371 6370 ALC236_FIXUP_DELL_AIO_HEADSET_MIC, 6371 + ALC282_FIXUP_ACER_DISABLE_LINEOUT, 6372 6372 }; 6373 6373 6374 6374 static const struct hda_fixup alc269_fixups[] = { ··· 7793 7791 .chained = true, 7794 7792 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE 7795 7793 }, 7794 + [ALC282_FIXUP_ACER_DISABLE_LINEOUT] = { 7795 + .type = HDA_FIXUP_PINS, 7796 + .v.pins = (const struct hda_pintbl[]) { 7797 + { 0x1b, 0x411111f0 }, 7798 + { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 7799 + { }, 7800 + }, 7801 + .chained = true, 7802 + .chain_id = ALC269_FIXUP_HEADSET_MODE 7803 + }, 7796 7804 }; 7797 7805 7798 7806 static const struct snd_pci_quirk alc269_fixup_tbl[] = { ··· 7817 7805 SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572), 7818 7806 SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572), 7819 7807 SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS), 7808 + SND_PCI_QUIRK(0x1025, 0x101c, "Acer Veriton N2510G", ALC269_FIXUP_LIFEBOOK), 7820 7809 SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE), 7821 7810 SND_PCI_QUIRK(0x1025, 0x1065, "Acer Aspire C20-820", ALC269VC_FIXUP_ACER_HEADSET_MIC), 7822 7811 SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK), 7823 7812 SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), 7824 7813 SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), 7814 + SND_PCI_QUIRK(0x1025, 0x1166, "Acer Veriton N4640G", ALC269_FIXUP_LIFEBOOK), 7815 + SND_PCI_QUIRK(0x1025, 0x1167, "Acer Veriton N6640G", ALC269_FIXUP_LIFEBOOK), 7825 7816 SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK), 7826 7817 SND_PCI_QUIRK(0x1025, 0x1247, "Acer vCopperbox", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS), 7827 7818 SND_PCI_QUIRK(0x1025, 0x1248, "Acer Veriton N4660G", ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE), ··· 7885 7870 SND_PCI_QUIRK(0x1028, 0x09bf, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE), 7886 7871 SND_PCI_QUIRK(0x1028, 0x0a2e, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC), 7887 7872 SND_PCI_QUIRK(0x1028, 0x0a30, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC), 7873 + SND_PCI_QUIRK(0x1028, 0x0a58, "Dell Precision 3650 Tower", ALC255_FIXUP_DELL_HEADSET_MIC), 7888 7874 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), 7889 7875 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), 7890 7876 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2), ··· 8033 8017 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC), 8034 8018 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC), 8035 8019 SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC), 8020 + SND_PCI_QUIRK(0x152d, 0x1082, "Quanta NL3", ALC269_FIXUP_LIFEBOOK), 8036 8021 SND_PCI_QUIRK(0x1558, 0x1323, "Clevo N130ZU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 8037 8022 SND_PCI_QUIRK(0x1558, 0x1325, "System76 Darter Pro (darp5)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 8038 8023 SND_PCI_QUIRK(0x1558, 0x1401, "Clevo L140[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), ··· 8581 8564 {0x12, 0x90a60140}, 8582 8565 {0x19, 0x04a11030}, 8583 8566 {0x21, 0x04211020}), 8567 + SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT, 8568 + ALC282_STANDARD_PINS, 8569 + {0x12, 0x90a609c0}, 8570 + {0x18, 0x03a11830}, 8571 + {0x19, 0x04a19831}, 8572 + {0x1a, 0x0481303f}, 8573 + {0x1b, 0x04211020}, 8574 + {0x21, 0x0321101f}), 8575 + SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT, 8576 + ALC282_STANDARD_PINS, 8577 + {0x12, 0x90a60940}, 8578 + {0x18, 0x03a11830}, 8579 + {0x19, 0x04a19831}, 8580 + {0x1a, 0x0481303f}, 8581 + {0x1b, 0x04211020}, 8582 + {0x21, 0x0321101f}), 8584 8583 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, 8585 8584 ALC282_STANDARD_PINS, 8586 8585 {0x12, 0x90a60130},
+3
sound/usb/card.c
··· 383 383 /* ASUS ROG Strix */ 384 384 PROFILE_NAME(0x0b05, 0x1917, 385 385 "Realtek", "ALC1220-VB-DT", "Realtek-ALC1220-VB-Desktop"), 386 + /* ASUS PRIME TRX40 PRO-S */ 387 + PROFILE_NAME(0x0b05, 0x1918, 388 + "Realtek", "ALC1220-VB-DT", "Realtek-ALC1220-VB-Desktop"), 386 389 387 390 /* Dell WD15 Dock */ 388 391 PROFILE_NAME(0x0bda, 0x4014, "Dell", "WD15 Dock", "Dell-WD15-Dock"),
+6
sound/usb/clock.c
··· 534 534 } 535 535 536 536 crate = data[0] | (data[1] << 8) | (data[2] << 16); 537 + if (!crate) { 538 + dev_info(&dev->dev, "failed to read current rate; disabling the check\n"); 539 + chip->sample_rate_read_error = 3; /* three strikes, see above */ 540 + return 0; 541 + } 542 + 537 543 if (crate != rate) { 538 544 dev_warn(&dev->dev, "current rate %d is different from the runtime rate %d\n", crate, rate); 539 545 // runtime->rate = crate;
+2
sound/usb/implicit.c
··· 75 75 /* No quirk for playback but with capture quirk (see below) */ 76 76 IMPLICIT_FB_SKIP_DEV(0x0582, 0x0130), /* BOSS BR-80 */ 77 77 IMPLICIT_FB_SKIP_DEV(0x0582, 0x0189), /* BOSS GT-100v2 */ 78 + IMPLICIT_FB_SKIP_DEV(0x0582, 0x01d6), /* BOSS GT-1 */ 78 79 IMPLICIT_FB_SKIP_DEV(0x0582, 0x01d8), /* BOSS Katana */ 79 80 IMPLICIT_FB_SKIP_DEV(0x0582, 0x01e5), /* BOSS GT-001 */ 80 81 ··· 86 85 static const struct snd_usb_implicit_fb_match capture_implicit_fb_quirks[] = { 87 86 IMPLICIT_FB_FIXED_DEV(0x0582, 0x0130, 0x0d, 0x01), /* BOSS BR-80 */ 88 87 IMPLICIT_FB_FIXED_DEV(0x0582, 0x0189, 0x0d, 0x01), /* BOSS GT-100v2 */ 88 + IMPLICIT_FB_FIXED_DEV(0x0582, 0x01d6, 0x0d, 0x01), /* BOSS GT-1 */ 89 89 IMPLICIT_FB_FIXED_DEV(0x0582, 0x01d8, 0x0d, 0x01), /* BOSS Katana */ 90 90 IMPLICIT_FB_FIXED_DEV(0x0582, 0x01e5, 0x0d, 0x01), /* BOSS GT-001 */ 91 91
+1
sound/usb/quirks.c
··· 1771 1771 case 0x25ce: /* Mytek devices */ 1772 1772 case 0x278b: /* Rotel? */ 1773 1773 case 0x292b: /* Gustard/Ess based devices */ 1774 + case 0x2972: /* FiiO devices */ 1774 1775 case 0x2ab6: /* T+A devices */ 1775 1776 case 0x3353: /* Khadas devices */ 1776 1777 case 0x3842: /* EVGA */