Unverified Commit 12bf91b0 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!10069 ALSA: Fix deadlocks with kctl removals at disconnection

parents 12edeb35 c137fce5
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -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
}