* [PATCH] ASoC: cs35l56: Fix pm_runtime imbalance if suspending before first attach
@ 2026-08-31 9:45 Richard Fitzgerald
2026-08-31 13:10 ` Mark Brown
2026-08-31 13:19 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Richard Fitzgerald @ 2026-08-31 9:45 UTC (permalink / raw)
To: broonie; +Cc: linux-sound, linux-kernel, patches
Remove the check for init_done in cs35l56_sdw_system_suspend(). Instead,
protect the call to cs35l56_mask_soundwire_interrupts() to only be done
if the amp is currently enumerated.
This fixes a runtime imbalance if cs35l56_sdw_system_suspend() is called
before the first SoundWire attach. This would skip the call to
pm_runtime_force_suspend() in cs35l56_system_suspend(). But resume
unconditionally called pm_runtime_force_resume() leading to an imbalance.
cs35l56_system_suspend() doesn't have any dependency on completion of
cs35l56_init(), so there is no need for the skip on !init_done in
cs35l56_sdw_system_suspend().
Fixes: f9dc6b875ec0a ("ASoC: cs35l56: Add basic system suspend handling")
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
---
sound/soc/codecs/cs35l56-sdw.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/cs35l56-sdw.c b/sound/soc/codecs/cs35l56-sdw.c
index 4fba59e80c37e..98bb4542b9143 100644
--- a/sound/soc/codecs/cs35l56-sdw.c
+++ b/sound/soc/codecs/cs35l56-sdw.c
@@ -386,11 +386,8 @@ static int __maybe_unused cs35l56_sdw_system_suspend(struct device *dev)
{
struct cs35l56_private *cs35l56 = dev_get_drvdata(dev);
- if (!cs35l56->base.init_done)
- return 0;
-
- /* runtime_resume unmasks the interrupt */
- cs35l56_mask_soundwire_interrupts(cs35l56);
+ if (cs35l56->sdw_attached)
+ cs35l56_mask_soundwire_interrupts(cs35l56);
return cs35l56_system_suspend(dev);
}
--
2.47.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: cs35l56: Fix pm_runtime imbalance if suspending before first attach
2026-08-31 9:45 [PATCH] ASoC: cs35l56: Fix pm_runtime imbalance if suspending before first attach Richard Fitzgerald
@ 2026-08-31 13:10 ` Mark Brown
2026-08-31 13:19 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2026-08-31 13:10 UTC (permalink / raw)
To: Richard Fitzgerald; +Cc: linux-sound, linux-kernel, patches
[-- Attachment #1: Type: text/plain, Size: 788 bytes --]
On Mon, Aug 31, 2026 at 10:45:06AM +0100, Richard Fitzgerald wrote:
> Remove the check for init_done in cs35l56_sdw_system_suspend(). Instead,
> protect the call to cs35l56_mask_soundwire_interrupts() to only be done
> if the amp is currently enumerated.
> @@ -386,11 +386,8 @@ static int __maybe_unused cs35l56_sdw_system_suspend(struct device *dev)
> {
> struct cs35l56_private *cs35l56 = dev_get_drvdata(dev);
>
> - if (!cs35l56->base.init_done)
> - return 0;
> -
> - /* runtime_resume unmasks the interrupt */
> - cs35l56_mask_soundwire_interrupts(cs35l56);
> + if (cs35l56->sdw_attached)
> + cs35l56_mask_soundwire_interrupts(cs35l56);
There's a thin race here on init - we call cs35l56_sdw_init() and unmask
the interrupts prior to setting sdw_attached.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: cs35l56: Fix pm_runtime imbalance if suspending before first attach
2026-08-31 9:45 [PATCH] ASoC: cs35l56: Fix pm_runtime imbalance if suspending before first attach Richard Fitzgerald
2026-08-31 13:10 ` Mark Brown
@ 2026-08-31 13:19 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2026-08-31 13:19 UTC (permalink / raw)
To: Richard Fitzgerald; +Cc: linux-sound, linux-kernel, patches
On Mon, 31 Aug 2026 10:45:06 +0100, Richard Fitzgerald wrote:
> ASoC: cs35l56: Fix pm_runtime imbalance if suspending before first attach
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.3
Thanks!
[1/1] ASoC: cs35l56: Fix pm_runtime imbalance if suspending before first attach
https://git.kernel.org/broonie/sound/c/fbf2c660bac8
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-09-01 11:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-31 9:45 [PATCH] ASoC: cs35l56: Fix pm_runtime imbalance if suspending before first attach Richard Fitzgerald
2026-08-31 13:10 ` Mark Brown
2026-08-31 13:19 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox