Skip to content

Commit 0e95795

Browse files
committed
Merge tag 'sound-6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "A collection of small fixes for 6.15 final. It became slightly a higher amount than expected, but all look easy and safe to apply: - A fix for PCM core race spotted by fuzzing - ASoC topology fix for single DAI link - UAF fix for ASoC SOF Intel HD-audio at reloading - ASoC SOF Intel and Mediatek fixes - Trivial HD-audio quirks as usual" * tag 'sound-6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda/realtek - Add new HP ZBook laptop with micmute led fixup ALSA: hda/realtek: Add support for HP Agusta using CS35L41 HDA ALSA: hda/realtek: Add quirk for Lenovo Yoga Pro 7 14ASP10 ALSA: hda/realtek - restore auto-mute mode for Dell Chrome platform ALSA: pcm: Fix race of buffer access at PCM OSS layer ASoC: SOF: Intel: hda: Fix UAF when reloading module ASoc: SOF: topology: connect DAI to a single DAI link ASoC: SOF: Intel: hda-bus: Use PIO mode on ACE2+ platforms ASoC: SOF: ipc4-pcm: Delay reporting is only supported for playback direction ASoC: SOF: ipc4-control: Use SOF_CTRL_CMD_BINARY as numid for bytes_ext ASoC: mediatek: mt8188-mt6359: Depend on MT6359_ACCDET set or disabled ASoC: mediatek: mt8188-mt6359: select CONFIG_SND_SOC_MT6359_ACCDET
2 parents d608703 + f709b78 commit 0e95795

File tree

10 files changed

+65
-11
lines changed

10 files changed

+65
-11
lines changed

