Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
ALSA: remove unneeded power_mutex lock in snd_pcm_drop
ALSA: fix locking in snd_pcm_open*() and snd_rawmidi_open*()

+7 -14
+2 -2
sound/core/pcm.c
··· 781 781 return -ENODEV; 782 782 783 783 card = pcm->card; 784 - down_read(&card->controls_rwsem); 784 + read_lock(&card->ctl_files_rwlock); 785 785 list_for_each_entry(kctl, &card->ctl_files, list) { 786 786 if (kctl->pid == current->pid) { 787 787 prefer_subdevice = kctl->prefer_pcm_subdevice; ··· 789 789 break; 790 790 } 791 791 } 792 - up_read(&card->controls_rwsem); 792 + read_unlock(&card->ctl_files_rwlock); 793 793 794 794 switch (stream) { 795 795 case SNDRV_PCM_STREAM_PLAYBACK:
+3 -10
sound/core/pcm_native.c
··· 1546 1546 card = substream->pcm->card; 1547 1547 1548 1548 if (runtime->status->state == SNDRV_PCM_STATE_OPEN || 1549 - runtime->status->state == SNDRV_PCM_STATE_DISCONNECTED) 1549 + runtime->status->state == SNDRV_PCM_STATE_DISCONNECTED || 1550 + runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) 1550 1551 return -EBADFD; 1551 - 1552 - snd_power_lock(card); 1553 - if (runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) { 1554 - result = snd_power_wait(card, SNDRV_CTL_POWER_D0); 1555 - if (result < 0) 1556 - goto _unlock; 1557 - } 1558 1552 1559 1553 snd_pcm_stream_lock_irq(substream); 1560 1554 /* resume pause */ ··· 1558 1564 snd_pcm_stop(substream, SNDRV_PCM_STATE_SETUP); 1559 1565 /* runtime->control->appl_ptr = runtime->status->hw_ptr; */ 1560 1566 snd_pcm_stream_unlock_irq(substream); 1561 - _unlock: 1562 - snd_power_unlock(card); 1567 + 1563 1568 return result; 1564 1569 } 1565 1570
+2 -2
sound/core/rawmidi.c
··· 418 418 mutex_lock(&rmidi->open_mutex); 419 419 while (1) { 420 420 subdevice = -1; 421 - down_read(&card->controls_rwsem); 421 + read_lock(&card->ctl_files_rwlock); 422 422 list_for_each_entry(kctl, &card->ctl_files, list) { 423 423 if (kctl->pid == current->pid) { 424 424 subdevice = kctl->prefer_rawmidi_subdevice; ··· 426 426 break; 427 427 } 428 428 } 429 - up_read(&card->controls_rwsem); 429 + read_unlock(&card->ctl_files_rwlock); 430 430 err = snd_rawmidi_kernel_open(rmidi->card, rmidi->device, 431 431 subdevice, fflags, rawmidi_file); 432 432 if (err >= 0)