Skip to content

Commit 1d11025

Browse files
committed
Merge tag 'sound-5.0-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "It's a bit of surprising that we've got more changes than hoped at this late stage, but they all don't look too scary but small fixes. One change in ALSA core side is again the PCM regression fix that was partially addressed for OSS, but now the all relevant change is reverted instead. Also, a few ASoC core fixes for UAF and OOB are included, while the rest are usual random device-specific fixes" * tag 'sound-5.0-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: pcm: Revert capture stream behavior change in blocking mode ALSA: usb-audio: Fix implicit fb endpoint setup by quirk ALSA: hda - Add quirk for HP EliteBook 840 G5 ASoC: samsung: Prevent clk_get_rate() calls in atomic context ASoC: rsnd: ssiu: correct shift bit for ssiu9 ASoC: rsnd: fixup rsnd_ssi_master_clk_start() user count check ASoC: dapm: fix out-of-bounds accesses to DAPM lookup tables ASoC: topology: fix oops/use-after-free case with dai driver ASoC: rsnd: fixup MIX kctrl registration ASoC: core: Allow soc_find_component lookups to match parent of_node ASoC: rt5682: Correct the setting while select ASRC clk for AD/DA filter ASoC: MAINTAINERS: fsl: Change Fabio's email address ASoC: hdmi-codec: fix oops on re-probe
2 parents 8ae757e + 00a399c commit 1d11025

File tree

13 files changed

+66
-34
lines changed

13 files changed

+66
-34
lines changed

MAINTAINERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6151,7 +6151,7 @@ FREESCALE SOC SOUND DRIVERS
61516151
M: Timur Tabi <timur@kernel.org>
61526152
M: Nicolin Chen <nicoleotsuka@gmail.com>
61536153
M: Xiubo Li <Xiubo.Lee@gmail.com>
6154-
R: Fabio Estevam <fabio.estevam@nxp.com>
6154+
R: Fabio Estevam <festevam@gmail.com>
61556155
L: alsa-devel@alsa-project.org (moderated for non-subscribers)
61566156
L: linuxppc-dev@lists.ozlabs.org
61576157
S: Maintained
@@ -10898,7 +10898,7 @@ F: include/linux/nvmem-consumer.h
1089810898
F: include/linux/nvmem-provider.h
1089910899

1090010900
NXP SGTL5000 DRIVER
10901-
M: Fabio Estevam <fabio.estevam@nxp.com>
10901+
M: Fabio Estevam <festevam@gmail.com>
1090210902
L: alsa-devel@alsa-project.org (moderated for non-subscribers)
1090310903
S: Maintained
1090410904
F: Documentation/devicetree/bindings/sound/sgtl5000.txt

sound/core/pcm_lib.c

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2112,13 +2112,6 @@ int pcm_lib_apply_appl_ptr(struct snd_pcm_substream *substream,
21122112
return 0;
21132113
}
21142114