include/sound/pcm.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,6 +1404,8 @@ int snd_pcm_lib_mmap_iomem(struct snd_pcm_substream *substream, struct vm_area_s
14041404
#define snd_pcm_lib_mmap_iomem NULL
14051405
#endif
14061406

1407+
void snd_pcm_runtime_buffer_set_silence(struct snd_pcm_runtime *runtime);
1408+
14071409
/**
14081410
* snd_pcm_limit_isa_dma_size - Get the max size fitting with ISA DMA transfer
14091411
* @dma: DMA number

sound/core/oss/pcm_oss.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,8 +1074,7 @@ static int snd_pcm_oss_change_params_locked(struct snd_pcm_substream *substream)
10741074
runtime->oss.params = 0;
10751075
runtime->oss.prepare = 1;
10761076
runtime->oss.buffer_used = 0;
1077-
if (runtime->dma_area)
1078-
snd_pcm_format_set_silence(runtime->format, runtime->dma_area, bytes_to_samples(runtime, runtime->dma_bytes));
1077+
snd_pcm_runtime_buffer_set_silence(runtime);
10791078

10801079
runtime->oss.period_frames = snd_pcm_alsa_frames(substream, oss_period_size);
10811080

sound/core/pcm_native.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,17 @@ static void snd_pcm_buffer_access_unlock(struct snd_pcm_runtime *runtime)
723723
atomic_inc(&runtime->buffer_accessing);
724724
}
725725

726+
/* fill the PCM buffer with the current silence format; called from pcm_oss.c */
727+
void snd_pcm_runtime_buffer_set_silence(struct snd_pcm_runtime *runtime)
728+
{
729+
snd_pcm_buffer_access_lock(runtime);
730+
if (runtime->dma_area)
731+
snd_pcm_format_set_silence(runtime->format, runtime->dma_area,
732+
bytes_to_samples(runtime, runtime->dma_bytes));
733+
snd_pcm_buffer_access_unlock(runtime);
734+
}
735+
EXPORT_SYMBOL_GPL(snd_pcm_runtime_buffer_set_silence);
736+
726737
#if IS_ENABLED(CONFIG_SND_PCM_OSS)
727738
#define is_oss_stream(substream) ((substream)->oss.oss)
728739
#else

sound/pci/hda/patch_realtek.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6830,7 +6830,10 @@ static void alc256_fixup_chromebook(struct hda_codec *codec,
68306830

68316831
switch (action) {
68326832
case HDA_FIXUP_ACT_PRE_PROBE:
6833-
spec->gen.suppress_auto_mute = 1;
6833+
if (codec->core.subsystem_id == 0x10280d76)
6834+
spec->gen.suppress_auto_mute = 0;
6835+
else
6836+
spec->gen.suppress_auto_mute = 1;
68346837
spec->gen.suppress_auto_mic = 1;
68356838
spec->en_3kpull_low = false;
68366839
break;
@@ -10882,9 +10885,12 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
1088210885
SND_PCI_QUIRK(0x103c, 0x8e1a, "HP ZBook Firefly 14 G12A", ALC245_FIXUP_HP_ZBOOK_FIREFLY_G12A),
1088310886
SND_PCI_QUIRK(0x103c, 0x8e1b, "HP EliteBook G12", ALC245_FIXUP_HP_ZBOOK_FIREFLY_G12A),
1088410887
SND_PCI_QUIRK(0x103c, 0x8e1c, "HP EliteBook G12", ALC245_FIXUP_HP_ZBOOK_FIREFLY_G12A),
10888+
SND_PCI_QUIRK(0x103c, 0x8e1d, "HP ZBook X Gli 16 G12", ALC236_FIXUP_HP_GPIO_LED),
1088510889
SND_PCI_QUIRK(0x103c, 0x8e2c, "HP EliteBook 16 G12", ALC285_FIXUP_HP_GPIO_LED),
1088610890
SND_PCI_QUIRK(0x103c, 0x8e36, "HP 14 Enstrom OmniBook X", ALC287_FIXUP_CS35L41_I2C_2),
1088710891
SND_PCI_QUIRK(0x103c, 0x8e37, "HP 16 Piston OmniBook X", ALC287_FIXUP_CS35L41_I2C_2),
10892+
SND_PCI_QUIRK(0x103c, 0x8e3a, "HP Agusta", ALC287_FIXUP_CS35L41_I2C_2),
10893+
SND_PCI_QUIRK(0x103c, 0x8e3b, "HP Agusta", ALC287_FIXUP_CS35L41_I2C_2),
1088810894
SND_PCI_QUIRK(0x103c, 0x8e60, "HP Trekker ", ALC287_FIXUP_CS35L41_I2C_2),
1088910895
SND_PCI_QUIRK(0x103c, 0x8e61, "HP Trekker ", ALC287_FIXUP_CS35L41_I2C_2),
1089010896
SND_PCI_QUIRK(0x103c, 0x8e62, "HP Trekker ", ALC287_FIXUP_CS35L41_I2C_2),
@@ -11300,6 +11306,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
1130011306
SND_PCI_QUIRK(0x17aa, 0x38fa, "Thinkbook 16P Gen5", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
1130111307
SND_PCI_QUIRK(0x17aa, 0x38fd, "ThinkBook plus Gen5 Hybrid", ALC287_FIXUP_TAS2781_I2C),
1130211308
SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
11309+
SND_PCI_QUIRK(0x17aa, 0x390d, "Lenovo Yoga Pro 7 14ASP10", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
1130311310
SND_PCI_QUIRK(0x17aa, 0x3913, "Lenovo 145", ALC236_FIXUP_LENOVO_INV_DMIC),
1130411311
SND_PCI_QUIRK(0x17aa, 0x391f, "Yoga S990-16 pro Quad YC Quad", ALC287_FIXUP_TAS2781_I2C),
1130511312
SND_PCI_QUIRK(0x17aa, 0x3920, "Yoga S990-16 pro Quad VECO Quad", ALC287_FIXUP_TAS2781_I2C),

sound/soc/mediatek/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ config SND_SOC_MT8188
228228
config SND_SOC_MT8188_MT6359
229229
tristate "ASoC Audio driver for MT8188 with MT6359 and I2S codecs"
230230
depends on SND_SOC_MT8188 && MTK_PMIC_WRAP
231+
depends on SND_SOC_MT6359_ACCDET || !SND_SOC_MT6359_ACCDET
231232
depends on I2C
232233
select SND_SOC_MT6359
233234
select SND_SOC_HDMI_CODEC

sound/soc/sof/intel/hda-bus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ void sof_hda_bus_init(struct snd_sof_dev *sdev, struct device *dev)
7676

7777
snd_hdac_ext_bus_init(bus, dev, &bus_core_ops, sof_hda_ext_ops);
7878

79-
if (chip && chip->hw_ip_version == SOF_INTEL_ACE_2_0)
79+
if (chip && chip->hw_ip_version >= SOF_INTEL_ACE_2_0)
8080
bus->use_pio_for_commands = true;
8181
#else
8282
snd_hdac_ext_bus_init(bus, dev, NULL, NULL);

sound/soc/sof/intel/hda.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1049,7 +1049,21 @@ static void hda_generic_machine_select(struct snd_sof_dev *sdev,
10491049
if (!*mach && codec_num <= 2) {
10501050
bool tplg_fixup = false;
10511051

1052-
hda_mach = snd_soc_acpi_intel_hda_machines;
1052+
/*
1053+
* make a local copy of the match array since we might
1054+
* be modifying it
1055+
*/
1056+
hda_mach = devm_kmemdup_array(sdev->dev,
1057+
snd_soc_acpi_intel_hda_machines,
1058+
2, /* we have one entry + sentinel in the array */
1059+
sizeof(snd_soc_acpi_intel_hda_machines[0]),
1060+
GFP_KERNEL);
1061+
if (!hda_mach) {
1062+
dev_err(bus->dev,
1063+
"%s: failed to duplicate the HDA match table\n",
1064+
__func__);
1065+
return;
1066+
}
10531067

10541068
dev_info(bus->dev, "using HDA machine driver %s now\n",
10551069
hda_mach->drv_name);

sound/soc/sof/ipc4-control.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,14 @@ static int sof_ipc4_bytes_ext_put(struct snd_sof_control *scontrol,
531531
return -EINVAL;
532532
}
533533

534+
/* Check header id */
535+
if (header.numid != SOF_CTRL_CMD_BINARY) {
536+
dev_err_ratelimited(scomp->dev,
537+
"Incorrect numid for bytes put %d\n",
538+
header.numid);
539+
return -EINVAL;
540+
}
541+
534542
/* Verify the ABI header first */
535543
if (copy_from_user(&abi_hdr, tlvd->tlv, sizeof(abi_hdr)))
536544
return -EFAULT;
@@ -613,7 +621,8 @@ static int _sof_ipc4_bytes_ext_get(struct snd_sof_control *scontrol,
613621
if (data_size > size)
614622
return -ENOSPC;
615623

616-
header.numid = scontrol->comp_id;
624+
/* Set header id and length */
625+
header.numid = SOF_CTRL_CMD_BINARY;
617626
header.length = data_size;
618627

619628
if (copy_to_user(tlvd, &header, sizeof(struct snd_ctl_tlv)))

sound/soc/sof/ipc4-pcm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,8 @@ static int sof_ipc4_pcm_setup(struct snd_sof_dev *sdev, struct snd_sof_pcm *spcm
798798

799799
spcm->stream[stream].private = stream_priv;
800800

801-
if (!support_info)
801+
/* Delay reporting is only supported on playback */
802+
if (!support_info || stream == SNDRV_PCM_STREAM_CAPTURE)
802803
continue;
803804

804805
time_info = kzalloc(sizeof(*time_info), GFP_KERNEL);

sound/soc/sof/topology.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,7 +1063,7 @@ static int sof_connect_dai_widget(struct snd_soc_component *scomp,
10631063
struct snd_sof_dai *dai)
10641064
{
10651065
struct snd_soc_card *card = scomp->card;
1066-
struct snd_soc_pcm_runtime *rtd;
1066+
struct snd_soc_pcm_runtime *rtd, *full, *partial;
10671067
struct snd_soc_dai *cpu_dai;
10681068
int stream;
10691069
int i;
@@ -1080,12 +1080,22 @@ static int sof_connect_dai_widget(struct snd_soc_component *scomp,
10801080
else
10811081
goto end;
10821082

1083+
full = NULL;
1084+
partial = NULL;
10831085
list_for_each_entry(rtd, &card->rtd_list, list) {
10841086
/* does stream match DAI link ? */
1085-
if (!rtd->dai_link->stream_name ||
1086-
!strstr(rtd->dai_link->stream_name, w->sname))
1087-
continue;
1087+
if (rtd->dai_link->stream_name) {
1088+
if (!strcmp(rtd->dai_link->stream_name, w->sname)) {
1089+
full = rtd;
1090+
break;
1091+
} else if (strstr(rtd->dai_link->stream_name, w->sname)) {
1092+
partial = rtd;
1093+
}
1094+
}
1095+
}
10881096

1097+
rtd = full ? full : partial;
1098+
if (rtd) {
10891099
for_each_rtd_cpu_dais(rtd, i, cpu_dai) {
10901100
/*
10911101
* Please create DAI widget in the right order

0 commit comments

Comments
 (0)