[alsa-devel] [PATCH v2 12/15] ASoC: soc-core: add missing return value check for soc_link_init()

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Wed Nov 27 07:48:19 CET 2019


Hi Pierre-Louis

> > diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
> > index 79a4753..bdae48e 100644
> > --- a/sound/soc/soc-core.c
> > +++ b/sound/soc/soc-core.c
> > @@ -1983,8 +1983,11 @@ static int snd_soc_bind_card(struct snd_soc_card *card)
> >   		goto probe_end;
> >   	}
> >   -	for_each_card_rtds(card, rtd)
> > -		soc_link_init(card, rtd);
> > +	for_each_card_rtds(card, rtd) {
> > +		ret = soc_link_init(card, rtd);
> > +		if (ret < 0)
> > +			goto probe_end;
> > +	}
> 
> Morimoto-san, this patch proves very useful to avoid a kernel oops
> when a dailink init fails, but I still see a warning when cleaning-up.
> 
> I was experimenting with a topology file that wasn't complete and came
> across the warning below, would you have any ideas/recommendations on
> what might be missing? I am running out of time this week so thought I
> would ask, in case this rings a bell.
> 
> Thanks!
> 
> [   21.098662] bytcr_rt5640 bytcr_rt5640: ASoC: no source widget found
> for modem_out
> [   21.098677] bytcr_rt5640 bytcr_rt5640: ASoC: Failed to add route
> modem_out -> direct -> ssp0 Tx
> [   21.098694] bytcr_rt5640 bytcr_rt5640: ASoC: no sink widget found
> for modem_in
> [   21.098703] bytcr_rt5640 bytcr_rt5640: ASoC: Failed to add route
> ssp0 Rx -> direct -> modem_in
> [   21.098732] bytcr_rt5640 bytcr_rt5640: ASoC: failed to init
> SSP2-Codec: -19

Do you mean, it could save you from Oops, but you still have warning ?

It seems soc-dapm::snd_soc_dapm_add_routes() failed.
Your kernel is missing widget route/path ?
Or, sound card driver has some issue ?

I have been faced this error many times.
I don't remember detail, but, if my memory was correct,
it was always card driver setup timing, or missing something, in my case.

Thank you for your help !!
Best regards
---
Kuninori Morimoto


More information about the Alsa-devel mailing list