summaryrefslogtreecommitdiffstats
path: root/sound/core/init.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 05:09:00 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 05:09:00 +0000
commit953b921688bb14675ebdf3c36148d5a6cd7e1a76 (patch)
tree5a6ca8716e751fa40acca955073c8e5e5595c74e /sound/core/init.c
parentReleasing progress-linux version 6.8.11-1~progress7.99u1. (diff)
downloadlinux-953b921688bb14675ebdf3c36148d5a6cd7e1a76.tar.xz
linux-953b921688bb14675ebdf3c36148d5a6cd7e1a76.zip
Merging upstream version 6.8.12.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sound/core/init.c')
-rw-r--r--sound/core/init.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sound/core/init.c b/sound/core/init.c
index 22c0d217b8..d97b8af897 100644
--- a/sound/core/init.c
+++ b/sound/core/init.c
@@ -312,8 +312,8 @@ static int snd_card_init(struct snd_card *card, struct device *parent,
card->number = idx;
#ifdef MODULE
WARN_ON(!module);
- card->module = module;
#endif
+ card->module = module;
INIT_LIST_HEAD(&card->devices);
init_rwsem(&card->controls_rwsem);
rwlock_init(&card->ctl_files_rwlock);
@@ -523,6 +523,14 @@ void snd_card_disconnect(struct snd_card *card)
}
spin_unlock(&card->files_lock);
+#ifdef CONFIG_PM
+ /* wake up sleepers here before other callbacks for avoiding potential
+ * deadlocks with other locks (e.g. in kctls);
+ * then this notifies the shutdown and sleepers would abort immediately
+ */
+ wake_up_all(&card->power_sleep);
+#endif
+
/* notify all connected devices about disconnection */
/* at this point, they cannot respond to any calls except release() */
@@ -550,7 +558,6 @@ void snd_card_disconnect(struct snd_card *card)
mutex_unlock(&snd_card_mutex);
#ifdef CONFIG_PM
- wake_up(&card->power_sleep);
snd_power_sync_ref(card);
#endif
}