Skip to content

ASoC/soundwire: Intel: add sdw_intel_pre_exit helper - #4843

Closed
bardliao wants to merge 1 commit into
thesofproject:topic/sof-devfrom
bardliao:test-4809
Closed

bardliao wants to merge 1 commit into
thesofproject:topic/sof-devfrom
bardliao:test-4809

Conversation

@bardliao

@bardliao bardliao commented Mar 4, 2024

Copy link
Copy Markdown
Collaborator

We will disable SDW interrupt in hda_sdw_exit() before sdw_intel_exit() and peripherals will on longer access SDW registers. However, when the manager became pm_runtime active in the remove procedure, peripherals will be attach, and do the initialization process. The commit suggests a sdw_intel_pre_exit() function to disable peripherals runtime pm and wait for peripherals to being initialized.

We will disable SDW interrupt in hda_sdw_exit() before sdw_intel_exit()
and peripherals will on longer access SDW registers. However, when
the manager became pm_runtime active in the remove procedure, peripherals
will be attach, and do the initialization process. The commit suggests
a sdw_intel_pre_exit() function to disable peripherals runtime pm
and wait for peripherals to being initialized.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>

@plbossart plbossart left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@bardliao I would rather continue with PR #4838 than this option.

return 0;
}

pm_runtime_disable(dev);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this is conceptually broken.

pm_runtime_disable() only means that the device can no longer enter pm_runtime suspend. It doesn't do what is suggested in the commit message "wait for peripherals to being initialized"

In addition, if something else tries to do a pm_runtime_get_sync() or pm_runtime_resume(), an error code -EACCESS will be thrown.

We should only use pm_runtime_disable() in the .remove functions or AFTER resuming the devices fully.

@bardliao bardliao closed this Mar 7, 2024
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