diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2011-05-11 05:07:09 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-05-11 08:53:09 -0400 |
commit | f3f7c1837f6bcae3601fc535b339426868bf1549 (patch) | |
tree | 1baa013c8219969e65ee22d42ed4bb2293763195 /sound/firewire | |
parent | 3cabffd72c303c3b5bbbbe88c95b49043898d1f3 (diff) |
ALSA: isight: fix locking
Lockdep complains about conflicts between isight->mutex,
ALSA's register_mutex, mm->mmap_sem, and pcm->open_mutex.
This can be fixed by moving the calls to isight_pcm_abort(),
snd_card_disconnect(), and fw_iso_resources_update() out of
isight->mutex. These functions are designed to be called
asynchronously; the mutex needs to protect only the device
streaming state modified by isight_start/stop_streaming().
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Reported-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire')
-rw-r--r-- | sound/firewire/isight.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sound/firewire/isight.c b/sound/firewire/isight.c index 96267437d373..86ee16ca365e 100644 --- a/sound/firewire/isight.c +++ b/sound/firewire/isight.c | |||
@@ -692,9 +692,11 @@ static int isight_remove(struct device *dev) | |||
692 | { | 692 | { |
693 | struct isight *isight = dev_get_drvdata(dev); | 693 | struct isight *isight = dev_get_drvdata(dev); |
694 | 694 | ||
695 | mutex_lock(&isight->mutex); | ||
696 | isight_pcm_abort(isight); | 695 | isight_pcm_abort(isight); |
696 | |||
697 | snd_card_disconnect(isight->card); | 697 | snd_card_disconnect(isight->card); |
698 | |||
699 | mutex_lock(&isight->mutex); | ||
698 | isight_stop_streaming(isight); | 700 | isight_stop_streaming(isight); |
699 | mutex_unlock(&isight->mutex); | 701 | mutex_unlock(&isight->mutex); |
700 | 702 | ||
@@ -707,12 +709,13 @@ static void isight_bus_reset(struct fw_unit *unit) | |||
707 | { | 709 | { |
708 | struct isight *isight = dev_get_drvdata(&unit->device); | 710 | struct isight *isight = dev_get_drvdata(&unit->device); |
709 | 711 | ||
710 | mutex_lock(&isight->mutex); | ||
711 | if (fw_iso_resources_update(&isight->resources) < 0) { | 712 | if (fw_iso_resources_update(&isight->resources) < 0) { |
712 | isight_pcm_abort(isight); | 713 | isight_pcm_abort(isight); |
714 | |||
715 | mutex_lock(&isight->mutex); | ||
713 | isight_stop_streaming(isight); | 716 | isight_stop_streaming(isight); |
717 | mutex_unlock(&isight->mutex); | ||
714 | } | 718 | } |
715 | mutex_unlock(&isight->mutex); | ||
716 | } | 719 | } |
717 | 720 | ||
718 | static const struct ieee1394_device_id isight_id_table[] = { | 721 | static const struct ieee1394_device_id isight_id_table[] = { |