Skip to contentSkip to conversation

ASoC: core: don't try to resume uninstantiated a soc-audio devices

PATCH In review Daniel Mack 2 participants 5 messages Nov 23, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: core: don't try to resume uninstantiated a soc-audio devices

The code tries to schedule a work item from the resume context, which will crash the kernel if snd_soc_instantiate_card() has not been called for the card before.

The bug I triggered is related to 82e14e8b ("ASoC: core: Don't schedule deferred_resume_work twice"), hence a backport to 3.1 is necessary.

Cc Liam Girdwood <[email protected]>
Cc Mark Brown <[email protected]>
Cc Stephen Warren <[email protected]>
---
 sound/soc/soc-core.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
sound/soc/soc-core.c +3 -0
index a5d3685..721f16e 100644
@@ -709,6 +709,9 @@ int snd_soc_resume(struct device *dev)
 	struct snd_soc_card *card = dev_get_drvdata(dev);
 	int i, ac97_control = 0;
 
+	if (!card->instantiated)
+		return 0;
+
 	/* AC97 devices might have other drivers hanging off them so
 	 * need to resume immediately.  Other drivers don't have that
 	 * problem and may take a substantial amount of time to resume
Signature · 1 line
1.7.7.3
#1 lore raw
Quoted 3 lines · Daniel Mack

The code tries to schedule a work item from the resume context, which will crash the kernel if snd_soc_instantiate_card() has not been called for the card before.

Eric already sent a slightly different fix for this which is applied.

#2 lore raw
Quoted 6 lines · Mark Brown
Quoted 3 lines · Daniel Mack

The code tries to schedule a work item from the resume context, which will crash the kernel if snd_soc_instantiate_card() has not been called for the card before.

Eric already sent a slightly different fix for this which is applied.

Could you give me a pointer to this patch? I had this problem today with Linus' latest git tip.

#3 lore raw
Quoted 10 lines · Daniel Mack
Quoted 6 lines · Mark Brown
Quoted 3 lines · Daniel Mack

The code tries to schedule a work item from the resume context, which will crash the kernel if snd_soc_instantiate_card() has not been called for the card before.

Eric already sent a slightly different fix for this which is applied.

Could you give me a pointer to this patch? I had this problem today with Linus' latest git tip.

It's the tip of my for-3.2. Slightly different fix but the effect should be the same.

#4 lore raw
Quoted 7 lines · Mark Brown
Quoted 5 lines · Daniel Mack
Quoted 4 lines · Mark Brown
Quoted 3 lines · Daniel Mack

The code tries to schedule a work item from the resume context, which will crash the kernel if snd_soc_instantiate_card() has not been called for the card before.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Eric already sent a slightly different fix for this which is applied.

Could you give me a pointer to this patch? I had this problem today with Linus' latest git tip.

It's the tip of my for-3.2. Slightly different fix but the effect should be the same.

I see, yes. But note that 3.1 also has this problem, so we need the patch to get backported.