2115-
/* allow waiting for a capture stream that hasn't been started */
2116-
#if IS_ENABLED(CONFIG_SND_PCM_OSS)
2117-
#define wait_capture_start(substream) ((substream)->oss.oss)
2118-
#else
2119-
#define wait_capture_start(substream) false
2120-
#endif
2121-
21222115
/* the common loop for read/write data */
21232116
snd_pcm_sframes_t __snd_pcm_lib_xfer(struct snd_pcm_substream *substream,
21242117
void *data, bool interleaved,
@@ -2184,16 +2177,11 @@ snd_pcm_sframes_t __snd_pcm_lib_xfer(struct snd_pcm_substream *substream,
21842177
snd_pcm_update_hw_ptr(substream);
21852178

21862179
if (!is_playback &&
2187-
runtime->status->state == SNDRV_PCM_STATE_PREPARED) {
2188-
if (size >= runtime->start_threshold) {
2189-
err = snd_pcm_start(substream);
2190-
if (err < 0)
2191-
goto _end_unlock;
2192-
} else if (!wait_capture_start(substream)) {
2193-
/* nothing to do */
2194-
err = 0;
2180+
runtime->status->state == SNDRV_PCM_STATE_PREPARED &&
2181+
size >= runtime->start_threshold) {
2182+
err = snd_pcm_start(substream);
2183+
if (err < 0)
21952184
goto _end_unlock;
2196-
}
21972185
}
21982186

21992187
avail = snd_pcm_avail(substream);

sound/pci/hda/patch_conexant.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -924,6 +924,7 @@ static const struct snd_pci_quirk cxt5066_fixups[] = {
924924
SND_PCI_QUIRK(0x103c, 0x807C, "HP EliteBook 820 G3", CXT_FIXUP_HP_DOCK),
925925
SND_PCI_QUIRK(0x103c, 0x80FD, "HP ProBook 640 G2", CXT_FIXUP_HP_DOCK),
926926
SND_PCI_QUIRK(0x103c, 0x828c, "HP EliteBook 840 G4", CXT_FIXUP_HP_DOCK),
927+
SND_PCI_QUIRK(0x103c, 0x83b2, "HP EliteBook 840 G5", CXT_FIXUP_HP_DOCK),
927928
SND_PCI_QUIRK(0x103c, 0x83b3, "HP EliteBook 830 G5", CXT_FIXUP_HP_DOCK),
928929
SND_PCI_QUIRK(0x103c, 0x83d3, "HP ProBook 640 G4", CXT_FIXUP_HP_DOCK),
929930
SND_PCI_QUIRK(0x103c, 0x8174, "HP Spectre x360", CXT_FIXUP_HP_SPECTRE),

sound/soc/codecs/hdmi-codec.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -795,15 +795,15 @@ static int hdmi_codec_probe(struct platform_device *pdev)
795795
if (hcd->spdif)
796796
hcp->daidrv[i] = hdmi_spdif_dai;
797797

798+
dev_set_drvdata(dev, hcp);
799+
798800
ret = devm_snd_soc_register_component(dev, &hdmi_driver, hcp->daidrv,
799801
dai_count);
800802
if (ret) {
801803
dev_err(dev, "%s: snd_soc_register_component() failed (%d)\n",
802804
__func__, ret);
803805
return ret;
804806
}
805-
806-
dev_set_drvdata(dev, hcp);
807807
return 0;
808808
}
809809

sound/soc/codecs/rt5682.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1778,7 +1778,9 @@ static const struct snd_soc_dapm_route rt5682_dapm_routes[] = {
17781778
{"ADC Stereo1 Filter", NULL, "ADC STO1 ASRC", is_using_asrc},
17791779
{"DAC Stereo1 Filter", NULL, "DAC STO1 ASRC", is_using_asrc},
17801780
{"ADC STO1 ASRC", NULL, "AD ASRC"},
1781+
{"ADC STO1 ASRC", NULL, "DA ASRC"},
17811782
{"ADC STO1 ASRC", NULL, "CLKDET"},
1783+
{"DAC STO1 ASRC", NULL, "AD ASRC"},
17821784
{"DAC STO1 ASRC", NULL, "DA ASRC"},
17831785
{"DAC STO1 ASRC", NULL, "CLKDET"},
17841786

sound/soc/samsung/i2s.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,7 @@ static int i2s_hw_params(struct snd_pcm_substream *substream,
700700
{
701701
struct i2s_dai *i2s = to_info(dai);
702702
u32 mod, mask = 0, val = 0;
703+
struct clk *rclksrc;
703704
unsigned long flags;
704705

705706
WARN_ON(!pm_runtime_active(dai->dev));
@@ -782,6 +783,10 @@ static int i2s_hw_params(struct snd_pcm_substream *substream,
782783

783784
i2s->frmclk = params_rate(params);
784785

786+
rclksrc = i2s->clk_table[CLK_I2S_RCLK_SRC];
787+
if (rclksrc && !IS_ERR(rclksrc))
788+
i2s->rclk_srcrate = clk_get_rate(rclksrc);
789+
785790
return 0;
786791
}
787792

@@ -886,11 +891,6 @@ static int config_setup(struct i2s_dai *i2s)
886891
return 0;
887892

888893
if (!(i2s->quirks & QUIRK_NO_MUXPSR)) {
889-
struct clk *rclksrc = i2s->clk_table[CLK_I2S_RCLK_SRC];
890-
891-
if (rclksrc && !IS_ERR(rclksrc))
892-
i2s->rclk_srcrate = clk_get_rate(rclksrc);
893-
894894
psr = i2s->rclk_srcrate / i2s->frmclk / rfs;
895895
writel(((psr - 1) << 8) | PSR_PSREN, i2s->addr + I2SPSR);
896896
dev_dbg(&i2s->pdev->dev,

sound/soc/sh/rcar/core.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1526,14 +1526,14 @@ int rsnd_kctrl_new(struct rsnd_mod *mod,
15261526
int ret;
15271527

15281528
/*
1529-
* 1) Avoid duplicate register (ex. MIXer case)
1530-
* 2) re-register if card was rebinded
1529+
* 1) Avoid duplicate register for DVC with MIX case
1530+
* 2) Allow duplicate register for MIX
1531+
* 3) re-register if card was rebinded
15311532
*/
15321533
list_for_each_entry(kctrl, &card->controls, list) {
15331534
struct rsnd_kctrl_cfg *c = kctrl->private_data;
15341535

1535-
if (strcmp(kctrl->id.name, name) == 0 &&
1536-
c->mod == mod)
1536+
if (c == cfg)
15371537
return 0;
15381538
}
15391539

sound/soc/sh/rcar/ssi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ static int rsnd_ssi_master_clk_start(struct rsnd_mod *mod,
286286
if (rsnd_ssi_is_multi_slave(mod, io))
287287
return 0;
288288

289-
if (ssi->usrcnt > 1) {
289+
if (ssi->usrcnt > 0) {
290290
if (ssi->rate != rate) {
291291
dev_err(dev, "SSI parent/child should use same rate\n");
292292
return -EINVAL;

sound/soc/sh/rcar/ssiu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ static int rsnd_ssiu_init(struct rsnd_mod *mod,
7979
break;
8080
case 9:
8181
for (i = 0; i < 4; i++)
82-
rsnd_mod_write(mod, SSI_SYS_STATUS((i * 2) + 1), 0xf << (id * 4));
82+
rsnd_mod_write(mod, SSI_SYS_STATUS((i * 2) + 1), 0xf << 4);
8383
break;
8484
}
8585

sound/soc/soc-core.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -735,12 +735,17 @@ static struct snd_soc_component *soc_find_component(
735735
const struct device_node *of_node, const char *name)
736736
{
737737
struct snd_soc_component *component;
738+
struct device_node *component_of_node;
738739

739740
lockdep_assert_held(&client_mutex);
740741

741742
for_each_component(component) {
742743
if (of_node) {
743-
if (component->dev->of_node == of_node)
744+
component_of_node = component->dev->of_node;
745+
if (!component_of_node && component->dev->parent)
746+
component_of_node = component->dev->parent->of_node;
747+
748+
if (component_of_node == of_node)
744749
return component;
745750
} else if (name && strcmp(component->name, name) == 0) {
746751
return component;
@@ -951,7 +956,7 @@ static void soc_remove_dai(struct snd_soc_dai *dai, int order)
951956
{
952957
int err;
953958

954-
if (!dai || !dai->probed ||
959+
if (!dai || !dai->probed || !dai->driver ||
955960
dai->driver->remove_order != order)
956961
return;
957962

sound/soc/soc-dapm.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,24 +70,36 @@ static int dapm_up_seq[] = {
7070
[snd_soc_dapm_clock_supply] = 1,
7171
[snd_soc_dapm_supply] = 2,
7272
[snd_soc_dapm_micbias] = 3,
73+
[snd_soc_dapm_vmid] = 3,
7374
[snd_soc_dapm_dai_link] = 2,
7475
[snd_soc_dapm_dai_in] = 4,
7576
[snd_soc_dapm_dai_out] = 4,
7677
[snd_soc_dapm_aif_in] = 4,
7778
[snd_soc_dapm_aif_out] = 4,
7879
[snd_soc_dapm_mic] = 5,
80+
[snd_soc_dapm_siggen] = 5,
81+
[snd_soc_dapm_input] = 5,
82+
[snd_soc_dapm_output] = 5,
7983
[snd_soc_dapm_mux] = 6,
8084
[snd_soc_dapm_demux] = 6,
8185
[snd_soc_dapm_dac] = 7,
8286
[snd_soc_dapm_switch] = 8,
8387
[snd_soc_dapm_mixer] = 8,
8488
[snd_soc_dapm_mixer_named_ctl] = 8,
8589
[snd_soc_dapm_pga] = 9,
90+
[snd_soc_dapm_buffer] = 9,
91+
[snd_soc_dapm_scheduler] = 9,
92+
[snd_soc_dapm_effect] = 9,
93+
[snd_soc_dapm_src] = 9,
94+
[snd_soc_dapm_asrc] = 9,
95+
[snd_soc_dapm_encoder] = 9,
96+
[snd_soc_dapm_decoder] = 9,
8697
[snd_soc_dapm_adc] = 10,
8798
[snd_soc_dapm_out_drv] = 11,
8899
[snd_soc_dapm_hp] = 11,
89100
[snd_soc_dapm_spk] = 11,
90101
[snd_soc_dapm_line] = 11,
102+
[snd_soc_dapm_sink] = 11,
91103
[snd_soc_dapm_kcontrol] = 12,
92104
[snd_soc_dapm_post] = 13,
93105
};
@@ -100,13 +112,25 @@ static int dapm_down_seq[] = {
100112
[snd_soc_dapm_spk] = 3,
101113
[snd_soc_dapm_line] = 3,
102114
[snd_soc_dapm_out_drv] = 3,
115+
[snd_soc_dapm_sink] = 3,
103116
[snd_soc_dapm_pga] = 4,
117+
[snd_soc_dapm_buffer] = 4,
118+
[snd_soc_dapm_scheduler] = 4,
119+
[snd_soc_dapm_effect] = 4,
120+
[snd_soc_dapm_src] = 4,
121+
[snd_soc_dapm_asrc] = 4,
122+
[snd_soc_dapm_encoder] = 4,
123+
[snd_soc_dapm_decoder] = 4,
104124
[snd_soc_dapm_switch] = 5,
105125
[snd_soc_dapm_mixer_named_ctl] = 5,
106126
[snd_soc_dapm_mixer] = 5,
107127
[snd_soc_dapm_dac] = 6,
108128
[snd_soc_dapm_mic] = 7,
129+
[snd_soc_dapm_siggen] = 7,
130+
[snd_soc_dapm_input] = 7,
131+
[snd_soc_dapm_output] = 7,
109132
[snd_soc_dapm_micbias] = 8,
133+
[snd_soc_dapm_vmid] = 8,
110134
[snd_soc_dapm_mux] = 9,
111135
[snd_soc_dapm_demux] = 9,
112136
[snd_soc_dapm_aif_in] = 10,

sound/soc/soc-topology.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,13 +502,18 @@ static void remove_dai(struct snd_soc_component *comp,
502502
{
503503
struct snd_soc_dai_driver *dai_drv =
504504
container_of(dobj, struct snd_soc_dai_driver, dobj);
505+
struct snd_soc_dai *dai;
505506

506507
if (pass != SOC_TPLG_PASS_PCM_DAI)
507508
return;
508509

509510
if (dobj->ops && dobj->ops->dai_unload)
510511
dobj->ops->dai_unload(comp, dobj);
511512

513+
list_for_each_entry(dai, &comp->dai_list, list)
514+
if (dai->driver == dai_drv)
515+
dai->driver = NULL;
516+
512517
kfree(dai_drv->name);
513518
list_del(&dobj->list);
514519
kfree(dai_drv);

sound/usb/pcm.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,9 @@ static int search_roland_implicit_fb(struct usb_device *dev, int ifnum,
314314
return 0;
315315
}
316316

317+
/* Setup an implicit feedback endpoint from a quirk. Returns 0 if no quirk
318+
* applies. Returns 1 if a quirk was found.
319+
*/
317320
static int set_sync_ep_implicit_fb_quirk(struct snd_usb_substream *subs,
318321
struct usb_device *dev,
319322
struct usb_interface_descriptor *altsd,
@@ -384,7 +387,7 @@ static int set_sync_ep_implicit_fb_quirk(struct snd_usb_substream *subs,
384387

385388
subs->data_endpoint->sync_master = subs->sync_endpoint;
386389

387-
return 0;
390+
return 1;
388391
}
389392

390393
static int set_sync_endpoint(struct snd_usb_substream *subs,
@@ -423,6 +426,10 @@ static int set_sync_endpoint(struct snd_usb_substream *subs,
423426
if (err < 0)
424427
return err;
425428

429+
/* endpoint set by quirk */
430+
if (err > 0)
431+
return 0;
432+
426433
if (altsd->bNumEndpoints < 2)
427434
return 0;
428435

0 commit comments

Comments
 (0)