diff options
author | Takashi Iwai <tiwai@suse.de> | 2017-08-30 16:13:25 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2017-08-30 20:44:29 +0200 |
commit | 7d8e8292013ab72ae1f1500cbc91f198ccb1826d (patch) | |
tree | 5586c0e3b0483c98d1fe210a87246fd70131ba35 /sound/core/init.c | |
parent | Merge branch 'for-linus' into for-next (diff) | |
download | linux-7d8e8292013ab72ae1f1500cbc91f198ccb1826d.tar.xz linux-7d8e8292013ab72ae1f1500cbc91f198ccb1826d.zip |
ALSA: Get rid of card power_lock
Currently we're taking power_lock at each card component for assuring
the power-up sequence, but it doesn't help anything in the
implementation at the moment: it just serializes unnecessarily the
callers, but it doesn't protect about the power state change itself.
It used to have some usefulness in the early days where we managed the
PM manually. But now the suspend/resume core procedure is beyond our
hands, and power_lock lost its meaning.
This patch drops the power_lock from allover the places.
There shouldn't be any issues by this change, as it's no helper
regarding the power state change. Rather we'll get better performance
by removing the serialization; which is the only slight concern of any
behavior change, but it can't be a showstopper, after all.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/init.c')
-rw-r--r-- | sound/core/init.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/sound/core/init.c b/sound/core/init.c index 6e219dc23f96..32ebe2f6bc59 100644 --- a/sound/core/init.c +++ b/sound/core/init.c @@ -253,7 +253,6 @@ int snd_card_new(struct device *parent, int idx, const char *xid, spin_lock_init(&card->files_lock); INIT_LIST_HEAD(&card->files_list); #ifdef CONFIG_PM - mutex_init(&card->power_lock); init_waitqueue_head(&card->power_sleep); #endif @@ -978,8 +977,6 @@ EXPORT_SYMBOL(snd_card_file_remove); * Waits until the power-state is changed. * * Return: Zero if successful, or a negative error code. - * - * Note: the power lock must be active before call. */ int snd_power_wait(struct snd_card *card, unsigned int power_state) { @@ -999,9 +996,7 @@ int snd_power_wait(struct snd_card *card, unsigned int power_state) if (snd_power_get_state(card) == power_state) break; set_current_state(TASK_UNINTERRUPTIBLE); - snd_power_unlock(card); schedule_timeout(30 * HZ); - snd_power_lock(card); } remove_wait_queue(&card->power_sleep, &wait); return result; |