-
Notifications
You must be signed in to change notification settings - Fork 150
ASoC: SOF: keep prepare/unprepare widgets in sink path #4022
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -309,9 +309,9 @@ sof_unprepare_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_dapm_widg | |
| const struct sof_ipc_tplg_widget_ops *widget_ops; | ||
| struct snd_soc_dapm_path *p; | ||
|
|
||
| /* return if the widget is in use or if it is already unprepared */ | ||
| if (!swidget->prepared || swidget->use_count > 1) | ||
| return; | ||
| /* skip if the widget is in use or if it is already unprepared */ | ||
| if (!swidget->prepared || swidget->use_count > 0) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can the use_count go negative? if (!swidget->prepared || swidget->use_count)
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Ideally, no. But I do see it is negative when I meet IPC errors. And sof_widget_free() will never work at that time. |
||
| goto sink_unprepare; | ||
|
plbossart marked this conversation as resolved.
|
||
|
|
||
| widget_ops = tplg_ops ? tplg_ops->widget : NULL; | ||
| if (widget_ops && widget_ops[widget->id].ipc_unprepare) | ||
|
|
@@ -320,6 +320,7 @@ sof_unprepare_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_dapm_widg | |
|
|
||
| swidget->prepared = false; | ||
|
|
||
| sink_unprepare: | ||
| /* unprepare all widgets in the sink paths */ | ||
| snd_soc_dapm_widget_for_each_sink_path(widget, p) { | ||
| if (!widget_in_list(list, p->sink)) | ||
|
|
@@ -347,7 +348,7 @@ sof_prepare_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_dapm_widget | |
|
|
||
| widget_ops = tplg_ops ? tplg_ops->widget : NULL; | ||
| if (!widget_ops) | ||
| return 0; | ||
| goto sink_prepare; | ||
|
|
||
| if (!widget_ops[widget->id].ipc_prepare || swidget->prepared) | ||
| goto sink_prepare; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.