Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ASoC: SOF: topology: Use partial match for disconnecting DAI link and DAI widget #4641

Merged
merged 1 commit into from
Oct 26, 2023

Conversation

bardliao
Copy link
Collaborator

We use partial match for connecting DAI link and DAI widget. We need to use partial match for disconnecting, too.

Fixes: fe88788 ("ASoC: SOF: topology: Use partial match for connecting DAI link and DAI widget")

@bardliao bardliao requested review from plbossart and ranj063 October 17, 2023 10:39
@bardliao bardliao requested a review from singalsu as a code owner October 17, 2023 10:39
plbossart
plbossart previously approved these changes Oct 17, 2023
@plbossart
Copy link
Member

one very odd faIlure for CML_SKU0955_HDA in https://sof-ci.01.org/linuxpr/PR4641/build414/devicetest/index.html

Wow.

ranj063
ranj063 previously approved these changes Oct 17, 2023
@bardliao
Copy link
Collaborator Author

SOFCI TEST

@plbossart
Copy link
Member

plbossart commented Oct 19, 2023

@bardliao GCC -fanalyzer found a fantastic bug in this PR

	list_for_each_entry(rtd, &card->rtd_list, list) {
		/* does stream match DAI link ? */
		if (!rtd->dai_link->stream_name ||
		    !strstr(rtd->dai_link->stream_name, w->sname)) <<< 2. in the next iteration w is dereferenced -> ooops
			continue;

		for_each_rtd_cpu_dais(rtd, i, cpu_dai)
			if (snd_soc_dai_get_widget(cpu_dai, stream) == w) {
				snd_soc_dai_set_widget(cpu_dai, stream, NULL); <<< 1. This sets w=NULL
				break;
			}
	}

suggested change:

strstr(rtd->dai_link->stream_name, sname)

would ignore changes to w - that's how the code was initially written btw.

… DAI widget

We use partial match for connecting DAI link and DAI widget. We need to
use partial match for disconnecting, too.

Fixes: fe88788 ("ASoC: SOF: topology: Use partial match for connecting DAI link and DAI widget")
Signed-off-by: Bard Liao <[email protected]>
@bardliao bardliao dismissed stale reviews from ranj063 and plbossart via 00595db October 20, 2023 11:28
@bardliao
Copy link
Collaborator Author

Thanks @plbossart. Updated now.

@plbossart
Copy link
Member

wow, all checks have passed!

@plbossart plbossart requested a review from ranj063 October 20, 2023 14:49
@plbossart plbossart merged commit 4806d2c into thesofproject:topic/sof-dev Oct 26, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants