]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: SOF: pcm: use pm_resume_and_get() on component probe
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Thu, 16 Jun 2022 21:08:24 +0000 (16:08 -0500)
committerMark Brown <broonie@kernel.org>
Fri, 17 Jun 2022 17:37:58 +0000 (18:37 +0100)
commit4fd3cc3ab813f88aa5187f85e1218c56f63345df
tree7a1a868a308519cf9c63a06946b9e00f9215e0d8
parent0f19ad4985fae22b49908895d0cf3bea3fc55838
ASoC: SOF: pcm: use pm_resume_and_get() on component probe

Before initiating IPC and/or bus transactions when loading the
topology during a component probe, which happens on card
registration/creation, make sure the device for the SOF driver is
pm_runtime active.

The SOF probe is not necessarily followed by the component probe, such
a timing assumption can be broken in driver bind/unbind tests. This
can be artifially shown if the module for the machine driver is
'blacklisted' and the SOF device becomes pm_runtime_suspended before
manually calling modprobe to register the card.

In an initial experiment, pm_resume_and_get() was called from
soc-component.c, since the current ASoC component model is arguably
missing dependencies between component status and device
status. However this approach proved too invasive and breaks all
existing HDMI playback solutions on Intel platforms.

While this will result in duplication of code, generating pm_runtime
transitions only if strictly required for a given component makes more
sense overall. This patch adds the pm_runtime resume transition for
SOF only.

BugLink: https://github.com/thesofproject/linux/issues/3651
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20220616210825.132093-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/pcm.c