Skip to content

[HACK] ALSA: core: add traces in snd_power_ref_and_wait - #3374

Closed
plbossart wants to merge 6 commits into
thesofproject:topic/sof-devfrom
plbossart:test/snd-power-wait
Closed

plbossart wants to merge 6 commits into
thesofproject:topic/sof-devfrom
plbossart:test/snd-power-wait

Conversation

@plbossart

Copy link
Copy Markdown
Member

Add traces to see what happens when one task refuses to freeze.

Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com

Comment thread sound/soc/soc-core.c Outdated
EXPORT_SYMBOL_GPL(snd_soc_poweroff);

const struct dev_pm_ops snd_soc_pm_ops = {
.prepare = snd_soc_prepare,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The .prepare is used when the device is suspending, preceding the .suspend callback if I recall right.
Are you suspecting that a work from a previous resume is still executing or waiting for execution?
If that is the case then should we try to cancel it if it is not already running (we are after all going to suspend) or wait until it finishes to execute the work (cancel_work_sync())?

@plbossart plbossart Jan 19, 2022 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, the traces show that we try to bring the device in D0, but suspend immediately.
This patch was intended to delay the suspend until the resume is actually completed. i don't think it makes sense to cancel the resume, that is asking for trouble. We want to wait for the resume to be scheduled/completed, and if there's nothing to do to continue the suspend.

However the traces show that the freeze error happens before we reach the .prepare, so that's not helping.

@plbossart
plbossart force-pushed the test/snd-power-wait branch from 04be56f to 5001794 Compare January 19, 2022 00:38
@plbossart

Copy link
Copy Markdown
Member Author

Grrrr, PR devices not available. what a waste of time.

@plbossart

Copy link
Copy Markdown
Member Author

SOFCI TEST

@plbossart

Copy link
Copy Markdown
Member Author

SOF CI is behaving today, the devices timed out in https://sof-ci.01.org/linuxpr/PR3374/build6998/devicetest/

@plbossart

Copy link
Copy Markdown
Member Author

SOFCI TEST

@plbossart
plbossart force-pushed the test/snd-power-wait branch 2 times, most recently from 9003609 to 9859a43 Compare January 19, 2022 23:14
Provided by Takashi Iwai:

https://github.com/thesofproject/linux/files/7902858/snd-power-lock-ignore-freezer-v2.diff.txt

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Suggested by Takashi Iwai

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Add traces to see what happens when one task refuses to freeze.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Somehow the code gets stuck somewhere while starting the flush on
suspend.

Traces seem to suggest the issue is either in
dapm_mark_endpoints_dirty(card);
or
snd_soc_dapm_sync(&card->dapm);

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
@plbossart
plbossart force-pushed the test/snd-power-wait branch from 9859a43 to 1492724 Compare January 20, 2022 14:38
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
@plbossart

Copy link
Copy Markdown
Member Author

SOFCI TEST

@plbossart plbossart closed this Jan 26, 2022
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.

2 participants