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-7.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
"There have been continuous flux but most of them are device-specific
small fixes, while we see a few core fixes at this time (minor PCM fix
for linked streams and a few ASoC core fixes for delayed work, etc)

Core:
- PCM: Fix use-after-free in linked stream drain

ASoC:
- core: Fixes for delayed works, empty DMI string handling and DT overlay
- qcom: qdsp6: Fix ADSP stop/start crash via component removal ordering
- tegra: Add support for Tegra238 audio graph card
- amd: Fix missing error checks for clock acquisition
- rt1011: Fix incorrect DAPM context retrieval helper

HD-audio:
- Add quirk for Gigabyte H610M, ASUS UM6702RC, HP 14s-dr5xxx, and
ThinkPad X390

USB-audio:
- Scarlett2: Fix NULL dereference for malformed endpoint descriptors
- Add quirk for SPACETOUCH"

* tag 'sound-7.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
ASoC: amd: acp-mach-common: Add missing error check for clock acquisition
ASoC: detect empty DMI strings
ASoC: amd: acp3x-rt5682-max9836: Add missing error check for clock acquisition
ALSA: usb-audio: Add iface reset and delay quirk for SPACETOUCH USB Audio
ASoC: codecs: rt1011: Use component to get the dapm context in spk_mode_put
ALSA: usb-audio: Check endpoint numbers at parsing Scarlett2 mixer interfaces
ASoC: simple-card-utils: fix graph_util_is_ports0() for DT overlays
ASoC: soc-core: flush delayed work before removing DAIs and widgets
ASoC: soc-core: drop delayed_work_pending() check before flush
ASoC: tegra: Add support for Tegra238 soundcard
ALSA: hda/realtek: Add headset jack quirk for Thinkpad X390
ALSA: hda/realtek: add HP Laptop 14s-dr5xxx mute LED quirk
ALSA: hda/realtek: add quirk for ASUS UM6702RC
ALSA: pcm: fix use-after-free on linked stream runtime in snd_pcm_drain()
ALSA: hda/realtek: Add quirk for Gigabyte Technology to fix headphone
firmware: cs_dsp: Fix fragmentation regression in firmware download
ASoC: qcom: qdsp6: Fix q6apm remove ordering during ADSP stop and start

