Unverified Commit 76c49909 authored by Mark Brown's avatar Mark Brown
Browse files

Merge series "ASoC: topology: fix error handling flow" from Pierre-Louis...

Merge series "ASoC: topology: fix error handling flow" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

While experimenting and introducing errors in Baytrail topology files
until I got them right, I encountered multiple kernel oopses and
memory leaks. This is a first batch to harden the code, but we should
probably think of a tool to fuzz the topology...

Pierre-Louis Bossart (5):
  ASoC: topology: fix kernel oops on route addition error
  ASoC: topology: fix tlvs in error handling for widget_dmixer
  ASoC: topology: use break on errors, not continue
  ASoC: topology: factor kfree(se) in error handling
  ASoC: topology: add more logs when topology load fails.

 sound/soc/soc-topology.c | 97 ++++++++++++++++++++++++----------------
 1 file changed, 58 insertions(+), 39 deletions(-)

base-commit: a5911ac5
--
2.25.1
parents 81e7d4ce 8bf9475f
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -6956,6 +6956,7 @@ M: Timur Tabi <timur@kernel.org>
M:	Nicolin Chen <nicoleotsuka@gmail.com>
M:	Xiubo Li <Xiubo.Lee@gmail.com>
R:	Fabio Estevam <festevam@gmail.com>
R:	Shengjiu Wang <shengjiu.wang@gmail.com>
L:	alsa-devel@alsa-project.org (moderated for non-subscribers)
L:	linuxppc-dev@lists.ozlabs.org
S:	Maintained
@@ -11333,17 +11334,17 @@ F: drivers/iio/adc/at91-sama5d2_adc.c
F:	include/dt-bindings/iio/adc/at91-sama5d2_adc.h
MICROCHIP SAMA5D2-COMPATIBLE SHUTDOWN CONTROLLER
M:	Nicolas Ferre <nicolas.ferre@microchip.com>
M:	Claudiu Beznea <claudiu.beznea@microchip.com>
S:	Supported
F:	drivers/power/reset/at91-sama5d2_shdwc.c
MICROCHIP SPI DRIVER
M:	Nicolas Ferre <nicolas.ferre@microchip.com>
M:	Tudor Ambarus <tudor.ambarus@microchip.com>
S:	Supported
F:	drivers/spi/spi-atmel.*
MICROCHIP SSC DRIVER
M:	Nicolas Ferre <nicolas.ferre@microchip.com>
M:	Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
L:	linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
S:	Supported
F:	drivers/misc/atmel-ssc.c
+2 −0
Original line number Diff line number Diff line
@@ -426,6 +426,8 @@ int devm_snd_soc_register_component(struct device *dev,
			 const struct snd_soc_component_driver *component_driver,
			 struct snd_soc_dai_driver *dai_drv, int num_dai);
void snd_soc_unregister_component(struct device *dev);
void snd_soc_unregister_component_by_driver(struct device *dev,
			 const struct snd_soc_component_driver *component_driver);
struct snd_soc_component *snd_soc_lookup_component_nolocked(struct device *dev,
							    const char *driver_name);
struct snd_soc_component *snd_soc_lookup_component(struct device *dev,
+1 −3
Original line number Diff line number Diff line
@@ -232,9 +232,7 @@ static int snd_acp3x_probe(struct pci_dev *pci,
	}
	pm_runtime_set_autosuspend_delay(&pci->dev, 2000);
	pm_runtime_use_autosuspend(&pci->dev);
	pm_runtime_set_active(&pci->dev);
	pm_runtime_put_noidle(&pci->dev);
	pm_runtime_enable(&pci->dev);
	pm_runtime_allow(&pci->dev);
	return 0;

@@ -303,7 +301,7 @@ static void snd_acp3x_remove(struct pci_dev *pci)
	ret = acp3x_deinit(adata->acp3x_base);
	if (ret)
		dev_err(&pci->dev, "ACP de-init failed\n");
	pm_runtime_disable(&pci->dev);
	pm_runtime_forbid(&pci->dev);
	pm_runtime_get_noresume(&pci->dev);
	pci_disable_msi(pci);
	pci_release_regions(pci);
+10 −9
Original line number Diff line number Diff line
@@ -992,16 +992,17 @@ static int rt5682_set_jack_detect(struct snd_soc_component *component,

	rt5682->hs_jack = hs_jack;

	if (!rt5682->is_sdw) {
	if (!hs_jack) {
		regmap_update_bits(rt5682->regmap, RT5682_IRQ_CTRL_2,
			RT5682_JD1_EN_MASK, RT5682_JD1_DIS);
		regmap_update_bits(rt5682->regmap, RT5682_RC_CLK_CTRL,
			RT5682_POW_JDH | RT5682_POW_JDL, 0);
		cancel_delayed_work_sync(&rt5682->jack_detect_work);

		return 0;
	}

	if (!rt5682->is_sdw) {
		switch (rt5682->pdata.jd_src) {
		case RT5682_JD1:
			snd_soc_component_update_bits(component,
+13 −0
Original line number Diff line number Diff line
@@ -219,19 +219,32 @@ static int rockchip_sound_dmic_hw_params(struct snd_pcm_substream *substream,
	return 0;
}

static int rockchip_sound_startup(struct snd_pcm_substream *substream)
{
	struct snd_pcm_runtime *runtime = substream->runtime;

	runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE;
	return snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_RATE,
			8000, 96000);
}

static const struct snd_soc_ops rockchip_sound_max98357a_ops = {
	.startup = rockchip_sound_startup,
	.hw_params = rockchip_sound_max98357a_hw_params,
};

static const struct snd_soc_ops rockchip_sound_rt5514_ops = {
	.startup = rockchip_sound_startup,
	.hw_params = rockchip_sound_rt5514_hw_params,
};

static const struct snd_soc_ops rockchip_sound_da7219_ops = {
	.startup = rockchip_sound_startup,
	.hw_params = rockchip_sound_da7219_hw_params,
};

static const struct snd_soc_ops rockchip_sound_dmic_ops = {
	.startup = rockchip_sound_startup,
	.hw_params = rockchip_sound_dmic_hw_params,
};

Loading