ASoC: SOF: Fix runtime pm usage counter balance after fw exception
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Tue, 13 Feb 2024 11:47:29 +0000 (13:47 +0200)
committerMark Brown <broonie@kernel.org>
Tue, 13 Feb 2024 14:22:57 +0000 (14:22 +0000)
commitb30289e7fa927f921bfb4d0d04727461706ae822
tree5819e481173ef6792e0c62a0804a8e5be2a97df7
parentd0611f617d823a87f04186ad165e2990208c040b
ASoC: SOF: Fix runtime pm usage counter balance after fw exception

If the retain context is enabled we will unconditionally increment the
device's pm use count on each exception and when the drivers are unloaded
we do not correct this (as we don't know how many times we 'prevented
d3 entry').
Introduce a flag to make sure that we do not increment the use count more
than once and on module unload decrement the use count if needed to
balance it.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240213114729.7055-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/core.c
sound/soc/sof/debug.c
sound/soc/sof/sof-priv.h