+102 -23
+18 -6
drivers/firmware/cirrus/cs_dsp.c
··· 1610 1610 region_name); 1611 1611 1612 1612 if (reg) { 1613 + /* 1614 + * Although we expect the underlying bus does not require 1615 + * physically-contiguous buffers, we pessimistically use 1616 + * a temporary buffer instead of trusting that the 1617 + * alignment of region->data is ok. 1618 + */ 1613 1619 region_len = le32_to_cpu(region->len); 1614 1620 if (region_len > buf_len) { 1615 1621 buf_len = round_up(region_len, PAGE_SIZE); 1616 - kfree(buf); 1617 - buf = kmalloc(buf_len, GFP_KERNEL | GFP_DMA); 1622 + vfree(buf); 1623 + buf = vmalloc(buf_len); 1618 1624 if (!buf) { 1619 1625 ret = -ENOMEM; 1620 1626 goto out_fw; ··· 1649 1643 1650 1644 ret = 0; 1651 1645 out_fw: 1652 - kfree(buf); 1646 + vfree(buf); 1653 1647 1654 1648 if (ret == -EOVERFLOW) 1655 1649 cs_dsp_err(dsp, "%s: file content overflows file data\n", file); ··· 2337 2331 } 2338 2332 2339 2333 if (reg) { 2334 + /* 2335 + * Although we expect the underlying bus does not require 2336 + * physically-contiguous buffers, we pessimistically use 2337 + * a temporary buffer instead of trusting that the 2338 + * alignment of blk->data is ok. 2339 + */ 2340 2340 region_len = le32_to_cpu(blk->len); 2341 2341 if (region_len > buf_len) { 2342 2342 buf_len = round_up(region_len, PAGE_SIZE); 2343 - kfree(buf); 2344 - buf = kmalloc(buf_len, GFP_KERNEL | GFP_DMA); 2343 + vfree(buf); 2344 + buf = vmalloc(buf_len); 2345 2345 if (!buf) { 2346 2346 ret = -ENOMEM; 2347 2347 goto out_fw; ··· 2378 2366 2379 2367 ret = 0; 2380 2368 out_fw: 2381 - kfree(buf); 2369 + vfree(buf); 2382 2370 2383 2371 if (ret == -EOVERFLOW) 2384 2372 cs_dsp_err(dsp, "%s: file content overflows file data\n", file);
+16 -3
sound/core/pcm_native.c
··· 2144 2144 for (;;) { 2145 2145 long tout; 2146 2146 struct snd_pcm_runtime *to_check; 2147 + unsigned int drain_rate; 2148 + snd_pcm_uframes_t drain_bufsz; 2149 + bool drain_no_period_wakeup; 2150 + 2147 2151 if (signal_pending(current)) { 2148 2152 result = -ERESTARTSYS; 2149 2153 break; ··· 2167 2163 snd_pcm_group_unref(group, substream); 2168 2164 if (!to_check) 2169 2165 break; /* all drained */ 2166 + /* 2167 + * Cache the runtime fields needed after unlock. 2168 + * A concurrent close() on the linked stream may free 2169 + * its runtime via snd_pcm_detach_substream() once we 2170 + * release the stream lock below. 2171 + */ 2172 + drain_no_period_wakeup = to_check->no_period_wakeup; 2173 + drain_rate = to_check->rate; 2174 + drain_bufsz = to_check->buffer_size; 2170 2175 init_waitqueue_entry(&wait, current); 2171 2176 set_current_state(TASK_INTERRUPTIBLE); 2172 2177 add_wait_queue(&to_check->sleep, &wait); 2173 2178 snd_pcm_stream_unlock_irq(substream); 2174 - if (runtime->no_period_wakeup) 2179 + if (drain_no_period_wakeup) 2175 2180 tout = MAX_SCHEDULE_TIMEOUT; 2176 2181 else { 2177 2182 tout = 100; 2178 - if (runtime->rate) { 2179 - long t = runtime->buffer_size * 1100 / runtime->rate; 2183 + if (drain_rate) { 2184 + long t = drain_bufsz * 1100 / drain_rate; 2180 2185 tout = max(t, tout); 2181 2186 } 2182 2187 tout = msecs_to_jiffies(tout);
+3
sound/hda/codecs/realtek/alc269.c
··· 6940 6940 SND_PCI_QUIRK(0x103c, 0x89da, "HP Spectre x360 14t-ea100", ALC245_FIXUP_HP_SPECTRE_X360_EU0XXX), 6941 6941 SND_PCI_QUIRK(0x103c, 0x89e7, "HP Elite x2 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 6942 6942 SND_PCI_QUIRK(0x103c, 0x8a0f, "HP Pavilion 14-ec1xxx", ALC287_FIXUP_HP_GPIO_LED), 6943 + SND_PCI_QUIRK(0x103c, 0x8a1f, "HP Laptop 14s-dr5xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), 6943 6944 SND_PCI_QUIRK(0x103c, 0x8a20, "HP Laptop 15s-fq5xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), 6944 6945 SND_PCI_QUIRK(0x103c, 0x8a25, "HP Victus 16-d1xxx (MB 8A25)", ALC245_FIXUP_HP_MUTE_LED_COEFBIT), 6945 6946 SND_PCI_QUIRK(0x103c, 0x8a26, "HP Victus 16-d1xxx (MB 8A26)", ALC245_FIXUP_HP_MUTE_LED_COEFBIT), ··· 7274 7273 SND_PCI_QUIRK(0x1043, 0x1e93, "ASUS ExpertBook B9403CVAR", ALC294_FIXUP_ASUS_HPE), 7275 7274 SND_PCI_QUIRK(0x1043, 0x1eb3, "ASUS Ally RCLA72", ALC287_FIXUP_TAS2781_I2C), 7276 7275 SND_PCI_QUIRK(0x1043, 0x1ed3, "ASUS HN7306W", ALC287_FIXUP_CS35L41_I2C_2), 7276 + HDA_CODEC_QUIRK(0x1043, 0x1ee2, "ASUS UM6702RA/RC", ALC285_FIXUP_ASUS_I2C_SPEAKER2_TO_DAC1), 7277 7277 SND_PCI_QUIRK(0x1043, 0x1ee2, "ASUS UM6702RA/RC", ALC287_FIXUP_CS35L41_I2C_2), 7278 7278 SND_PCI_QUIRK(0x1043, 0x1c52, "ASUS Zephyrus G15 2022", ALC289_FIXUP_ASUS_GA401), 7279 7279 SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401), ··· 7495 7493 SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 7496 7494 SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 7497 7495 SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 7496 + SND_PCI_QUIRK(0x17aa, 0x2288, "Thinkpad X390", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK), 7498 7497 SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_THINKPAD_HEADSET_JACK), 7499 7498 SND_PCI_QUIRK(0x17aa, 0x22be, "Thinkpad X1 Carbon 8th", ALC285_FIXUP_THINKPAD_HEADSET_JACK), 7500 7499 SND_PCI_QUIRK(0x17aa, 0x22c1, "Thinkpad P1 Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
+9
sound/hda/codecs/realtek/alc662.c
··· 313 313 ALC897_FIXUP_HEADSET_MIC_PIN2, 314 314 ALC897_FIXUP_UNIS_H3C_X500S, 315 315 ALC897_FIXUP_HEADSET_MIC_PIN3, 316 + ALC897_FIXUP_H610M_HP_PIN, 316 317 }; 317 318 318 319 static const struct hda_fixup alc662_fixups[] = { ··· 767 766 { } 768 767 }, 769 768 }, 769 + [ALC897_FIXUP_H610M_HP_PIN] = { 770 + .type = HDA_FIXUP_PINS, 771 + .v.pins = (const struct hda_pintbl[]) { 772 + { 0x19, 0x0321403f }, /* HP out */ 773 + { } 774 + }, 775 + }, 770 776 }; 771 777 772 778 static const struct hda_quirk alc662_fixup_tbl[] = { ··· 823 815 SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT), 824 816 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2), 825 817 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD), 818 + SND_PCI_QUIRK(0x1458, 0xa194, "H610M H V2 DDR4", ALC897_FIXUP_H610M_HP_PIN), 826 819 SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE), 827 820 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS), 828 821 SND_PCI_QUIRK(0x17aa, 0x1057, "Lenovo P360", ALC897_FIXUP_HEADSET_MIC_PIN),
+14 -4
sound/soc/amd/acp/acp-mach-common.c
··· 127 127 if (drvdata->hs_codec_id != RT5682) 128 128 return -EINVAL; 129 129 130 - drvdata->wclk = clk_get(component->dev, "rt5682-dai-wclk"); 131 - drvdata->bclk = clk_get(component->dev, "rt5682-dai-bclk"); 130 + drvdata->wclk = devm_clk_get(component->dev, "rt5682-dai-wclk"); 131 + if (IS_ERR(drvdata->wclk)) 132 + return PTR_ERR(drvdata->wclk); 133 + 134 + drvdata->bclk = devm_clk_get(component->dev, "rt5682-dai-bclk"); 135 + if (IS_ERR(drvdata->bclk)) 136 + return PTR_ERR(drvdata->bclk); 132 137 133 138 ret = snd_soc_dapm_new_controls(dapm, rt5682_widgets, 134 139 ARRAY_SIZE(rt5682_widgets)); ··· 375 370 return -EINVAL; 376 371 377 372 if (!drvdata->soc_mclk) { 378 - drvdata->wclk = clk_get(component->dev, "rt5682-dai-wclk"); 379 - drvdata->bclk = clk_get(component->dev, "rt5682-dai-bclk"); 373 + drvdata->wclk = devm_clk_get(component->dev, "rt5682-dai-wclk"); 374 + if (IS_ERR(drvdata->wclk)) 375 + return PTR_ERR(drvdata->wclk); 376 + 377 + drvdata->bclk = devm_clk_get(component->dev, "rt5682-dai-bclk"); 378 + if (IS_ERR(drvdata->bclk)) 379 + return PTR_ERR(drvdata->bclk); 380 380 } 381 381 382 382 ret = snd_soc_dapm_new_controls(dapm, rt5682s_widgets,
+7 -2
sound/soc/amd/acp3x-rt5682-max9836.c
··· 94 94 return ret; 95 95 } 96 96 97 - rt5682_dai_wclk = clk_get(component->dev, "rt5682-dai-wclk"); 98 - rt5682_dai_bclk = clk_get(component->dev, "rt5682-dai-bclk"); 97 + rt5682_dai_wclk = devm_clk_get(component->dev, "rt5682-dai-wclk"); 98 + if (IS_ERR(rt5682_dai_wclk)) 99 + return PTR_ERR(rt5682_dai_wclk); 100 + 101 + rt5682_dai_bclk = devm_clk_get(component->dev, "rt5682-dai-bclk"); 102 + if (IS_ERR(rt5682_dai_bclk)) 103 + return PTR_ERR(rt5682_dai_bclk); 99 104 100 105 ret = snd_soc_card_jack_new_pins(card, "Headset Jack", 101 106 SND_JACK_HEADSET |
+1 -1
sound/soc/codecs/rt1011.c
··· 1047 1047 struct snd_ctl_elem_value *ucontrol) 1048 1048 { 1049 1049 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 1050 - struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 1050 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1051 1051 struct rt1011_priv *rt1011 = 1052 1052 snd_soc_component_get_drvdata(component); 1053 1053
+8 -4
sound/soc/generic/simple-card-utils.c
··· 1038 1038 else 1039 1039 port = np; 1040 1040 1041 - struct device_node *ports __free(device_node) = of_get_parent(port); 1042 - struct device_node *top __free(device_node) = of_get_parent(ports); 1043 - struct device_node *ports0 __free(device_node) = of_get_child_by_name(top, "ports"); 1041 + struct device_node *ports __free(device_node) = of_get_parent(port); 1042 + const char *at = strchr(kbasename(ports->full_name), '@'); 1044 1043 1045 - return ports0 == ports; 1044 + /* 1045 + * Since child iteration order may differ 1046 + * between a base DT and DT overlays, 1047 + * string match "ports" or "ports@0" in the node name instead. 1048 + */ 1049 + return !at || !strcmp(at, "@0"); 1046 1050 } 1047 1051 EXPORT_SYMBOL_GPL(graph_util_is_ports0); 1048 1052
+1
sound/soc/qcom/qdsp6/q6apm-dai.c
··· 838 838 .ack = q6apm_dai_ack, 839 839 .compress_ops = &q6apm_dai_compress_ops, 840 840 .use_dai_pcm_id = true, 841 + .remove_order = SND_SOC_COMP_ORDER_EARLY, 841 842 }; 842 843 843 844 static int q6apm_dai_probe(struct platform_device *pdev)
+1
sound/soc/qcom/qdsp6/q6apm-lpass-dais.c
··· 278 278 .of_xlate_dai_name = q6dsp_audio_ports_of_xlate_dai_name, 279 279 .be_pcm_base = AUDIOREACH_BE_PCM_BASE, 280 280 .use_dai_pcm_id = true, 281 + .remove_order = SND_SOC_COMP_ORDER_FIRST, 281 282 }; 282 283 283 284 static int q6apm_lpass_dai_dev_probe(struct platform_device *pdev)
+1
sound/soc/qcom/qdsp6/q6apm.c
··· 715 715 .name = APM_AUDIO_DRV_NAME, 716 716 .probe = q6apm_audio_probe, 717 717 .remove = q6apm_audio_remove, 718 + .remove_order = SND_SOC_COMP_ORDER_LAST, 718 719 }; 719 720 720 721 static int apm_probe(gpr_device_t *gdev)
+8 -3
sound/soc/soc-core.c
··· 462 462 463 463 list_del(&rtd->list); 464 464 465 - if (delayed_work_pending(&rtd->delayed_work)) 466 - flush_delayed_work(&rtd->delayed_work); 465 + flush_delayed_work(&rtd->delayed_work); 467 466 snd_soc_pcm_component_free(rtd); 468 467 469 468 /* ··· 1863 1864 1864 1865 /* 1865 1866 * Check if a DMI field is valid, i.e. not containing any string 1866 - * in the black list. 1867 + * in the black list and not the empty string. 1867 1868 */ 1868 1869 static int is_dmi_valid(const char *field) 1869 1870 { 1870 1871 int i = 0; 1872 + 1873 + if (!field[0]) 1874 + return 0; 1871 1875 1872 1876 while (dmi_blacklist[i]) { 1873 1877 if (strstr(field, dmi_blacklist[i])) ··· 2124 2122 for_each_card_rtds(card, rtd) 2125 2123 if (rtd->initialized) 2126 2124 snd_soc_link_exit(rtd); 2125 + /* flush delayed work before removing DAIs and DAPM widgets */ 2126 + snd_soc_flush_all_delayed_work(card); 2127 + 2127 2128 /* remove and free each DAI */ 2128 2129 soc_remove_link_dais(card); 2129 2130 soc_remove_link_components(card);
+11
sound/soc/tegra/tegra_audio_graph_card.c
··· 231 231 .plla_out0_rates[x11_RATE] = 45158400, 232 232 }; 233 233 234 + static const struct tegra_audio_cdata tegra238_data = { 235 + /* PLLA */ 236 + .plla_rates[x8_RATE] = 1277952000, 237 + .plla_rates[x11_RATE] = 1264435200, 238 + /* PLLA_OUT0 */ 239 + .plla_out0_rates[x8_RATE] = 49152000, 240 + .plla_out0_rates[x11_RATE] = 45158400, 241 + }; 242 + 234 243 static const struct tegra_audio_cdata tegra264_data = { 235 244 /* PLLA1 */ 236 245 .plla_rates[x8_RATE] = 983040000, ··· 254 245 .data = &tegra210_data }, 255 246 { .compatible = "nvidia,tegra186-audio-graph-card", 256 247 .data = &tegra186_data }, 248 + { .compatible = "nvidia,tegra238-audio-graph-card", 249 + .data = &tegra238_data }, 257 250 { .compatible = "nvidia,tegra264-audio-graph-card", 258 251 .data = &tegra264_data }, 259 252 {},
+2
sound/usb/mixer_scarlett2.c
··· 8251 8251 8252 8252 if (desc->bInterfaceClass != 255) 8253 8253 continue; 8254 + if (desc->bNumEndpoints < 1) 8255 + continue; 8254 8256 8255 8257 epd = get_endpoint(intf->altsetting, 0); 8256 8258 private->bInterfaceNumber = desc->bInterfaceNumber;
+2
sound/usb/quirks.c
··· 2243 2243 QUIRK_FLAG_IFACE_DELAY | QUIRK_FLAG_FORCE_IFACE_RESET), 2244 2244 DEVICE_FLG(0x0661, 0x0883, /* iBasso DC04 Ultra */ 2245 2245 QUIRK_FLAG_DSD_RAW), 2246 + DEVICE_FLG(0x0666, 0x0880, /* SPACETOUCH USB Audio */ 2247 + QUIRK_FLAG_FORCE_IFACE_RESET | QUIRK_FLAG_IFACE_DELAY), 2246 2248 DEVICE_FLG(0x06f8, 0xb000, /* Hercules DJ Console (Windows Edition) */ 2247 2249 QUIRK_FLAG_IGNORE_CTL_ERROR), 2248 2250 DEVICE_FLG(0x06f8, 0xd002, /* Hercules DJ Console (Macintosh Edition) */